posterior_predict.pandemicEstimated: Draw from the posterior predictive distribution for pandemic...

View source: R/posterior_predict.pandemicEstimated.R

posterior_predict.pandemicEstimatedR Documentation

Draw from the posterior predictive distribution for pandemic data

Description

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.

Usage

## S3 method for class 'pandemicEstimated'
posterior_predict(object, horizonLong = 500, horizonShort = 14, ...)

Arguments

object

An object of class pandemicEstimated created by function pandemic_model.

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.

Value

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:

predictive_Long

A M x horizonLong matrix with the full sample of the predictive distribution for the long-term prediction, where M is the sample size. The prediction is for daily new cases.

predictive_Short

A M x horizonShort matrix with the full sample of the predictive distribution for the short-term prediction, where M is the sample size. The prediction is for daily cumulative cases.

data

The data passed on from the pandemicEstimated-objects under the element Y$data.

location

A string with the name of the location.

cases_type

A string with either "confirmed" or "deaths" to represent the type of data that has been fitted and predicted.

pastMu

The fitted means of the data for the observed data points.

futMu

The predicted means of the data for the predicted data points.

Function pandemic_stats provides a few useful statistics based on the predictions.

References

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/

See Also

pandemic_model, pandemic_stats and plot.pandemicPredicted. Details about the models behind the calculations can be seen in models.

Examples

## Not run: 
dataMG = load_covid("Brazil","MG")
estimMG = pandemic_model(dataMG)
predMG = posterior_predict(estimMG)
predMG
## End(Not run)

PandemicLP documentation built on March 18, 2022, 6:22 p.m.