Learn R Programming

feasts (version 0.3.0)

ljung_box: Portmanteau tests

Description

Compute the Box–Pierce or Ljung–Box test statistic for examining the null hypothesis of independence in a given time series. These are sometimes known as ‘portmanteau’ tests.

Usage

ljung_box(x, lag = 1, dof = 0, ...)

box_pierce(x, lag = 1, dof = 0, ...)

portmanteau_tests

Value

A vector of numeric features for the test's statistic and p-value.

Format

An object of class list of length 2.

Arguments

x

A numeric vector

lag

The number of lag autocorrelation coefficients to use in calculating the statistic

dof

Degrees of freedom of the fitted model (useful if x is a series of residuals).

...

Unused.

See Also

Examples

Run this code
ljung_box(rnorm(100))

box_pierce(rnorm(100))

Run the code above in your browser using DataLab