arma.filter: arma.filter

Description Usage Arguments Value Examples

Description

Filtering of (kvar-variate) time series with marima type model.

Calculation of residuals and filtered values of timeseries using a marima model.

Usage

1
2
arma.filter(series = NULL, ar.poly = array(diag(kvar), dim = c(kvar, kvar,
  1)), ma.poly = array(diag(kvar), dim = c(kvar, kvar, 1)), means = 1)

Arguments

series

matrix holding the kvar by n multivariate timeseries (if (kvar > n) the series is transposed and a warning is given).

ar.poly

(kvar, kvar, p+1) array containing autoregressive matrix polynomial model part. If the filtering is to be performed for undifferenced data when the analysis (in marima) was done for differenced data, the input array ar.poly should incorporate the ar-representation of the differensing operation (using, for example: ar.poly <- pol.mul(ar.estimate, dif.poly, L = ( dim(ar.estimates)[3]+dim(dif.poly)[3])), where 'dif.poly' was obtained when differencing the time series (using define.dif) before analysing it with marima (giving the ar.estimate) .

ma.poly

(kvar, kvar, q+1) array containing moving average matrix polynomial model part.

If a leading unity matrix is not included in the ar- and/or the ma-part of the model this is automatically taken care of in the function (in that case the dimensions of the model arrays used in arma.filter() are, respectively, (kvar, kvar, p+1) and (kvar, kvar, q+1)).

means

vector (length = kvar) indicating whether means are subtracted or not (0/1). Default : means = 1 saying that all means are subtracted (equivalent to means = c(1, 1, ..., 1)).

Value

estimates = estimated values for input series

residuals = corresponding residuals. It is noted that the residuals computed by arma.filter may deviate slightly from the marima-residuals (which are taken from the last repeated regression step performed). The residuals computed by arma.filter are constructed by filtering (successive use of the arma model) and using a heuristic method for the first residuals.

averages = averages of variables in input series

mean.pattern = pattern of means as used in filtering

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(marima)
data(austr)
series<-t(austr)[,1:90]
# Define marima model
Model5 <- define.model(kvar=7,ar=1,ma=1,rem.var=1,reg.var=6:7)

# Estimate marima model
Marima5 <- marima(series,Model5$ar.pattern,Model5$ma.pattern,penalty=1)

# Calculate residuals by filtering
Resid <- arma.filter(series, Marima5$ar.estimates,
     Marima5$ma.estimates)

# Compare residuals

plot(Marima5$residuals[2, 5:90], Resid$residuals[2, 5:90],
xlab='marima residuals', ylab='arma.filter residuals')

marima documentation built on May 2, 2019, 2:10 p.m.

Related to arma.filter in marima...