MultiFilter-class | R Documentation |
Objects and methods for filters with more than one set of coefficients.
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.
mc
:the multi-companion form of the filter, an object
of class "MultiCompanion"
coef
:the coefficients of the filter, an object of
class "matrix"
, whose s
th row contains the
coefficients for t=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).
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!
signature(.Object = "MultiFilter")
:
This function is called implicitly by new
, see the
signature for new
above.
One of mc
and coef
must be supplied, the other
arguments are optional.
If mc
is missing it is computed from coef
.
In this case, component mC.factorsmat
of slot misc
of mc
is set to the companion factorisation of mc
(essentially the reversed rows of coef
).
If coef
is missing it is computed from mc
, see
mc_factors
.
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
.
Georgi N. Boshnakov
boshnakov2002mcmcompanion
\insertRefboshnakov2009genmcompanion
MultiCompanion
,
mf_period
, mf_order
,
mf_poles
,
mf_VSform
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.