One step prediction errors on a holdout sample
Description
Computes the onestepahead prediction errors for a model of class
bsts
on a holdout sample.
Usage
1 2 3 4  bsts.holdout.prediction.errors(bsts.object,
newdata,
burn = SuggestBurn(.1, bsts.object),
na.action = na.omit)

Arguments
bsts.object 
An object of class 
newdata 
The holdout sample of data. If

burn 
An integer giving the number of MCMC iterations to discard
as burnin. If 
na.action 
A function determining what should be done with
missing values in 
Value
A matrix of draws of the onestepahead prediction errors. Rows of the matrix correspond to MCMC draws. Columns correspond to time.
Author(s)
Steven L. Scott stevescott@google.com
References
Harvey (1990), "Forecasting, structural time series, and the Kalman filter", Cambridge University Press.
Durbin and Koopman (2001), "Time series analysis by state space methods", Oxford University Press.
See Also
bsts
,
AddLocalLevel
,
AddLocalLinearTrend
,
AddGeneralizedLocalLinearTrend
,
SpikeSlabPrior
,
SdPrior
,
bsts.prediction.errors
.
Examples
1 2 3 4 5 6 7  data(AirPassengers)
y < log(AirPassengers)
ss < AddLocalLinearTrend(list(), y)
ss < AddSeasonal(ss, y, nseasons = 12)
model < bsts(y, state.specification = ss, niter = 500)
errors < bsts.prediction.errors(model, burn = 100)
PlotDynamicDistribution(errors)
