Learn R Programming

quantmod (version 0.4.25)

fittedModel: quantmod Fitted Objects

Description

Extract and replace fitted models from quantmod objects built with buildModel. All objects fitted through methods specified in buildModel calls can be extracted for further analysis.

Usage

fittedModel(object)

# S3 method for quantmod formula(x, ...)

# S3 method for quantmod plot(x, ...)

# S3 method for quantmod coefficients(object, ...)

# S3 method for quantmod coef(object, ...)

# S3 method for quantmod residuals(object, ...)

# S3 method for quantmod resid(object, ...)

# S3 method for quantmod fitted.values(object, ...)

# S3 method for quantmod fitted(object, ...)

# S3 method for quantmod anova(object, ...)

# S3 method for quantmod logLik(object, ...)

# S3 method for quantmod vcov(object, ...)

Value

Returns an object matching that returned by a call to the method specified in buildModel.

Arguments

object

a quantmod object

x

a suitable object

...

additional arguments

Author

Jeffrey A. Ryan

Details

Most often used to extract the final fitted object of the modelling process, usually for further analysis with tools outside the quantmod package.

Most common methods to apply to fitted objects are available to the parent quantmod object. At present, one can call directly the following S3 methods on a built model as if calling directly on the fitted object. See *Usage* section.

It is also possible to add a fitted model to an object. This may be of value when applying heuristic rule sets for trading approaches, or when fine tuning already fit models by hand.

See Also

quantmod,buildModel

Examples

Run this code
if (FALSE) {
x <- specifyModel(Next(OpCl(DIA)) ~ OpCl(VIX))
x.lm <- buildModel(x,method='lm',training.per=c('2001-01-01','2001-04-01'))

fittedModel(x.lm)

coef(fittedModel(x.lm))
coef(x.lm)                  # same

vcov(fittedModel(x.lm))
vcov(x.lm)                  # same
}

Run the code above in your browser using DataLab