loo-prediction: Generic functions for LOO predictions

loo-predictionR Documentation

Generic functions for LOO predictions

Description

See the methods in the rstanarm package for examples.

Usage

loo_linpred(object, ...)

loo_predict(object, ...)

loo_predictive_interval(object, ...)

loo_pit(object, ...)

## Default S3 method:
loo_pit(object, y, lw, ...)

Arguments

object

The object to use.

...

Arguments passed to methods. See the methods in the rstanarm package for examples.

y

For the default method of loo_pit(), a vector of y values the same length as the number of columns in the matrix used as object.

lw

For the default method of loo_pit(), a matrix of log-weights of the same length as the number of columns in the matrix used as object.

Value

loo_predict(), loo_linpred(), and loo_pit() (probability integral transform) methods should return a vector with length equal to the number of observations in the data. For discrete observations, probability integral transform is randomised to ensure theoretical uniformity. Fix random seed for reproducible results with discrete data. For more details, see Czado et al. (2009). loo_predictive_interval() methods should return a two-column matrix formatted in the same way as for predictive_interval().

References

Czado, C., Gneiting, T., and Held, L. (2009). Predictive Model Assessment for Count Data. Biometrics. 65(4), 1254-1261. doi:10.1111/j.1541-0420.2009.01191.x. Journal version: https://doi.org/10.1111/j.1541-0420.2009.01191.x

See Also

  • Guidelines and recommendations for developers of R packages interfacing with Stan and a demonstration getting a simple package working can be found in the vignettes included with rstantools and at mc-stan.org/rstantools/articles.


stan-dev/rstantools documentation built on April 15, 2024, 11:13 p.m.