plot.TimeSeriesFactorModel: plot TimeSeriesFactorModel object.

Description Usage Arguments Author(s) Examples

Description

Generic function of plot method for fitTimeSeriesFactorModel. Either plot all assets or choose a single asset to plot.

Usage

1
2
3
4
5
6
7
  ## S3 method for class 'TimeSeriesFactorModel'
 plot(x,
    colorset = c(1:12), legend.loc = NULL,
    which.plot = c("none", "1L", "2L", "3L", "4L", "5L", "6L", "7L"),
    max.show = 6, plot.single = FALSE, asset.name,
    which.plot.single = c("none", "1L", "2L", "3L", "4L", "5L", "6L", "7L", "8L", "9L", "10L", "11L", "12L", "13L"),
    VaR.method = "historical")

Arguments

x

fit object created by fitTimeSeriesFactorModel.

colorset

Defualt colorset the same as barplot.

legend.loc

Plot legend or not. Defualt is NULL.

which.plot

Integer indicates which plot to create: "none" will create a menu to choose. Defualt is none.
1 = "Fitted factor returns",
2 = "R square",
3 = "Variance of Residuals",
4 = "FM Correlation",
5 = "Factor Contributions to SD",
6 = "Factor Contributions to ES",
7 = "Factor Contributions to VaR"

max.show

Maximum assets to plot. Default is 6.

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 indicates 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,
10= CUSUM plot of recursive residuals,
11= CUSUM plot of OLS residuals,
12= CUSUM plot of recursive estimates relative to full sample estimates,
13= rolling estimates over 24 month window.

VaR.method

Character, method for computing VaR. Valid choices are either "modified","gaussian","historical", "kernel". computation is done with the VaR in the PerformanceAnalytics package. Default is "historical".

Author(s)

Eric Zivot and Yi-An Chen.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# load data from the database
data(managers.df)
fit.macro <- fitTimeseriesFactorModel(assets.names=colnames(managers.df[,(1:6)]),
                                factors.names=c("EDHEC.LS.EQ","SP500.TR"),
                                data=managers.df,fit.method="OLS")
# plot of all assets and show only first 4 assets.
plot(fit.macro,max.show=4)
# single plot of HAM1 asset
plot(fit.macro, plot.single=TRUE, asset.name="HAM1")

## End(Not run)

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