Learn R Programming

bspec (version 1.6)

ppsample: Posterior predictive sampling

Description

Draws a sample from the posterior predictive distribution specified by the supplied bspec object.

Usage

ppsample(x, ...)
# S3 method for bspec
ppsample(x, start=x$start, ...)

Arguments

x

a bspec object specifying the posterior distribution from which to sample.

start

the start time of the resulting time series.

...

currently unused.

Value

A time series (ts) object of the same kind (with respect to sampling rate and sample size) as the data the posterior distribution is based on.

See Also

bspec, sample.bspec

Examples

Run this code
# NOT RUN {
par(mfrow=c(2,1))
plot(lh, main="'lh' data")
plot(ppsample(bspec(lh)), main="posterior predictive sample")
par(mfrow=c(1,1))
# }

Run the code above in your browser using DataLab