Description Usage Arguments Value Author(s) See Also Examples
S3 predict method for object of class tsfm. It
calls the predict method for fitted objects of class lm,
lmRob or lars as appropriate.
1 2 |
object |
an object of class |
newdata |
a vector, matrix, data.frame, xts, timeSeries or zoo object containing the variables with which to predict. |
... |
optional arguments passed to |
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.
Yi-An Chen and Sangeetha Srinivasan
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.