predict.qde {qrjoint} | R Documentation |
Posterior predictive summary for quantile-based density estimation
Description
Extract posterior predictive density estimate for qde
Usage
## S3 method for class 'qde'
predict(object, burn.perc = 0.5, nmc = 200, yRange = range(object$y), yLength = 401, ...)
Arguments
object |
a fitted model of the class 'qde'. |
burn.perc |
a positive fraction indicating what fraction of the saved draws are to be discarded as burn-in |
nmc |
integer giving the number of samples, post burn-in, to be used in Monte Carlo averaging |
yRange |
range of values over which posterior predictive density is to be evaluated |
yLength |
number of grid points spanning yRange for posterior predictive density evaluation |
... |
currently no additional arguments are allowed |
Value
Returns a list with three items:
y |
vector giving the grid over which the posterior predictive density is evaluated. |
fsamp |
a matrix with |
fest |
summary of the posterior predictive density given by point-wise median, 2.5th and 97.5th percentiles. |
See Also
qde
and summary.qde
.
Examples
# Plasma data analysis
data(plasma)
Y <- plasma$BetaPlasma
Y <- Y + 0.1 * rnorm(length(Y)) ## remove atomicity
# model fitting with 50 posterior samples from 100 iterations (thin = 2)
fit.qde <- qde(Y, 50, 2)
pred <- predict(fit.qde)
hist(Y, freq = FALSE, col = "gray", border = "white", ylim = c(0, max(pred$fest)))
matplot(pred$y, pred$fest, type="l", col=1, lty=c(2,1,2), ylab="Density", xlab="y")