Learn R Programming

bsts (version 0.6.1)

summary.bsts: Summarize a Bayesian structural time series object

Description

Print a summary of a bsts object.

Usage

## S3 method for class 'bsts':
summary(object, burn = SuggestBurn(.1, object), ...)

Arguments

object
An object of class bsts created by the function of the same name.
burn
The number of MCMC iterations to discard as burn-in.
...
Additional arguments passed to summary.lm.spike if object has a regression component.

Value

  • Returns a list with the following elements.
  • residual.sdThe posterior mean of the residual standard deviation parameter.
  • prediction.sdThe standard deviation of the one-step-ahead prediction errors for the training data.
  • rsquareProportion by which the residual variance is less than the variance of the original observations.
  • relative.gofHarvey's goodness of fit statistic. Let $\nu$ denote the one step ahead prediction errors, $n$ denote the length of the series, and $y$ denote the original series. The goodness of fit statistic is $$1 - \sum_{i = 1}^n \nu_i^2 / \sum_{i = 2}{n} (\Delta y_i- \Delta \bar y)^2$$.

    This statistic is analogous to $R^2$ in a regression model, but the baseline model is a random walk with drift, instead of the mean of the data. Unlike a traditional R-square statistic, this can be negative.

  • sizeDistribution of the number of nonzero coefficients appearing in the model
  • coefficientsIf object contains a regression component then the output contains matrix with rows corresponding to coefficients, and columns corresponding to:
    • The posterior probability the variable is included.
    • The posterior probability that the variable is positive.
    • The conditional expectation of the coefficient, given inclusion.
    • The conditional standard deviation of the coefficient, given inclusion.

References

Harvey's goodness of fit statistic is from Harvey (1989) Forecasting, structural time series models, and the Kalman filter. Page 268.

See Also

bsts, plot.bsts, summary.lm.spike

Examples

Run this code
data(AirPassengers)
  y <- log(AirPassengers)
  ss <- AddLocalLinearTrend(list(), y)
  ss <- AddSeasonal(ss, y, nseasons = 12)
  model <- bsts(y, state.specification = ss, niter = 100)
  summary(model, burn  = 20)

Run the code above in your browser using DataLab