How to Calculate an Autocorrelation Coefficient

Formula for the Mean.

Autocorrelation is a statistical method used for time series analysis. The purpose is to measure the correlation of two values in the same data set at different time steps. Although the time data is not used to calculated autocorrelation, your time increments should be equal in order to get meaningful results. The autocorrelation coefficient serves two purposes. It can detect non-randomness in a data set. If the values in the data set are not random, then autocorrelation can help the analyst chose an appropriate time series model.

    Calculate the mean, or average, for the data you are analyzing. The mean is the sum of all the data values divided by the number of data values (n).

    Decide on a time lag (k) for your calculation. The lag value is an integer denoting how many time steps separate one value from another. For instance, the lag between (y1, t1) and (y6, t6) is five, because there are 6 - 1 = 5 time steps between the two values. When testing for randomness, you will usually only calculate one autocorrelation coefficient using lag k=1, although other lag values will also work. When you are determining an appropriate time series model, you will need to calculate a series of autocorrelation values, using a different lag value for each.

    Autocovariance Function Formula.

    Calculate the autocovariance function using the given formula. For example, is you were calculating the third iteration (i = 3) using a lag k = 7, then the calculation for that iteration would look like this: (y3 - y-bar)(y10 - y-bar) Iterate through all values of "i" and then take the sum and divide it by the number of values in the data set.

    Variance Function Formula.

    Calculate the variance function using the given formula. The calculation is similar to that of the autocovariance function, but lag is not used.

    Divide the autocovariance function by the variance function to get the autocorrelation coefficient. You can bypass this step by dividing the formulas for the two functions as shown, but many times, you will need the autocovariance and the variance for other purposes, so it is practical to calculate them individually as well.

    Things You'll Need

    • Pen/pencil
    • Paper
    • Computer/calculator (for large data sets)

Related Articles

Difference Between the Mean & the Average
What Are Parametric and Nonparametric Tests?
Ways to Tell if Something Is a Function
How to Calculate the Interquartile Range
How to Calculate Coefficient of Determination
What Statistical Analysis Do I Run When Comparing Three...
How to Calculate Pearson's R (Pearson Correlations)...
How to Calculate With the Taylor Series
How to Calculate Measurement Errors
How to Calculate the Standard Error of a Slope
How to Calculate FXY Partial Derivatives
Definition of Mean, Median & Mode
How to Calculate a T-Statistic
How to Calculate F-Values
How to Calculate the Midpoint Between Two Numbers
How to Find the Midpoint of the Interval
How to Find Linear Functions
How to Calculate Factorials
How do I Calculate the Geometric Mean on an HP 12C?