Learn R Programming

LSTS (version 2.1)

Box.Ljung.Test: Ljung-Box Test Plot

Description

Plots the p-values Ljung-Box test.

Usage

Box.Ljung.Test(z, lag = NULL, main = NULL)

Arguments

z

(type: numeric) data vector

lag

(type: numeric) the number of periods for the autocorrelation

main

(type: character) a title for the returned plot

Value

A ggplot object.

Details

The Ljung-Box test is used to check if exists autocorrelation in a time series. The statistic is $$q = n(n+2)\cdot\sum_{j=1}^h \hat{\rho}(j)^2/(n-j)$$ with n the number of observations and \(\hat{\rho}(j)\) the autocorrelation coefficient in the sample when the lag is j. LSTS_lbtp computes \(q\) and returns the p-values graph with lag j.

References

For more information on theoretical foundations and estimation methods see brockwell2002introductionLSTS ljung1978measureLSTS

See Also

periodogram

Examples

Run this code
# NOT RUN {
Box.Ljung.Test(malleco, lag = 5)
# }

Run the code above in your browser using DataLab