Get the coefficients of an object, optionally specifying the expected format.
the convention to use for the return value, a character string or any object from a supported class, see Details.
if not missing, specifies a component to extract, see Details.
not used, further arguments for methods.
modelCoef is a generic function for extraction of coefficients
of model objects. What ‘coeffcients’ means depends on the class of
object but it can be changed with the optional argument
convention. In effect,
modelCoef provides a very
flexible and descriptive way of extracting coefficients from models in
The one-argument form,
modelCoef(object), gives the
object. In effect, it defines the meaning of
‘coefficients’ for the purposes of
convention can be used to specify what kind of value
convention is not a character string, only its class is
used. Conceptually, the value will have the format and meaning of the
value that would be returned by a call to
obj from class "convention".
convention is a character string, it is typically the name
of a class. In this case
modelCoef(object, "someclass") is
Note that this is conceptual - argument
convention can be the name of a virtual class, for example.
Also, for some classes of
object character values other than
names of classes may be supported.
For example, if
obj is from class "ArmaModel",
modelCoef(obj) returns a list with components "ar" and "ma",
which follow the "BD" convention. So, to get such a list of
coefficients from an
object from any class capable of
representing ARMA models, set
convention = "ArmaModel" in the
modelCoef() will signal an error if
object is not
target (e.g. if it contains unit roots).
filterCoef if you need to expand any multiplicative
If there is no class which returns exactly what is needed some
additional computation may be necessary. In the above
"ArmaModel" example we might need the coefficients in the "BJ"
convention, so we would need to change the signs of the MA
coefficients to achieve this. Since this is a very common operation,
a convenience feature is available. Setting
convention = "BJ"
requests ARMA coefficients with "BJ" convention. For completeness, the
the settings "SP" (signal processing) and "BD" (Brockwell-Davis) are
The methods for
modelCoef() in package "sarima" return a list
with components depending on argument "convention", as outlined
a list, with components depending on the target class, as described in Details
Georgi N. Boshnakov
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.