Skip to contents

Predictions from a bqmm fit

Usage

# S3 method for class 'bqmm'
predict(
  object,
  newdata = NULL,
  re.form = NULL,
  noncrossing = c("none", "rearrange"),
  ...
)

Arguments

object

A bqmm fit.

newdata

Optional data frame; if omitted, training data are used.

re.form

NULL includes random effects (training data only); NA gives population-level predictions.

noncrossing

One of "none" or "rearrange". Rearrangement only has an effect for bqmm_multi objects (multiple quantiles).

...

Unused.

Value

Numeric vector of predicted conditional quantiles.

Examples

# \donttest{
fit <- bqmm(distance ~ age + (1 | Subject), data = nlme::Orthodont,
            tau = 0.5, chains = 1, iter = 300, refresh = 0, seed = 1)
#> Warning: The largest R-hat is 1.07, indicating chains have not mixed.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#r-hat
#> Warning: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#bulk-ess
#> Warning: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliable.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#tail-ess
#> Warning: Some Rhat > 1.01; chains may not have converged.
#> Warning: Some effective sample sizes < 100; consider more iterations.
head(predict(fit, re.form = NA))
#> [1] 22.29890 23.49976 24.70062 25.90149 22.29890 23.49976
# }