modelCoef: Get the coefficients of models

Description Usage Arguments Details Value Author(s) See Also

Description

Get the coefficients of an object, optionally specifying the expected format.

Usage

1
modelCoef(object, convention, component, ...)

Arguments

object

an object.

convention

the convention to use for the return value, a character string or any object from a supported class, see Details.

component

if not missing, specifies a component to extract, see Details.

...

not used, further arguments for methods.

Details

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 various forms.

The one-argument form, modelCoef(object), gives the coefficients of object. In effect, it defines the meaning of ‘coefficients’ for the purposes of modelCoef.

Argument convention can be used to specify what kind of value to return.

If 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 modelCoef(obj) with obj from class "convention".

If convention is a character string, it is typically the name of a class. In this case modelCoef(object, "someclass") is equivalent to modelCoef(object, new("someclass")). 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 call to modelCoef{}.

modelCoef() will signal an error if object is not compatible with target (e.g. if it contains unit roots). (see filterCoef if you need to expand any multiplicative filters).

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 also available.

The methods for modelCoef() in package "sarima" return a list with components depending on argument "convention", as outlined above.

Value

a list, with components depending on the target class, as described in Details

Author(s)

Georgi N. Boshnakov

See Also

codemodelOrder


sarima documentation built on Aug. 23, 2018, 9:03 a.m.