filterCoef {sarima} | R Documentation |
Coefficients and other basic properties of filters
Description
Coefficients and other basic properties of filters.
Usage
filterCoef(object, convention, ...)
filterOrder(object, ...)
filterPoly(object, ...)
filterPolyCoef(object, lag_0 = TRUE, ...)
Arguments
object |
object. |
convention |
convention for the sign. |
lag_0 |
if FALSE, drop the coefficient of order zero. |
... |
further arguments for methods. |
Details
Generic functions to extract basic properties of filters:
filterCoef
returns coefficients,
filterOrder
returns the order,
filterPoly
, returns the characteristic polynomial,
filterPolyCoef
gives the coefficients of the characteristic
polynomial.
For further details on argument convention
see
filterCoef-methods
.
What exactly is returned depends on the specific filter classes, see the description of the corresponding methods. For the core filters, the values are as can be expected. For "ArmaFilter", the value is a list with components "ar" and "ma" giving the requested property for the corresponding part of the filter. Similarly, for "SarimaFilter" the values are lists, maybe with additional quantities.
Value
the requested property as described in Details.
Note
The filterXXX()
functions are somewhat low level and
technical. They should be rarely needed in routine work.
The corresponding modelXXX
are more flexible.
Author(s)
Georgi N. Boshnakov
See Also
modelOrder
,
modelCoef
,
modelPoly
,
modelPolyCoef
,
for the recommended higher level alternatives for models.
filterOrder-methods
,
filterCoef-methods
,
filterPoly-methods
,
filterPolyCoef-methods
,
for more information on the methods and the arguments.
Examples
filterPoly(as(c(0.3, 0.5), "BJFilter")) # 1 - 0.3*x - 0.5*x^2
filterPoly(as(c(0.3, 0.5), "SPFilter")) # 1 + 0.3*x + 0.5*x^2
## now two representations of the same filter:
fi1 <- as(c(0.3, 0.5), "BJFilter")
fi2 <- as(c(-0.3, -0.5), "SPFilter")
identical(fi2, fi1) # FALSE, but
## fi1 and fi2 represent the same filter, eg. same ch. polynomials:
filterPoly(fi1)
filterPoly(fi2)
identical(filterPolyCoef(fi2), filterPolyCoef(fi1))
# same as above, using new()
fi1a <- new("BJFilter", coef = c(0.3, 0.5))
identical(fi1a, fi1) # TRUE
fi2a <- new("SPFilter", coef = c(-0.3, -0.5))
identical(fi2a, fi2) # TRUE
## conversion by as() changes the internal representation
## but represents the same filter:
identical(as(fi1, "SPFilter"), fi2) # TRUE
c(filterOrder(fi1), filterOrder(fi2))
## these give the internally stored coefficients:
filterCoef(fi1)
filterCoef(fi2)
## with argument 'convention' the result doesn't depend
## on the internal representation:
co1 <- filterCoef(fi1, convention = "SP")
co2 <- filterCoef(fi2, convention = "SP")
identical(co1, co2) # TRUE