Description Usage Arguments Details Value Note See Also Examples
compose.mar1s
composes MAR(1)S process realization by given
vector of log-innovations.
decompose.mar1s
extracts MAR(1)S process components from time
series.
1 2 3 4 5 |
object |
An object of class |
loginnov |
A univariate time series containing the log-innovations. |
absdata |
A univariate or multivariate time series containing the process realization. |
start.time |
The sampling time for the first simulation step. |
xreg.absdata |
A matrix-like object with row count = |
init.absdata |
A vector specifying the initial values of the process. If
|
Multiplicative AR(1) with Seasonal (MAR(1)S) process is defined as
\code{x[t] = exp(s[t] + y[t])}
\code{y[t, 1] = b[1]*y[t, 2] + … + b[k]*y[t, k + 1] + z[t]}
\code{z[t] = a*z[t-1] + e[t]}
where
s[t] is the log-seasonal component,
y[t] is the AR(1) (log-stochastic) component,
e[t] is the log-residuals (random component).
absdata |
Realization of the process (a univariate or multivariate time series object). |
logdata |
Logarithm of |
logstoch |
Log-stochastic component (a univariate or multivariate time series object). |
logresid |
Random component (a univariate time series object). |
decompose.mar1s
and fit.mar1s
compute the random
component in different ways: decompose.mar1s
uses filter
while fit.mar1s
saves the residuals returned by arima
.
The results may be different in:
decompose.mar1s
uses specified
init.absdata
while arima
always assumes zero initial
values for the fitted process;
decompose.mar1s
handles non-finite
values more accurately.
compose.ar1
for the AR(1) with external regressors
processes, fit.mar1s
for fitting MAR(1)S process to
data, sim.mar1s
for MAR(1)S process simulation and
prediction.
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 | data(forest.fire, package = "mar1s")
data(nesterov.index, package = "mar1s")
## Simple
mar1s <- fit.mar1s(window(forest.fire, 1969, 1989))
x <- ts(rnorm(365, sd = mar1s$logresid.sd), start = c(1989, 1))
plot(compose.mar1s(mar1s, x)$absdata)
decomp <- decompose.mar1s(mar1s, mar1s$decomposed$absdata)
delta <- abs(nan2na(mar1s$decomposed$logresid) -
nan2na(decomp$logresid))
stopifnot(all(na.exclude(tail(delta, -1)) < 1E-6))
## External regressors
mar1s <- fit.mar1s(window(forest.fire, 1969, 1989),
window(nesterov.index[, "mean"], 1969, 1989))
x <- rnorm(365, sd = mar1s$logresid.sd)
xreg <- window(nesterov.index[, "mean"], 1989.001, 1990)
plot(compose.mar1s(mar1s, x, c(1989, 1), xreg)$absdata)
decomp <- decompose.mar1s(mar1s, mar1s$decomposed$absdata)
delta <- abs(mar1s$decomposed$logstoch - decomp$logstoch)
stopifnot(all(na.exclude(delta) < 1E-6))
delta <- abs(nan2na(mar1s$decomposed$logresid) -
nan2na(decomp$logresid))
stopifnot(all(na.exclude(tail(delta, -1)) < 1E-6))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.