simssm {TSSS} | R Documentation |
Simulation by Gaussian State Space Model
Description
Simulate time series by Gaussian State Space Model.
Usage
simssm(n = 200, trend = NULL, seasonal.order = 0, seasonal = NULL,
arcoef = NULL, ar = NULL, tau1 = NULL, tau2 = NULL, tau3 = NULL,
sigma2 = 1.0, seed = NULL, plot = TRUE, ...)
Arguments
n |
the number of data generated by simulation. |
trend |
initial values of trend component of length |
seasonal.order |
order of seasonal component model (0, 1, 2). |
seasonal |
if |
arcoef |
AR coefficients. |
ar |
initial values of AR component. |
tau1 |
variance of trend component model. |
tau2 |
variance of AR component model. |
tau3 |
variance of seasonal component model. |
sigma2 |
variance of the observation noise. |
seed |
arbitrary positive integer to generate a sequence of uniform random numbers. The default seed is based on the current time. |
plot |
logical. If |
... |
graphical arguments passed to |
Value
An object of class "simulate"
, giving simulated data of Gaussian state
space model.
References
Kitagawa, G. (2020) Introduction to Time Series Modeling with Applications in R. Chapman & Hall/CRC.
Examples
# BLSALLFOOD data
data(BLSALLFOOD)
m1 <- 2; m2 <- 1; m3 <- 2
z <- season(BLSALLFOOD, trend.order = m1, seasonal.order = m2, ar.order = m3)
nl <- length(BLSALLFOOD)
trend <- z$trend[m1:1]
arcoef <- z$arcoef
period <- 12
seasonal <- z$seasonal[(period-1):1]
ar <- z$ar[m3:1]
tau1 <- z$tau2[1]
tau2 <- z$tau2[2]
tau3 <- z$tau2[3]
simssm(n = nl, trend, seasonal.order = m2, seasonal, arcoef, ar, tau1, tau2, tau3,
sigma2 = z$sigma2, seed = 333)