plot.FM.attribution: plot FM.attribution class

Description Usage Arguments Author(s) Examples

Description

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

Usage

1
2
3
4
5
  ## S3 method for class 'FM.attribution'
 plot(fm.attr,
    which.plot = c("none", "1L", "2L", "3L"), max.show = 6,
    date = NULL, plot.single = FALSE, fundName,
    which.plot.single = c("none", "1L", "2L", "3L"), ...)

Arguments

fm.attr

FM.attribution object created by factorModelPerformanceAttribution.

which.plot

Integer indicates which plot to create: "none" will create a menu to choose. Defualt is none.
1 = attributed cumulative returns,
2 = attributed returns on date selected by user,
3 = time series of attributed returns

max.show

Maximum assets to plot. Default is 6.

date

Indicates for attributed returns, the date format should be xts compatible.

plot.single

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

fundName

Name of the portfolio to be plotted.

which.plot.single

Integer indicates which plot to create: "none" will create a menu to choose. Defualt is none.
1 = attributed cumulative returns,
2 = attributed returns on date selected by user,
3 = time series of attributed returns

...

more arguements for chart.TimeSeries used for plotting time series

Author(s)

Yi-An Chen.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
data(managers.df)
fit.ts <- fitTimeSeriesFactorModel(assets.names=colnames(managers.df[,(1:6)]),
                                  factors.names=c("EDHEC.LS.EQ","SP500.TR"),
                                  data=managers.df,fit.method="OLS")
 fm.attr <- factorModelPerformanceAttribution(fit.ts)
# plot all
plot(fm.attr,legend.loc="topleft",max.show=6)
dev.off()
# plot only one assets "HAM1
plot(fm.attr,plot.single=TRUE,fundName="HAM1")

## End(Not run)

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