Description Usage Arguments Value Author(s) Examples
Calcluate and plot the Factor Model R-squared, Adjusted R-squared and Variance Inflation Factors for a portfolio of assets
1 2 |
ffmObj |
an object of class |
rsq |
logical; if |
rsqAdj |
logical; if |
VIF |
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. |
title |
logical. if |
... |
potentially further arguments passed. |
ffmRsq 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
Doug Martin, Avinash Acharya
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
ffmRsq(fit)
fit1 <- fitFfm(data=factorDataSetDjia5Yrs, asset.var="TICKER", ret.var="RETURN",
date.var="DATE", exposure.vars=c("SECTOR", "P2B", "EV2S", "MKTCAP"))
#Plot and print the time series of Adj R-squared and VIF values
ffmRsq(fit1, VIF=TRUE, 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.