-
Notifications
You must be signed in to change notification settings - Fork 25
/
add.local.level.Rd
executable file
·77 lines (60 loc) · 2.08 KB
/
add.local.level.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
% Copyright 2012 Google Inc. All Rights Reserved.
% Author: [email protected] (Steve Scott)
\name{add.local.level}
\alias{AddLocalLevel}
\Rdversion{1.1}
\title{
Local level trend state component
}
\description{
Add a local level model to a state specification.
The local level model assumes the trend is a
random walk: \deqn{\alpha_{t+1} = \alpha_t + \epsilon_t \qquad
\epsilon_t \sim \mathcal{N}(0,\sigma).}{%
alpha[t+1] = alpha[t] + rnorm(1, 0, sigma). }
The prior is on the \eqn{\sigma}{sigma}
parameter.
}
\usage{
AddLocalLevel(
state.specification,
y,
sigma.prior,
initial.state.prior,
sdy,
initial.y)
}
\arguments{
\item{state.specification}{A list of state components that you wish to add to. If
omitted, an empty list will be assumed. }
\item{y}{ The time series to be modeled, as a numeric vector.}
\item{sigma.prior}{An object created by \code{\link[Boom]{SdPrior}}
describing the prior distribution for the standard deviation of the
random walk increments.}
\item{initial.state.prior}{An object created using
\code{\link[Boom]{NormalPrior}}, describing the prior distribution
of the initial state vector (at time 1).}
\item{sdy}{The standard deviation of the series to be modeled. This
will be ignored if \code{y} is provided, or if all the required
prior distributions are supplied directly. }
\item{initial.y}{The initial value of the series being modeled. This will be
ignored if \code{y} is provided, or if the priors for the initial
state are all provided directly.}
}
\value{ Returns a list with the elements necessary to specify a local
linear trend state model.}
\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.
}
\author{
Steven L. Scott \email{[email protected]}
}
\seealso{
\code{\link{bsts}}.
\code{\link[Boom]{SdPrior}}
\code{\link[Boom]{NormalPrior}}
}
\keyword{models}