compose.mar1s: Compose and Decompose MAR(1)S Process

Description Usage Arguments Details Value Note See Also Examples

Description

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.

Usage

1
2
3
4
5
compose.mar1s(object, loginnov, start.time = head(time(loginnov), 1),
              xreg.absdata = NULL, init.absdata = NULL)

decompose.mar1s(object, absdata, start.time = head(time(absdata), 1),
                init.absdata = rep(NA, NCOL(absdata)))

Arguments

object

An object of class "mar1s" specifying the model parameters.

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 = n.ahead, specifying the values for the external regressors. If NULL, default values are used.

init.absdata

A vector specifying the initial values of the process. If NULL, default values are used.

Details

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).

Value

absdata

Realization of the process (a univariate or multivariate time series object).

logdata

Logarithm of absdata (a univariate or multivariate time series object).

logstoch

Log-stochastic component (a univariate or multivariate time series object).

logresid

Random component (a univariate time series object).

Note

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:

the first value:

decompose.mar1s uses specified init.absdata while arima always assumes zero initial values for the fitted process;

non-finite values:

decompose.mar1s handles non-finite values more accurately.

See Also

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.

Examples

 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))

aparamon/mar1s documentation built on May 5, 2019, 6:54 p.m.