Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

table.Autocorrelation

table for calculating the first six autocorrelation coefficients and significance


Description

Produces data table of autocorrelation coefficients rho and corresponding Q(6)-statistic for each column in R.

Usage

table.Autocorrelation(R, digits = 4)

Arguments

R

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

digits

number of digits to round results to for display

Note

To test returns for autocorrelation, Lo (2001) suggests the use of the Ljung-Box test, a significance test for the auto-correlation coefficients. Ljung and Box (1978) provide a refinement of the Q-statistic proposed by Box and Pierce (1970) that offers a better fit for the chi^2 test for small sample sizes. Box.test provides both.

Author(s)

Peter Carl

References

Lo, Andrew W. 2001. Risk Management for Hedge Funds: Introduction and Overview. SSRN eLibrary.

See Also

Examples

data(managers)
t(table.Autocorrelation(managers))

result = t(table.Autocorrelation(managers[,1:8]))

textplot(result, rmar = 0.8, cmar = 2,  max.cex=.9, halign = "center", 
         valign = "top", row.valign="center", wrap.rownames=15, 
         wrap.colnames=10, mar = c(0,0,3,0)+0.1)
         
title(main="Autocorrelation")

PerformanceAnalytics

Econometric Tools for Performance and Risk Analysis

v2.0.4
GPL-2 | GPL-3
Authors
Brian G. Peterson [cre, aut, cph], Peter Carl [aut, cph], Kris Boudt [ctb, cph], Ross Bennett [ctb], Joshua Ulrich [ctb], Eric Zivot [ctb], Dries Cornilly [ctb], Eric Hung [ctb], Matthieu Lestel [ctb], Kyle Balkissoon [ctb], Diethelm Wuertz [ctb], Anthony Alexander Christidis [ctb], R. Douglas Martin [ctb], Zeheng 'Zenith' Zhou [ctb], Justin M. Shea [ctb]
Initial release
2020-02-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.