View source: R/posterior_predict.pandemicEstimated.R
posterior_predict.pandemicEstimated | R Documentation |
The posterior predictive distribution is the distribution of the outcome implied by the model after using the observed data to update our beliefs about the unknown parameters in the model. Simulating data from the posterior predictive distribution using the observed predictors is useful for checking the fit of the model. Drawing from the posterior predictive distribution at interesting values of the predictors also lets us visualize how a manipulation of a predictor affects (a function of) the outcome(s). With new observations of predictor variables we can use the posterior predictive distribution to generate predicted outcomes.
## S3 method for class 'pandemicEstimated' posterior_predict(object, horizonLong = 500, horizonShort = 14, ...)
object |
An object of class |
horizonLong |
How far into the future the long-term prediction is desired. |
horizonShort |
How far into the future the short-term prediction is desired. |
... |
Currently unused. |
An object of class pandemicPredicted
. It includes the sampled predictive distribution
the model used to predict, which is the same as the one used to estimate the data. This object can be used
directly into the plot function and contains the following elements:
|
A |
|
A |
|
The data passed on from the |
|
A string with the name of the location. |
|
A string with either "confirmed" or "deaths" to represent the type of data that has been fitted and predicted. |
|
The fitted means of the data for the observed data points. |
|
The predicted means of the data for the predicted data points. |
Function pandemic_stats
provides a few useful statistics based on the predictions.
CovidLP Team, 2020. CovidLP: Short and Long-term Prediction for COVID-19. Departamento de Estatistica. UFMG, Brazil. URL: http://est.ufmg.br/covidlp/home/en/
pandemic_model
, pandemic_stats
and plot.pandemicPredicted
. Details
about the models behind the calculations can be seen in models
.
## Not run: dataMG = load_covid("Brazil","MG") estimMG = pandemic_model(dataMG) predMG = posterior_predict(estimMG) predMG ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.