ts.diag: Diagnostic Plots for Time Series fits

View source: R/ts_diag.R

ts.diagR Documentation

Diagnostic Plots for Time Series fits

Description

Plot time-series diagnostics.

Usage

ts.diag(x, lag = 10, band = qnorm(0.975)/sqrt(length(x)))

Arguments

x

(type: numeric) residuals of the fitted time series model.

lag

(type: numeric) maximum lag at which to calculate the acf and Ljung-Box test. By default set to 10.

band

(type: numeric) absolute value for bandwidth in the the ACF plot. By default set to 'qnorm(0.975)/sqrt(n)' which approximates to 0.07 for malleco data (n = 734)

Details

This function plot the residuals, the autocorrelation function of the residuals (ACF) and the p-values of the Ljung-Box Test for all lags up to lag.

Value

A ggplot object.

See Also

Box.Ljung.Test

Examples

ts.diag(malleco)

pachamaltese/lsts documentation built on Jan. 27, 2024, 4:39 a.m.