MultiFilter-class {mcompanion} | R Documentation |
Class "MultiFilter"
Description
Objects and methods for filters with more than one set of coefficients.
Objects from the Class
Objects can be created by calls of the form
new("MultiFilter", coef, mc, order, sign)
.
Objects from this class represent periodic filters. A
d
-periodic filter relates an input series
\varepsilon_{t}
to an output series
y_t
by the following formula:
y_t
= \sum_{i=1}^{p_t} \phi _t(i)y _{t-i}
% + \sum_{i=1}^{q_t} \theta_t(i)\varepsilon_{t-i}
+ \varepsilon_t
,
where the coefficients \phi_t(i)
are d
-periodic in
t
, i.e. \phi_{t+d}(i)=\phi_t(i)
and
p_{t+d} = p_{t}
.
The periodicity means that it is sufficient to store the coefficients
in a d \times p
matrix, where
p=\max(p_1,\dots,p_t)
.
Slot coef
contains such a matrix.
The filter may be specified either by its coefficients or by its multi-companion form.
Slots
mc
:the multi-companion form of the filter, an object of class
"MultiCompanion"
coef
:the coefficients of the filter, an object of class
"matrix"
, whoses
th row contains the coefficients fort=k \times d +s
.order
:the periodic order of the filter, a numeric vector giving the orders of the individual seasons.
sign
:1 or -1. The default value, 1, corresponds to the formula given in section "Objects from the Class". It can also be -1, if the sum on the right-hand side of that formula is preceded by a minus (usual convention in signal processing).
Methods
- [
signature(x = "MultiFilter", i = "ANY", j = "ANY", drop = "ANY")
: take subset of the coefficients of the filter in various forms.To do: the function needs more work! Document the function and the additional arguments!
- initialize
signature(.Object = "MultiFilter")
: This function is called implicitly bynew
, see the signature fornew
above. One ofmc
andcoef
must be supplied, the other arguments are optional.If
mc
is missing it is computed fromcoef
. In this case, componentmC.factorsmat
of slotmisc
ofmc
is set to the companion factorisation ofmc
(essentially the reversed rows ofcoef
).If
coef
is missing it is computed frommc
, seemc_factors
.- mcStable
signature(x = "MultiFilter")
: Check if the filter is stable.
See also the documentation for the following functions which are effectively methods for class "MuliFilter" but are not defined as formal methods:
mf_period
, mf_order
, mf_poles
,
mf_VSform
.
Author(s)
Georgi N. Boshnakov
References
Boshnakov GN (2002). “Multi-companion matrices.” Linear Algebra Appl., 354, 53–83. ISSN 0024-3795, doi:10.1016/S0024-3795(01)00475-X.
Boshnakov GN, Iqelan BM (2009). “Generation of time series models with given spectral properties.” J. Time Series Anal., 30(3), 349–368. ISSN 0143-9782, doi:10.1111/j.1467-9892.2009.00617.x.
See Also
MultiCompanion
,
mf_period
, mf_order
,
mf_poles
,
mf_VSform
.
Examples
showClass("MultiFilter")
m <- mCompanion("sim",dim=3,mo=2) # simulate a 3x3 2-comp. matrix
flt <- new("MultiFilter", mc = m )
flt[]
mf_period(flt)
mf_poles(flt)
abs(mf_poles(flt))
mf_VSform(flt,form="U")
mf_VSform(flt,form="L")
mf_VSform(flt,form="I")
# try arguments "coef" and "mc", for comparison
rfi <- sim_pcfilter(2,3) # period=2, order=c(3,3)
# per. filter from a multi-companion matrix
flt1 <- new("MultiFilter",mc= mCompanion(zapsmall(rfi$mat)) )
flt1[]
mf_period(flt1)
mf_poles(flt1)
abs(mf_poles(flt1))
mf_VSform(flt1,form="U")
mf_VSform(flt1,form="L")
mf_VSform(flt1,form="I")
# per. filter from coefficients, should be the same (numerically)
flt2 <- new("MultiFilter",coef=rfi$pcfilter)
flt2[]
mf_period(flt2)
mf_poles(flt2)
abs(mf_poles(flt2))
mf_VSform(flt2,form="U")
mf_VSform(flt2,form="L")
mf_VSform(flt2,form="I")