predict.ffm: Predicts asset returns based on a fitted fundamental factor...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

S3 predict method for object of class ffm.

Usage

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

Arguments

object

an object of class ffm produced by fitFfm.

newdata

data.frame containing the variables asset.var, date.var and the same exact exposure.vars used in the fitted ffm object. If omitted, the predictions are based on the data used for the fit.

pred.date

character; unique date used to base the predictions. Should be coercible to class Date and match one of the dates in the data used in the fiited object.

...

optional arguments passed to predict.lm or predict.lmRob.

Details

The estimated factor returns and potentially new factor exposures are used to predict the asset returns during all dates from the fitted ffm object. For predictions based on estimated factor returns from a specific period use the pred.date argument.

Value

predict.ffm produces a N x T matrix of predicted asset returns, where T is the number of time periods and N is the number of assets. T=1 if pred.date is specified.

Author(s)

Sangeetha Srinivasan

See Also

fitFfm, summary.ffm, predict.lm, predict.lmRob

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Load fundamental and return data
data(Stock.df)

# fit a fundamental factor model
exposure.vars <- c("BOOK2MARKET", "LOG.MARKETCAP")
fit <- fitFfm(data=stock, asset.var="TICKER", ret.var="RETURN", 
              date.var="DATE", exposure.vars=exposure.vars)

# generate random data
newdata <- as.data.frame(unique(stock$TICKER))
newdata$BOOK2MARKET <- rnorm(nrow(newdata))
newdata$LOG.MARKETCAP <- rnorm(nrow(newdata))
pred.fund <- predict(fit, newdata)

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