# MTSdiag: Multivariate Time Series Diagnostic Checking In MTS: All-Purpose Toolkit for Analyzing Multivariate Time Series (MTS) and Estimating Multivariate Volatility Models

## Description

Performs model checking for a fitted multivariate time series model, including residual cross-correlation matrices, multivariate Ljung-Box tests for residuals, and residual plots

## Usage

 `1` ```MTSdiag(model, gof = 24, adj = 0, level = F) ```

## Arguments

 `model` A fitted multivariate time series model `gof` The number of lags of residual cross-correlation matrices used in the tests `adj` The adjustment for degrees of freedom of Ljung-Box statistics. Typically, the number of fitted coefficients of the model. Default is zero. `level` Logical switch for printing residual cross-correlation matrices

## Value

Various test statistics, their p-values, and residual plots.

Ruey S Tsay

## Examples

 ```1 2 3 4 5``` ```phi=matrix(c(0.2,-0.6,0.3,1.1),2,2); sigma=diag(2) m1=VARMAsim(200,arlags=c(1),phi=phi,sigma=sigma) zt=m1\$series m2=VAR(zt,1,include.mean=FALSE) MTSdiag(m2) ```

### Example output

```AR coefficient matrix
AR( 1 )-matrix
[,1]  [,2]
[1,]  0.179 0.275
[2,] -0.696 1.111
standard error
[,1]   [,2]
[1,] 0.0642 0.0303
[2,] 0.0624 0.0294

Residuals cov-mtx:
[,1]      [,2]
[1,] 1.1077442 0.1008527
[2,] 0.1008527 1.0450301

det(SSE) =  1.147455
AIC =  0.1775463
BIC =  0.2435126
HQ  =  0.2042418
[1] "Covariance matrix:"
[,1]  [,2]
[1,] 1.111 0.105
[2,] 0.105 1.042
CCM at lag:  0
[,1]   [,2]
[1,] 1.0000 0.0979
[2,] 0.0979 1.0000
Simplified matrix:
CCM at lag:  1
. .
. .
CCM at lag:  2
. .
. .
CCM at lag:  3
. .
. .
CCM at lag:  4
. .
. .
CCM at lag:  5
. .
. .
CCM at lag:  6
. .
. .
CCM at lag:  7
. .
. .
CCM at lag:  8
. .
. .
CCM at lag:  9
. .
. .
CCM at lag:  10
. .
. .
CCM at lag:  11
. .
. .
CCM at lag:  12
. .
. .
CCM at lag:  13
. .
. .
CCM at lag:  14
. .
. .
CCM at lag:  15
. .
. .
CCM at lag:  16
. .
. .
CCM at lag:  17
. .
. .
CCM at lag:  18
. .
. .
CCM at lag:  19
. .
. .
CCM at lag:  20
. .
. .
CCM at lag:  21
. .
. .
CCM at lag:  22
. .
. .
CCM at lag:  23
. .
. .
CCM at lag:  24
. .
. .
Hit Enter for p-value plot of individual ccm:

Hit Enter to compute MQ-statistics:

Ljung-Box Statistics:
m       Q(m)     df    p-value
[1,]  1.00      3.76    4.00     0.44
[2,]  2.00      5.33    8.00     0.72
[3,]  3.00      9.41   12.00     0.67
[4,]  4.00     15.69   16.00     0.47
[5,]  5.00     19.31   20.00     0.50
[6,]  6.00     20.87   24.00     0.65
[7,]  7.00     23.56   28.00     0.70
[8,]  8.00     23.86   32.00     0.85
[9,]  9.00     27.19   36.00     0.85
[10,] 10.00     34.66   40.00     0.71
[11,] 11.00     37.55   44.00     0.74
[12,] 12.00     39.98   48.00     0.79
[13,] 13.00     41.30   52.00     0.86
[14,] 14.00     43.27   56.00     0.89
[15,] 15.00     44.74   60.00     0.93
[16,] 16.00     45.47   64.00     0.96
[17,] 17.00     47.30   68.00     0.97
[18,] 18.00     49.89   72.00     0.98
[19,] 19.00     54.79   76.00     0.97
[20,] 20.00     59.71   80.00     0.96
[21,] 21.00     60.70   84.00     0.97
[22,] 22.00     64.01   88.00     0.97
[23,] 23.00     66.49   92.00     0.98
[24,] 24.00     67.29   96.00     0.99
Hit Enter to obtain residual plots:
```

MTS documentation built on May 29, 2017, 5:15 p.m.