Description Usage Arguments Value Author(s) Examples
Calcluate and plot the Factor Model R-Squared, Adjusted R-Squared for a portfolio of assets
1 2 3 4 5 6 |
ffmObj |
an object of class |
... |
potentially further arguments passed. |
rsq |
logical; if |
rsqAdj |
logical; if |
plt.type |
a number to indicate the type of plot for plotting Factor Model R-squared/Adj. R-squared values. 1 indicates barplot, 2 indicates time series xy plot. Default is 2. |
digits |
an integer indicating the number of decimal places to be used for rounding. Default is 2. |
isPrint |
logical. if |
isPlot |
logical. if |
lwd |
line width relative to the default. Default is 2. |
stripText.cex |
a number indicating the amount by which strip text in the plot(s) should be scaled relative to the default. 1=default, 1.5 is 50% larger, 0.5 is 50% smaller, etc. |
axis.cex |
a number indicating the amount by which axis in the plot(s) should be scaled relative to the default. 1=default, 1.5 is 50% larger, 0.5 is 50% smaller, etc. |
title |
logical. if |
fmRsq returns the sample mean values and plots the time series of corresponding R squared values
and the Variance Inflation factors depending on the values of rsq, rsqAdj and VIF.
The time series of the output values are also printed if isPrint is TRUE
Avinash Acharya and Doug Martin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #Load the data
data("factorDataSetDjia5Yrs")
#Fit a Ffm
require(factorAnalytics)
fit <- fitFfm(data=factorDataSetDjia5Yrs, asset.var="TICKER", ret.var="RETURN",
date.var="DATE", exposure.vars="SECTOR")
#Calcuate and plot the portfolio R-squared values
fmRsq(fit)
fit1 <- fitFfm(data=factorDataSetDjia5Yrs, asset.var="TICKER", ret.var="RETURN",
date.var="DATE", exposure.vars=c("SECTOR", "P2B", "EV2S", "MKTCAP"), addIntercept=TRUE)
#Plot and print the time series of Adj R-squared and VIF values
fmRsq(fit1, rsqAdj=TRUE, isPrint=TRUE, plt.type = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.