Assumes an input of period returns. Scale arguements can be used to specify the number of observations during a year (e.g., 12 = monthly returns).
statsTable(R, metrics = c("mean", "sd"), metricsNames = c("Average Return", "Standard Deviation"), ...)
metrics = c(DownsideDeviation(x,MAR=mean(x)), sd(subset(x,x>0)), sd(subset(x,x<0)), downsidedeviation(x,mar="MAR),">
metricsNames = c("Semi Deviation", "Gain Deviation", "Loss Deviation", paste("Downside Deviation (MAR=",MAR*scale*100,"%)", sep=""), paste("Downside Deviation (rf=",rf*scale*100,"%)", sep=""), paste("Downside Deviation (0%)", sep=""), "Maximum Drawdown" )
Here's how it's working right now: > statsTable(monthlyReturns.ts,metrics=c("VaR.CornishFisher","mean"), metricsNames=c("modVaR","mean"),p=.95) Actual S&P500TR modVaR 0.04186461 0.06261451 mean 0.00945000 0.01013684
Passing in attributes doesn't quite work corrently. The issue is apparent in: > statsTable(monthlyReturns.ts,metrics=c("VaR.CornishFisher", "VaR.CornishFisher"), metricsNames=c("Modified VaR","Traditional VaR"), modified=c(TRUE,FALSE)) Actual S&P500TR Modified VaR 0.06340849 0.09334976 Traditional VaR 0.06340849 0.09334976 Warning messages: 1: the condition has length > 1 and only the first element will be used in: if (modified) 2: the condition has length > 1 and only the first element will be used in: if (modified) 3: the condition has length > 1 and only the first element will be used in: if (modified) 4: the condition has length > 1 and only the first element will be used in: if (modified)
0)),>