the \(n\)-th centered moment is calculated as

Return.centered(R, ...)

centeredmoment(R, power)

centeredcomoment(Ra, Rb, p1, p2, normalize = FALSE)

Arguments

R

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

...

any other passthru parameters

power

power or moment to calculate

Ra

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

Rb

an xts, vector, matrix, data frame, timeSeries or zoo object of index, benchmark, portfolio, or secondary asset returns to compare against

p1

first power of the comoment

p2

second power of the comoment

normalize

whether to standardize the calculation to agree with common usage, or leave the default mathematical meaning

Details

$$.$$$$ \mu^{(n)}(R) = E\lbrack(R-E(R))^n\rbrack $$

These functions are used internally by PerformanceAnalytics to calculate centered moments for a multivariate distribution as well as the standardized moments of a portfolio distribution. They are exposed here for users who wish to use them directly, and we'll get more documentation written when we can.

These functions were first utilized in Boudt, Peterson, and Croux (2008), and have been subsequently used in our other research.

References

Boudt, Kris, Brian G. Peterson, and Christophe Croux. 2008. Estimation and Decomposition of Downside Risk for Portfolios with Non-Normal Returns. Journal of Risk. Winter.

Martellini, L. and Ziemann, V., 2010. Improved estimates of higher-order comoments and implications for portfolio selection. Review of Financial Studies, 23(4):1467-1502.

Ranaldo, Angelo, and Laurent Favre Sr. 2005. How to Price Hedge Funds: From Two- to Four-Moment CAPM. SSRN eLibrary.

Scott, Robert C., and Philip A. Horvath. 1980. On the Direction of Preference for Moments of Higher Order than the Variance. Journal of Finance 35(4):915-919.

Author

Kris Boudt and Brian Peterson

Examples

