plot.FundamentalFactorModel: plot FundamentalFactorModel object.

Description Usage Arguments Author(s) Examples

Description

Generic function of plot method for fitFundamentalFactorModel.

Usage

1
2
3
4
5
6
  ## S3 method for class 'FundamentalFactorModel'
 plot(x,
    which.plot = c("none", "1L", "2L", "3L", "4L", "5L", "6L"),
    max.show = 4, plot.single = FALSE, asset.name,
    which.plot.single = c("none", "1L", "2L", "3L", "4L", "5L", "6L", "7L", "8L", "9L"),
    legend.txt = TRUE, VaR.method = "historical", ...)

Arguments

x

fit object created by fitFundamentalFactorModel.

which.plot

integer indicating which plot to create: "none" will create a menu to choose. Defualt is none.
1 = "Factor returns",
2 = "Residual plots",
3 = "Variance of Residuals",
4 = "Factor Model Correlation",
5 = "Factor Contributions to SD",
6 = "Factor Contributions to ES",
7 = "Factor Contributions to VaR"

max.show

Maximum assets to plot. Default is 4.

plot.single

Plot a single asset of lm class. Defualt is FALSE.

asset.name

Name of the asset to be plotted.

which.plot.single

integer indicating which plot to create: "none" will create a menu to choose. Defualt is none.
1 = time series plot of actual and fitted values,
2 = time series plot of residuals with standard error bands,
3 = time series plot of squared residuals,
4 = time series plot of absolute residuals,
5 = SACF and PACF of residuals,
6 = SACF and PACF of squared residuals,
7 = SACF and PACF of absolute residuals,
8 = histogram of residuals with normal curve overlayed,
9 = normal qq-plot of residuals.

legend.txt

Logical. TRUE will plot legend on barplot. Defualt is TRUE.

VaR.method

character, method for computing VaR. Valid choices are one of "modified","gaussian","historical", "kernel". Computation is done with the VaR in the PerformanceAnalytics package. Default is "historical".

...

other variables for barplot method.

Author(s)

Eric Zivot and Yi-An Chen.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# BARRA type factor model
data(Stock.df)
# there are 447 assets
exposure.names <- c("BOOK2MARKET", "LOG.MARKETCAP")
fit.fund <- fitFundamentalFactorModel(data=data,exposure.names=exposure.names,
                                       datevar = "DATE", returnsvar = "RETURN",
                                       assetvar = "TICKER", wls = TRUE,
                                       regression = "classic",
                                       covariance = "classic", full.resid.cov = TRUE,
                                       robust.scale = TRUE)

plot(fit.fund)

## End(Not run)

R-Finance/FactorAnalytics documentation built on May 8, 2019, 3:51 a.m.