Description Usage Arguments Details Value Author(s) References Examples
fit fundamental factor model or cross-sectional factor model by classic OLS or Robust regression. Fundamental factor models use observable asset specific characteristics (fundamentals) like industry classification, market capitalization, style classification (value, growth) etc. to calculate the common risk factors. The function creates the class "FundamentalFactorModel".
1 2 3 4 5 |
data |
data.frame, data must have assetvar, returnvar, datevar , and exposure.names. Generally, data has to look like panel data. It needs firm variabales and time variables. Data has to be a balanced panel. |
exposure.names |
a character vector of exposure names for the factor model |
wls |
logical flag, TRUE for weighted least squares, FALSE for ordinary least squares |
regression |
A character string, "robust" for regression via lmRob, "classic" for regression with lm() |
covariance |
A character string, "robust" for covariance matrix computed with covRob(), "classic" for covariance matrix with covClassic() in robust package. |
full.resid.cov |
logical flag, TRUE for full residual covariance matrix calculation, FALSE for diagonal residual covarinace matrix |
robust.scale |
logical flag, TRUE for exposure scaling via robust scale and location, FALSE for scaling via mean and sd |
returnsvar |
A character string giving the name of the return variable in the data. |
datevar |
A character string gives the name of the date variable in the data. |
assetvar |
A character string gives the name of the asset variable in the data. |
standardized.factor.exposure |
logical flag. Factor
exposure will be standardized to regression weighted mean
0 and standardized deviation to 1 if |
weight.var |
A character strping gives the name of the weight used for standarizing factor exposures. |
If style factor exposure is standardized to regression-weighted mean zero, this makes style factors orthogonal to the world factor (intercept term), which in turn facilitted interpretation of the style factor returns. See Menchero 2010.
The original function was designed by Doug Martin and originally implemented in S-PLUS by a number of UW Ph.D. students: Christopher Green, Eric Aldrich, and Yindeng Jiang. Guy Yullen re-implemented the function in R. Yi-An Chen from University of Washington re-writes the codes and finalizes the function.
an S3 object containing
returns.cov A "list" object contains covariance information for asset returns, includes covariance, mean and eigenvalus. Beta of taken as latest date input.
factor.cov An object of class "cov" or "covRob" which contains the covariance matrix of the factor returns (including intercept).
resids.cov An object of class "cov" or "covRob" which contains the covariance matrix of the residuals, if "full.resid.cov" is TRUE. NULL if "full.resid.cov" is FALSE.
returns.corr Correlation matrix of assets returns.
factor.corr An object of class "cov" or "covRob" which contains the correlation matrix of the factor returns (including intercept).
resids.corr Correlation matrix of returns returns.
resid.variance A vector of variances estimated from the OLS residuals for each asset. If "wls" is TRUE, these are the weights used in the weighted least squares regressions. If "cov = robust" these values are computed with "scale.tau". Otherwise they are computed with "var".
factor.returns A "xts" object containing the times series of estimated factor returns and intercepts.
residuals A "xts" object containing the time series of residuals for each asset.
tstats A "xts" object containing the time series of t-statistics for each exposure.
call function call
exposure.names A character string giving the name of the exposure variable in the data.
Guy Yullen and Yi-An Chen
"The Characteristics of Factor Portfolios", Fall 2010, MENCHERO Jose, Journal of Performance Measurement.
Grinold,R and Kahn R, Active Portfolio Management.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # BARRA type factor model
data(Stock.df)
# there are 447 assets
exposure.names <- c("BOOK2MARKET", "LOG.MARKETCAP")
test.fit <- fitFundamentalFactorModel(data=stock,exposure.names=exposure.names,
datevar = "DATE", returnsvar = "RETURN",
assetvar = "TICKER", wls = TRUE,
regression = "classic",
covariance = "classic", full.resid.cov = TRUE,
robust.scale = TRUE)
names(test.fit)
test.fit$returns.cov
test.fit$resids.cov
names(test.fit$cov.factor)
test.fit$factor.cov$cov
test.fit$factor
test.fit$resid.variance
test.fit$resids
test.fit$tstats
test.fit$call
# BARRA type Industry Factor Model
exposure.names <- c("GICS.SECTOR")
# the rest keep the same
test.fit2 <- fitFundamentalFactorModel(data=stock,exposure.names=exposure.names,
datevar = "DATE", returnsvar = "RETURN",
assetvar = "TICKER", wls = TRUE,
regression = "classic",
covariance = "classic", full.resid.cov = TRUE,
robust.scale = TRUE)
names(test.fit2)
test.fit2$cov.returns
test.fit2$cov.resids
names(test.fit2$cov.factor)
test.fit2$cov.factor$cov
test.fit2$factor
test.fit2$resid.variance
test.fit2$resids
test.fit2$tstats
test.fit2$call
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.