Description Usage Arguments Details Author(s) Examples
Generic function of predict method for fitFundamentalFactorModel.
1 2 3 | ## S3 method for class 'FundamentalFactorModel'
predict(object,
newdata, new.assetvar, new.datevar)
|
object |
fit "FundamentalFactorModel" object |
newdata |
An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used. |
new.assetvar |
Specify new asset variable in newdata if newdata is provided. |
new.datevar |
Speficy new date variable in newdata if newdata is provided. |
newdata
must be data.frame and contain date
variable, asset variable and exact exposures names that
are used in fit object by
fitFundamentalFactorModel
Yi-An Chen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(Stock.df)
fit.fund <- fitFundamentalFactorModel(exposure.names=c("BOOK2MARKET", "LOG.MARKETCAP")
, data=stock,returnsvar = "RETURN",datevar = "DATE",
assetvar = "TICKER",
wls = TRUE, regression = "classic",
covariance = "classic", full.resid.cov = FALSE)
# If not specify anything, predict() will give fitted value
pred.fund <- predict(fit.fund)
# generate random data
testdata <- stock[,c("DATE","TICKER")]
testdata$BOOK2MARKET <- rnorm(n=42465)
testdata$LOG.MARKETCAP <- rnorm(n=42465)
pred.fund2 <- predict(fit.fund,testdata,new.assetvar="TICKER",new.datevar="DATE")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.