posteriorPredictive {CNPBayes}R Documentation

Simulate data from the posterior predictive distribution

Description

Simulating from the posterior predictive distribution can be helpful for assessing the adequacy of the mixture model.

Usage

posteriorPredictive(model)

Arguments

model

a SingleBatchModel or MultiBatchModel

Examples


 model <- SingleBatchModelExample
 mp <- McmcParams(iter=200, burnin=50)
 mcmcParams(model) <- mp
 model <- posteriorSimulation(model)
 pd <- posteriorPredictive(model)
 if(FALSE) qqplot(pd, y(model))

## Not run: 
    bmodel <- MultiBatchModelExample
    mp <- McmcParams(iter=500, burnin=150, nStarts=20)
    mcmcParams(bmodel) <- mp
    bmodel <- posteriorSimulation(bmodel)
    batchy <- posteriorPredictive(bmodel)

## End(Not run)


[Package CNPBayes version 1.12.0 Index]