SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.timeseries.portmanteau
Class BoxPierce

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.test.HypothesisTest
      extended by com.numericalmethod.suanshu.stats.test.timeseries.portmanteau.BoxPierce
Direct Known Subclasses:
LjungBox

public class BoxPierce
extends HypothesisTest

The Box–Pierce test (named for George E. P. Box and David A. Pierce) is a portmanteau test for autocorrelated errors. A portmanteau test tests whether any of a group of autocorrelations of a time series are different from zero.

The Box–Pierce statistic is computed as the weighted sum of squares of a sequence of autocorrelations.

The R equivalent function is Box.test.

See Also:

Field Summary
 
Fields inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
k, N, pValue, testStatistics
 
Constructor Summary
BoxPierce(double[] xt, int lag, int fitdf)
          Compute the Box–Pierce test statistic for examining the null hypothesis of independence in a given time series.
 
Method Summary
 java.lang.String alternativeHypothesis()
          Get a description of the alternative hypothesis.
 java.lang.String nullHypothesis()
          Get a description of the null hypothesis.
 
Methods inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
oneSidedPvalue, pValue, rejectNull, testStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoxPierce

public BoxPierce(double[] xt,
                 int lag,
                 int fitdf)
Compute the Box–Pierce test statistic for examining the null hypothesis of independence in a given time series.

Parameters:
xt - a univariate time series
lag - the statistic will be based on lag autocorrelation coefficients
fitdf - number of degrees of freedom to be subtracted if x is a series of residuals
Method Detail

nullHypothesis

public java.lang.String nullHypothesis()
Description copied from class: HypothesisTest
Get a description of the null hypothesis.

Specified by:
nullHypothesis in class HypothesisTest
Returns:
the null hypothesis description
See Also:
Wikipedia: Null hypothesis

alternativeHypothesis

public java.lang.String alternativeHypothesis()
Description copied from class: HypothesisTest
Get a description of the alternative hypothesis.

Specified by:
alternativeHypothesis in class HypothesisTest
Returns:
the alternative hypothesis description
See Also:
Wikipedia: Alternative hypothesis

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.