predict.tsfm: Predicts asset returns based on a fitted time series factor...

Description Usage Arguments Value Author(s) See Also Examples

Description

S3 predict method for object of class tsfm. It calls the predict method for fitted objects of class lm, lmRob or lars as appropriate.

Usage

1
2
## S3 method for class 'tsfm'
predict(object, newdata = NULL, ...)

Arguments

object

an object of class tsfm produced by fitTsfm.

newdata

a vector, matrix, data.frame, xts, timeSeries or zoo object containing the variables with which to predict.

...

optional arguments passed to predict.lm or predict.lmRob, such as se.fit, or, to predict.lars such as mode.

Value

predict.tsfm produces a matrix of return predictions, if all assets have equal history. If not, a list of predicted return vectors of unequal length is produced.

Author(s)

Yi-An Chen and Sangeetha Srinivasan

See Also

fitTsfm, summary.tsfm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# load data from the database
data(managers)
# fit the factor model with LS
fit <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
               factor.names=c("EDHEC.LS.EQ","SP500.TR"), data=managers)

pred.fit <- predict(fit)
newdata <- data.frame("EDHEC.LS.EQ"=rnorm(n=120), "SP500.TR"=rnorm(n=120))
rownames(newdata) <- rownames(fit$data)
pred.fit2 <- predict(fit, newdata, interval="confidence")

factorAnalytics documentation built on April 15, 2017, 11:18 a.m.