predict.sbde {sbde}R Documentation

Posterior predictive Summary for Semiparametric Density Estimation

Description

Extract posterior predictive density estimate for sbde

Usage

 
## S3 method for class 'sbde'
predict(object, burn.perc = 0.5, nmc = 200, yRange = range(object$y), yLength = 401, ...)

Arguments

object

a fitted model of the class 'sbde'.

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.

...

no additional parameters are used.

Value

Returns a list with three items:

y

vector giving the grid over which the posterior predictive density is evaluated.

fsamp

a matrix with yLength many rows and nmc many columns. Each column corresponds to a draw of the response density from the posterior predictive.

fest

summary of the posterior predictive density given by point-wise median, 2.5th and 97.5th percentiles.

See Also

sbde, coef.sbde and summary.sbde.

Examples

y <- abs(rt(n=1000, df=4))
fit <- sbde(y, blocking="all", fbase="gpd", verbose=FALSE)
pp <- predict(fit)
hist(y, 50, freq=FALSE)
with(pp, for(j in 1:3) lines(y, fest[,j], lty=1+(j!=2)))

[Package sbde version 1.0-1 Index]