R/SFM.coefficients.R
SFM.coefficients.RdThe single factor model is the beta of an asset to the variance and covariance of an initial portfolio. Used to determine diversification potential. "Alpha" purports to be a measure of a manager's skill by measuring the portion of the managers returns that are not attributable to "Beta", or the portion of performance attributable to a benchmark.
SFM.coefficients(
Ra,
Rb,
Rf = 0,
subset = TRUE,
...,
method = "Robust",
family = "mopt",
digits = 3,
benchmarkCols = T,
Model = F,
warning = T
)an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
return vector of the benchmark asset
risk free rate, in same period as your returns
a logical vector representing the set of observations to be used in regression
Other parameters like max.it or bb specific to lmrobdetMM regression. Another interesting parameter is round.by.alphas, and round.by.betas which can be set to round off the returned values, otherwise the values
(Optional): string representing linear regression model, "LS" for Least Squares and "Robust" for robust. Defaults to "LS
(Optional): If method == "Robust": This is a string specifying the name of the family of loss function to be used (current valid options are "bisquare", "opt" and "mopt"). Incomplete entries will be matched to the current valid options. Defaults to "mopt". Else: the parameter is ignored
(Optional): Number of digits to round the results to. Defaults to 3.
(Optional): Boolean to show the benchmarks as columns. Defaults to TRUE.
(Optional): Boolean to return the fitted model. Defaults to FALSE
(Optional): Boolean to show warnings or not. Defaults to TRUE.
This function is designed to be used a a wrapper for SFM's regression models. Using this, one can easily fit different types of linear models like Ordinary Least Squares or Robust Estimators like Huber.
$$\beta_{a,b}=\frac{CoV_{a,b}}{\sigma_{b}}=\frac{\sum((R_{a}-\bar{R_{a}})(R_{b}-\bar{R_{b}}))}{\sum(R_{b}-\bar{R_{b}})^{2}}$$
Ruppert(2004) reports that this equation will give the estimated slope of the linear regression of \(R_{a}\) on \(R_{b}\) and that this slope can be used to determine the risk premium or excess expected return (see Eq. 7.9 and 7.10, p. 230-231).
Sharpe, W.F. Capital Asset Prices: A theory of market
equilibrium under conditions of risk. Journal of finance, vol 19,
1964, 425-442.
Ruppert, David. Statistics and Finance, an
Introduction. Springer. 2004.
Bacon, Carl. Practical portfolio
performance measurement and attribution. Wiley. 2004.
if(requireNamespace("RobStatTM", quietly = TRUE)) { # CRAN requires conditional execution
data(managers)
SFM.coefficients(managers[,1], managers[,8])
SFM.coefficients(managers[,1:6], managers[,8:9], Rf = managers[,10])
SFM.coefficients(managers[,1:6], managers[,8:9],
Rf=.035/12, method="Robust",
family="mopt", bb=0.25,
max.it=200)
} # CRAN requires conditional execution
#> Alpha : SP500 TR Alpha : US 10Y TR Beta : SP500 TR Beta : US 10Y TR
#> HAM1 0.006 0.010 0.357 -0.238
#> HAM2 0.005 0.005 0.290 -0.126
#> HAM3 0.005 0.007 0.599 -0.203
#> HAM4 0.003 0.010 0.709 -0.247
#> HAM5 0.004 0.002 0.296 0.056
#> HAM6 0.007 0.009 0.333 -0.339