View source: R/mixed.frequency.R
plot.bsts.mixed | R Documentation |
Functions for plotting the output of a mixed frequency time series regression.
## S3 method for class 'bsts.mixed'
plot(x,
y = c("state", "components",
"coefficients", "predictors", "size"),
...)
PlotBstsMixedState(bsts.mixed.object,
burn = SuggestBurn(.1, bsts.mixed.object),
time = NULL,
fine.scale = FALSE,
style = c("dynamic", "boxplot"),
trim.left = NULL,
trim.right = NULL,
...)
PlotBstsMixedComponents(bsts.mixed.object,
burn = SuggestBurn(.1, bsts.mixed.object),
time = NULL,
same.scale = TRUE,
fine.scale = FALSE,
style = c("dynamic", "boxplot"),
layout = c("square", "horizontal", "vertical"),
ylim = NULL,
trim.left = NULL,
trim.right = NULL,
...)
x |
An object of class |
bsts.mixed.object |
An object of class |
y |
A character string indicating the aspect of the model that should be plotted. |
burn |
The number of MCMC iterations to discard as burn-in. |
time |
An optional vector of values to plot against. If missing, the default is to obtain the time scale from the original time series. |
fine.scale |
Logical. If |
same.scale |
Logical. If |
style |
character. If "dynamic" then a dynamic distribution plot will be shown. If "box" then boxplots will be shown. |
layout |
A character string indicating whether the plots showing components of state should be laid out in a square, horizontally, or vertically. |
trim.left |
A logical indicating whether the first (presumedly partial) observation in the aggregated state time series should be removed. |
trim.right |
A logical indicating whether the last (presumedly partial) observation in the aggregated state time series should be removed. |
ylim |
Limits for the vertical axis. Optional. |
... |
Additional arguments to be passed to
|
PlotBstsMixedState
plots the aggregate state
contribution (including regression effects) to the mean, while
PlotBstsComponents
plots the contribution of each state
component separately. PlotBstsCoefficients
creates a
significance plot for the predictors used in the state space
regression model.
These functions are called for their side effect, which is to produce a plot on the current graphics device.
bsts.mixed
PlotDynamicDistribution
plot.lm.spike
PlotBstsSize
## Not run:
## This example is flaky and needs to be fixed
data <- SimulateFakeMixedFrequencyData(nweeks = 104, xdim = 20)
state.specification <- AddLocalLinearTrend(list(), data$coarse.target)
weeks <- index(data$predictor)
months <- index(data$coarse.target)
which.month <- MatchWeekToMonth(weeks, months[1])
membership.fraction <- GetFractionOfDaysInInitialMonth(weeks)
contains.end <- WeekEndsMonth(weeks)
model <- bsts.mixed(target.series = data$coarse.target,
predictors = data$predictors,
membership.fraction = membership.fraction,
contains.end = contains.end,
which.coarse = which.month,
state.specification = state.specification,
niter = 500)
plot(model, "state")
plot(model, "components")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.