posterior_predict.flexreg {FlexReg} | R Documentation |
Posterior Predictive Method for `flexreg`
objects
Description
The function takes an object of class `flexreg`
and generates values from the posterior predictive distribution.
Usage
## S3 method for class 'flexreg'
posterior_predict(model, newdata = NULL, n.new = NULL)
Arguments
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 |
Details
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.
Value
An object of class `flexreg_postpred`
containing a matrix with the simulated posterior predictions. Each column refers to a statistical unit to predict.
References
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
Examples
## Not run:
data("Reading")
FB <- flexreg(accuracy.adj ~ iq, data = Reading, n.iter=1000)
pp <- posterior_predict(FB)
plot(pp)
## End(Not run)