-
Notifications
You must be signed in to change notification settings - Fork 25
/
predict.mbsts.Rd
93 lines (76 loc) · 3.35 KB
/
predict.mbsts.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
% Copyright 2019 Steven L. Scott. All Rights Reserved.
% Author: [email protected] (Steve Scott)
\name{predict.mbsts}
\alias{predict.mbsts}
\alias{mbsts.prediction}
\title{Prediction for Multivariate Bayesian Structural Time Series}
\Rdversion{1.1}
\description{Generate draws from the posterior predictive distribution
of an \code{\link{mbsts}} object.}
\usage{
\method{predict}{mbsts}(object,
horizon = 1,
newdata = NULL,
timestamps = NULL,
burn = SuggestBurn(.1, object),
na.action = na.exclude,
quantiles = c(.025, .975),
seed = NULL,
...)
}
\arguments{
\item{object}{An object of class \code{\link{mbsts}}.}
\item{horizon}{An integer specifying the number of periods into the
future you wish to predict. If \code{object} contains a regression
component then the forecast horizon is \code{nrow(newdata)} and this
argument is not used.}
\item{newdata}{A vector, matrix, or data frame containing the
predictor variables to use in making the prediction. This is only
required if \code{object} contains a regression component. If a
data frame, it must include variables with the same names as the
data used to fit \code{object}. The first observation in newdata is
assumed to be one time unit after the end of the last data used in
fitting \code{object}, and the subsequent observations are
sequential time points. If the regression part of \code{object}
contains only a single predictor then newdata can be a vector. If
\code{newdata} is passed as a matrix it is the caller's
responsibility to ensure that it contains the correct number of
columns and that the columns correspond to those in
object$coefficients. }
\item{timestamps}{A vector of time stamps (of the same type as the
timestamps used to fit \code{object}), with one per row of
\code{newdata} (or element of \code{newdata}, if \code{newdata} is a
vector). The time stamps give the time points as which each
prediction is desired. They must be interpretable as integer (0 or
larger) time steps following the last time stamp in \code{object}.
If \code{NULL}, then the requested predictions are interpreted as
being at 1, 2, 3, ... steps following the training data.}
\item{burn}{An integer describing the number of MCMC iterations in
\code{object} to be discarded as burn-in. If burn <= 0 then no
burn-in period will be discarded.}
\item{na.action}{A function determining what should be done with
missing values in \code{newdata}.}
\item{quantiles}{A numeric vector of length 2 giving the lower and
upper quantiles to use for the forecast interval estimate.}
\item{seed}{An integer to use as the C++ random seed. If
\code{NULL} then the C++ seed will be set using the clock.}
\item{\dots}{Not used. Present to match the signature of the
default predict method.}
}
\details{
The prediction is based off of samples taken from the posterior
distribution of a multivariate Bayesian structural time series model.
As an added convenience, means and interval estimates are produced
from the posterior predictive distribution.
}
\value{
Returns an object of class mbsts.prediction, which is a list.
}
\author{
Steven L. Scott
}
\seealso{
\code{\link{mbsts}}.
\code{\link{predict.bsts}}
\code{\link{plot.mbsts.prediction}}
}