Description Usage Arguments Author(s) Examples
Generic function of predict method for
fitTimeSeriesFactorModel. It utilizes function
predict.lm
.
1 2 3 |
object |
A fit object created by fitTimeSeiresFactorModel. |
newdata |
A vector, matrix, data.frame, xts, timeSeries or zoo object to be coerced. |
... |
Any other arguments used in |
Yi-An Chen.
1 2 3 4 5 6 7 8 9 10 11 12 | # load data from the database
data(managers.df)
ret.assets = managers.df[,(1:6)]
# fit the factor model with OLS
fit <- fitTimeSeriesFactorModel(assets.names=colnames(managers.df[,(1:6)]),
factors.names=c("EDHEC.LS.EQ","SP500.TR"),
data=managers.df,fit.method="OLS")
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.