View source: R/posterior_predictive.R
posterior_predict.flexreg | R Documentation |
`flexreg`
objectsThe function takes an object of class `flexreg`
and generates values from the posterior predictive distribution.
## S3 method for class 'flexreg'
posterior_predict(model, newdata = NULL, n.new = NULL)
model |
an object of class |
newdata |
an optional |
n.new |
an optional vector containing the total number of trials with which to predict. It must be specified if |
The function generates values from the posterior predictive distribution, which is the distribution of a future outcome given the observed data.
The posterior predictive distribution is computed for y
in case of bounded continuous responses and
for y/n
in case of bounded discrete responses.
An object of class `flexreg_postpred`
containing a matrix with the simulated posterior predictions. Each column refers to a statistical unit to predict.
Ascari, R., Migliorati, S. (2021). A new regression model for overdispersed binomial data accounting for outliers and an excess of zeros. Statistics in Medicine, 40(17), 3895–3914. doi:10.1002/sim.9005
Di Brisco, A. M., Migliorati, S., Ongaro, A. (2020). Robustness against outliers: A new variance inflated regression model for proportions. Statistical Modelling, 20(3), 274–309. doi:10.1177/1471082X18821213
Gelman, A., Carlin, J. B., Stern, H. S., Rubin, D. B. (2014). Bayesian Data Analysis, 3th edition. Chapman and Hall/CRC. doi:10.1201/b16018
Migliorati, S., Di Brisco, A. M., Ongaro, A. (2018). A New Regression Model for Bounded Responses. Bayesian Analysis, 13(3), 845–872. doi:10.1214/17-BA1079
## Not run:
data("Reading")
FB <- flexreg(accuracy.adj ~ iq, data = Reading, n.iter=1000)
pp <- posterior_predict(FB)
plot(pp)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.