replication {BayesSAE} | R Documentation |
This function draws replicated data from posterior predictive distributions. With these replications, one can display graphical posterior checks or compute the Bayesian p-value to see whether the model fits the data well. See details in Gelman et. al (2006).
replication(object, repperdr = 1, ...)
object |
an object of class obtained by |
repperdr |
number of replicated data each posterior draw generated. See also Details. |
... |
currently not used |
Let θ denote all the parameters in the model, and θ^{i}, i = 0, 1, …, n be the
n
posterior draws. Supposing the argument repperdr is 5, and then 5 replications would be obtained
from the distribution p(y|θ^{i}) for each i.
m * k
matrix of replicated data where m
is the number of domains. Values are sorted as the
direct estimators.
Chengchun Shi
You, Y. and Chapman, B. (2006) Small Area Estimation Using Area Level Models and Estimated Sampling Variances. Survey Methodology, 32: 97-103.
#load data set data(SAIPE) #obtain MCMC draws result <- BayesSAE(SACPR~SNAPR+CenPR+CPER|Vardir, data = SAIPE, mcmc = 5000) #obtain replicated data replication(result)