vif: Factor Model Variance Inflation Factor Values

Description Usage Arguments Value Author(s) Examples

View source: R/VIF.R

Description

Calculate and plot the Factor Model Variance Inflaction Factor Values for a fitted model. A VIF for a single explanatory variable (style factor) is obtained using the time series of R-squared values obtained from the regression of that variable against all other explanatory variables. So, at least 2 explanatory variables are required in exposure.vars of fitted model to find the VIF.

Usage

1
2
vif(ffmObj, digits = 2, isPrint = TRUE, isPlot = TRUE, lwd = 2,
  stripText.cex = 1, axis.cex = 1, title = TRUE, ...)

Arguments

ffmObj

an object of class ffm produced by fitFfm

digits

an integer indicating the number of decimal places to be used for rounding. Default is 2.

isPrint

logical. if TRUE, the time series of the computed factor model values is printed along with their mean values. Else, only the mean values are printed. Default is TRUE.

isPlot

logical. if TRUE, the time series of the output is plotted. Default is TRUE.

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. This argument is mainly used for the documentation purpose when you need a plot without any title. If TRUE, the plots will have the main tiltle. default is TRUE.

...

potentially further arguments passed.

Value

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.

Author(s)

Avinash Acharya

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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=c("SECTOR", "P2B", "EV2S", "MKTCAP"))

# Plot and print the time series of VIF values
vif(fit,isPrint=TRUE)

sangeeuw/factorAnalytics documentation built on May 28, 2019, 3:40 p.m.