ts.diag: Diagnostics for ARIMA fits

Description Usage Arguments Details Value Author(s) Examples

Description

Performs diagnostics for ARIMA model fitted by arima or estimate with output of diagnostic plots.

Usage

1
ts.diag(object, lag.seq = NULL)

Arguments

object

the result of an arima or estimate fit.

lag.seq

the sequence of lag to calculate the Ljung-Box test statistics. The default is NULL.

Details

This function is similar to ts.diag in stats package, but with one more diagnostic plot for the normality of residuals. Also, the default sequence of lags for a Ljung-Box test is set to be seq(4,24,by = 4) if sample size n > 24, otherwise seq(1,n,4). This function has been automatically implemented in estimate function.

Diagnostics are plotted, including the ACF plot, PACF plot, p.value of white noise checking plot, and Q-Q plot for residuals.

Value

A matrix for the result of white noise checking by Ljung-Box test.

Author(s)

Debin Qiu

Examples

1
2
3
x <- arima.sim(list(order = c(3,0,0),ar = c(0.2,0.4,-0.15)),n = 100)
fit <- estimate(x,p = 3) # same as fit <- arima(x,order = c(3,0,0))
ts.diag(fit)

Example output

Attaching package: 'aTSA'

The following object is masked from 'package:graphics':

    identify

ARIMA(3,0,0) model is estimated for variable: x 

Conditional-Sum-of-Squares & Maximum Likelihood Estimation 
      Estimate    S.E t.value p.value Lag
MU      0.2230 0.1443   1.545 0.12562   1
AR 1    0.0977 0.0994   0.983 0.32808   1
AR 2    0.3218 0.0949   3.393 0.00101   2
AR 3   -0.0400 0.1002  -0.399 0.69055   3
-----
n = 100; 'sigma' = 0.9043082; AIC = 273.905; SBC = 284.3257
------------------------------ 
Correlation of Parameter Estimates 
            MU   AR 1      AR 2     AR 3 
MU     1.00000 -0.0777 -0.328582 0.005615
AR 1  -0.07765  1.0000 -0.087526 0.016524
AR 2  -0.32858 -0.0875  1.000000 0.000427
AR 3   0.00562  0.0165  0.000427 1.000000
------------------------------ 
Autocorrelation Check of Residuals 
     lag     LB p.value
[1,]   4  0.141   0.998
[2,]   8  6.379   0.605
[3,]  12  9.240   0.682
[4,]  16  9.774   0.878
[5,]  20 15.292   0.759
[6,]  24 17.043   0.847
------------------------------ 
Model for variable: x 
Estimated mean: 0.2230274 
AR factors: 1 + 0.0977 B**(1) + 0.3218 B**(2) - 0.04 B**(3)

aTSA documentation built on May 1, 2019, 8:47 p.m.