ggPredictive {CNPBayes}R Documentation

Compare the posterior predictive distribution to the empirical data

Description

Compare the posterior predictive distribution to the empirical data

Usage

ggPredictive(model, predict, adjust = 1/3)

Arguments

model

a SB, MB, SBP, or MBP model

predict

a tibble of the posterior predictive values, batch (only for MB and MBP models), and mixture component assignments

adjust

a length-one numeric vector passed to geom_density – controls the smoothness of the kernal density

Value

a 'gg' object

Examples

  bmodel <- MultiBatchModelExample
  mp <- McmcParams(iter=500, burnin=150, nStarts=4)
  mcmcParams(bmodel) <- mp
  ## Not run: 
     ## this is preferred to posteriorSimulation, but takes longer
     bmodel <- gibbs(model="MB", dat=y(bmodel), mp=mp, hp.list=hpList()[["MB"]],
                     batches=batch(bmodel))
  
## End(Not run)
  bmodel <- posteriorSimulation(bmodel)
  tab <- posteriorPredictive(bmodel)
  ggPredictive(bmodel, tab)

[Package CNPBayes version 1.10.0 Index]