data(managers)
Return.centered(managers[,1:3,drop=FALSE])
#>                     HAM1       HAM2          HAM3
#> 1996-01-31 -0.0037227273         NA  0.0224530303
#> 1996-02-29  0.0081772727         NA  0.0226530303
#> 1996-03-31  0.0043772727         NA  0.0133530303
#> 1996-04-30 -0.0202227273         NA  0.0324530303
#> 1996-05-31 -0.0035227273         NA  0.0228530303
#> 1996-06-30 -0.0150227273         NA -0.0427469697
#> 1996-07-31 -0.0342227273         NA -0.0461469697
#> 1996-08-31  0.0283772727 -0.0142432  0.0336530303
#> 1996-09-30  0.0035772727  0.0860568  0.0528530303
#> 1996-10-31  0.0176772727  0.0196568  0.0270530303
#> 1996-11-30  0.0044772727  0.0595568  0.0541530303
#> 1996-12-31  0.0064772727  0.0156568  0.0089530303
#> 1997-01-31  0.0100772727  0.0652568  0.0646530303
#> 1997-02-28 -0.0089227273 -0.0223432 -0.0498469697
#> 1997-03-31 -0.0017227273 -0.0410432 -0.0460469697
#> 1997-04-30  0.0014772727 -0.0202432  0.0161530303
#> 1997-05-31  0.0326772727  0.0397568  0.0634530303
#> 1997-06-30  0.0119772727  0.0410568 -0.0070469697
#> 1997-07-31  0.0042772727  0.1008568  0.0956530303
#> 1997-08-31  0.0125772727 -0.0338432 -0.0152469697
#> 1997-09-30  0.0107772727  0.0434568  0.0424530303
#> 1997-10-31 -0.0318227273 -0.0363432 -0.0478469697
#> 1997-11-30  0.0138772727 -0.0192432  0.0051530303
#> 1997-12-31 -0.0001227273  0.0050568 -0.0127469697
#> 1998-01-31 -0.0055227273 -0.0253432  0.0366530303
#> 1998-02-28  0.0317772727  0.0865568  0.0341530303
#> 1998-03-31  0.0250772727  0.0483568  0.0083530303
#> 1998-04-30 -0.0033227273 -0.0151432  0.0109530303
#> 1998-05-31 -0.0342227273 -0.0248432 -0.0260469697
#> 1998-06-30  0.0009772727  0.0250568  0.0270530303
#> 1998-07-31 -0.0326227273 -0.0413432 -0.0119469697
#> 1998-08-31 -0.1055227273 -0.0141432 -0.0842469697
#> 1998-09-30  0.0136772727 -0.0187432  0.0540530303
#> 1998-10-31  0.0446772727  0.0207568 -0.0175469697
#> 1998-11-30  0.0014772727  0.0557568  0.0430530303
#> 1998-12-31 -0.0014227273  0.0771568  0.0339530303
#> 1999-01-31 -0.0204227273  0.0645568  0.0144530303
#> 1999-02-28 -0.0017227273 -0.0371432 -0.0654469697
#> 1999-03-31  0.0350772727  0.0940568  0.0062530303
#> 1999-04-30  0.0398772727  0.0024568  0.0292530303
#> 1999-05-31  0.0050772727 -0.0143432 -0.0045469697
#> 1999-06-30  0.0214772727  0.0508568  0.0422530303
#> 1999-07-31 -0.0013227273  0.0137568 -0.0082469697
#> 1999-08-31 -0.0276227273  0.0143568 -0.0002469697
#> 1999-09-30 -0.0156227273  0.0190568 -0.0056469697
#> 1999-10-31 -0.0117227273  0.0280568  0.0622530303
#> 1999-11-30 -0.0076227273  0.0555568  0.0949530303
#> 1999-12-31  0.0035772727  0.1307568  0.0455530303
#> 2000-01-31 -0.0213227273  0.0236568 -0.0174469697
#> 2000-02-29  0.0011772727  0.1414568  0.1671530303
#> 2000-03-31  0.0463772727 -0.0504432 -0.0096469697
#> 2000-04-30  0.0090772727 -0.0239432 -0.0251469697
#> 2000-05-31  0.0227772727 -0.0258432 -0.0352469697
#> 2000-06-30  0.0011772727 -0.0036432  0.0282530303
#> 2000-07-31 -0.0062227273  0.0046568 -0.0649469697
#> 2000-08-31  0.0275772727  0.0205568  0.0670530303
#> 2000-09-30 -0.0098227273 -0.0438432 -0.0697469697
#> 2000-10-31 -0.0188227273 -0.0429432  0.0037530303
#> 2000-11-30 -0.0007227273 -0.0361432 -0.0492469697
#> 2000-12-31 -0.0179227273  0.0048568  0.0044530303
#> 2001-01-31 -0.0032227273 -0.0466432  0.0137530303
#> 2001-02-28 -0.0029227273 -0.0334432 -0.0479469697
#> 2001-03-31 -0.0216227273 -0.0173432 -0.0234469697
#> 2001-04-30  0.0233772727 -0.0160432  0.0007530303
#> 2001-05-31  0.0467772727 -0.0066432 -0.0177469697
#> 2001-06-30 -0.0090227273 -0.0348432 -0.0361469697
#> 2001-07-31  0.0095772727 -0.0165432 -0.0146469697
#> 2001-08-31  0.0049772727 -0.0058432 -0.0370469697
#> 2001-09-30 -0.0423227273  0.0191568 -0.0192469697
#> 2001-10-31 -0.0100227273 -0.0361432 -0.0329469697
#> 2001-11-30  0.0228772727 -0.0059432  0.0123530303
#> 2001-12-31  0.0564772727 -0.0144432 -0.0106469697
#> 2002-01-31  0.0023772727 -0.0329432 -0.0269469697
#> 2002-02-28 -0.0235227273 -0.0512432 -0.0538469697
#> 2002-03-31 -0.0048227273  0.0079568  0.0082530303
#> 2002-04-30 -0.0065227273 -0.0257432 -0.0377469697
#> 2002-05-31 -0.0126227273 -0.0436432 -0.0148469697
#> 2002-06-30 -0.0352227273 -0.0479432 -0.0575469697
#> 2002-07-31 -0.0866227273 -0.0265432 -0.0464469697
#> 2002-08-31 -0.0034227273 -0.0145432 -0.0100469697
#> 2002-09-30 -0.0686227273 -0.0158432 -0.0563469697
#> 2002-10-31  0.0185772727 -0.0098432 -0.0022469697
#> 2002-11-30  0.0549772727 -0.0224432  0.0225530303
#> 2002-12-31 -0.0434227273 -0.0163432 -0.0776469697
#> 2003-01-31 -0.0523227273 -0.0144432 -0.0139469697
#> 2003-02-28 -0.0362227273 -0.0290432 -0.0103469697
#> 2003-03-31  0.0252772727 -0.0197432 -0.0013469697
#> 2003-04-30  0.0539772727 -0.0260432  0.0400530303
#> 2003-05-31  0.0225772727  0.0373568  0.0298530303
#> 2003-06-30  0.0196772727  0.0093568 -0.0015469697
#> 2003-07-31  0.0064772727  0.0092568 -0.0038469697
#> 2003-08-31 -0.0108227273 -0.0225432  0.0177530303
#> 2003-09-30 -0.0021227273 -0.0194432 -0.0149469697
#> 2003-10-31  0.0369772727 -0.0007432  0.0480530303
#> 2003-11-30  0.0057772727 -0.0027432 -0.0006469697
#> 2003-12-31  0.0163772727  0.0147568 -0.0029469697
#> 2004-01-31 -0.0058227273  0.0049568 -0.0070469697
#> 2004-02-29 -0.0112227273 -0.0054432  0.0018530303
#> 2004-03-31 -0.0024227273 -0.0013432 -0.0162469697
#> 2004-04-30 -0.0154227273 -0.0059432 -0.0324469697
#> 2004-05-31 -0.0029227273 -0.0066432 -0.0191469697
#> 2004-06-30  0.0147772727 -0.0003432 -0.0114469697
#> 2004-07-31 -0.0111227273 -0.0099432 -0.0471469697
#> 2004-08-31 -0.0056227273 -0.0206432 -0.0180469697
#> 2004-09-30 -0.0023227273 -0.0041432 -0.0156469697
#> 2004-10-31 -0.0117227273  0.0005568 -0.0135469697
#> 2004-11-30  0.0282772727  0.0110568  0.0429530303
#> 2004-12-31  0.0328772727 -0.0058432  0.0056530303
#> 2005-01-31 -0.0110227273 -0.0195432 -0.0051469697
#> 2005-02-28  0.0103772727  0.0068568  0.0292530303
#> 2005-03-31 -0.0318227273 -0.0210432 -0.0031469697
#> 2005-04-30 -0.0320227273 -0.0180432 -0.0143469697
#> 2005-05-31 -0.0068227273 -0.0280432  0.0108530303
#> 2005-06-30  0.0049772727  0.0052568 -0.0089469697
#> 2005-07-31 -0.0020227273  0.0057568  0.0078530303
#> 2005-08-31  0.0001772727 -0.0018432 -0.0144469697
#> 2005-09-30  0.0149772727  0.0038568  0.0072530303
#> 2005-10-31 -0.0298227273 -0.0327432 -0.0235469697
#> 2005-11-30  0.0119772727 -0.0047432  0.0037530303
#> 2005-12-31  0.0149772727 -0.0056432  0.0056530303
#> 2006-01-31  0.0580772727  0.0670568  0.0226530303
#> 2006-02-28  0.0033772727 -0.0467432  0.0141530303
#> 2006-03-31  0.0285772727  0.0009568 -0.0005469697
#> 2006-04-30 -0.0122227273  0.0030568 -0.0093469697
#> 2006-05-31 -0.0378227273 -0.0193432 -0.0336469697
#> 2006-06-30  0.0104772727 -0.0257432 -0.0313469697
#> 2006-07-31 -0.0255227273 -0.0272432 -0.0022469697
#> 2006-08-31  0.0049772727 -0.0254432  0.0128530303
#> 2006-09-30 -0.0043227273 -0.0372432 -0.0052469697
#> 2006-10-31  0.0315772727  0.0025568  0.0058530303
#> 2006-11-30  0.0005772727  0.0064568  0.0144530303
#> 2006-12-31  0.0003772727 -0.0203432 -0.0014469697