VAR advantage and shortcoming

Vector autoregressions[https://www.otexts.org/fpp/9/2]

VARs are useful in several contexts:

EViews syntax

https://www.uibk.ac.at/econometrics/einf/eviews_refcard.pdf

Load data in R

#setwd("H:/Dropbox/book/uvic_econometrics/547-2016/lab/lab2")
setwd("/media/snowdj/documents/Dropbox/book/uvic_econometrics/547-2016/lab/lab2")
suppressMessages(library(vars))
suppressMessages(library(fpp))
#suppressMessages(library(readxl))
suppressMessages(library(ggfortify))
mydata <- read.csv("econ547lab02data.csv", stringsAsFactors = F)
mydata$X_date_ <- as.Date(mydata$X_date_, "%Y-%m-%d")
mydata <- read.zoo(mydata, format = "%Y-%m-%d")

mydata <- ts(mydata, frequency = 4, start = c(1975,4))
str(mydata)
##  Time-Series [1:89, 1:4] from 1976 to 1998: 9.62 9.6 9.57 9.55 9.53 ...
##  - attr(*, "dimnames")=List of 2
##   ..$ : NULL
##   ..$ : chr [1:4] "lhc" "lrc" "lrm" "lrw"
##  - attr(*, "index")= Date[1:89], format: "1975-10-01" "1976-01-01" ...
head(mydata)
##           lhc      lrc      lrm      lrw
## [1,] 9.623192 11.13184 12.07941 13.68748
## [2,] 9.599204 11.13272 12.05642 13.69605
## [3,] 9.568289 11.11106 12.06075 13.69202
## [4,] 9.547288 11.10917 12.07369 13.72911
## [5,] 9.526518 11.12232 12.10099 13.75605
## [6,] 9.476097 11.14304 12.11345 13.76211
autoplot(mydata)

Difference data

diffdata <- diff(mydata)
head(diffdata)
##              lhc           lrc          lrm          lrw
## [1,] -0.02398806  0.0008779375 -0.022994152  0.008564588
## [2,] -0.03091565 -0.0216597887  0.004330447 -0.004025515
## [3,] -0.02100037 -0.0018849865  0.012942662  0.037091429
## [4,] -0.02076992  0.0131504506  0.027296340  0.026933004
## [5,] -0.05042167  0.0207106696  0.012466571  0.006062178
## [6,] -0.01434714  0.0236890449  0.009957350  0.028722831

Graph for differenced data

autoplot(diffdata)

Model selection

VARselect(diffdata, lag.max=8, type="const")$selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##      6      1      1      6

Estimate R tutorial

#detach("package:MTS", unload=TRUE)
var <- VAR(diffdata, p=1, type="const")

Summary

summary(var)
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: lhc, lrc, lrm, lrw 
## Deterministic variables: const 
## Sample size: 87 
## Log Likelihood: 1013.209 
## Roots of the characteristic polynomial:
## 0.7658 0.466 0.3178 0.03153
## Call:
## VAR(y = diffdata, p = 1, type = "const")
## 
## 
## Estimation results for equation lhc: 
## ==================================== 
## lhc = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##         Estimate Std. Error t value Pr(>|t|)    
## lhc.l1  0.743965   0.075655   9.834 1.59e-15 ***
## lrc.l1  0.039250   0.124593   0.315    0.754    
## lrm.l1  0.083690   0.165449   0.506    0.614    
## lrw.l1 -0.007215   0.053451  -0.135    0.893    
## const   0.003635   0.002298   1.582    0.118    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.01402 on 82 degrees of freedom
## Multiple R-Squared: 0.5994,  Adjusted R-squared: 0.5798 
## F-statistic: 30.67 on 4 and 82 DF,  p-value: 1.316e-15 
## 
## 
## Estimation results for equation lrc: 
## ==================================== 
## lrc = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##          Estimate Std. Error t value Pr(>|t|)    
## lhc.l1 -0.0664483  0.0544663  -1.220    0.226    
## lrc.l1 -0.1355711  0.0896984  -1.511    0.135    
## lrm.l1  0.6876535  0.1191119   5.773 1.34e-07 ***
## lrw.l1  0.0562783  0.0384808   1.463    0.147    
## const   0.0005973  0.0016542   0.361    0.719    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.01009 on 82 degrees of freedom
## Multiple R-Squared: 0.3708,  Adjusted R-squared: 0.3401 
## F-statistic: 12.08 on 4 and 82 DF,  p-value: 9.14e-08 
## 
## 
## Estimation results for equation lrm: 
## ==================================== 
## lrm = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##        Estimate Std. Error t value Pr(>|t|)    
## lhc.l1 0.092855   0.046852   1.982 0.050843 .  
## lrc.l1 0.132531   0.077159   1.718 0.089637 .  
## lrm.l1 0.269603   0.102461   2.631 0.010160 *  
## lrw.l1 0.017162   0.033101   0.518 0.605528    
## const  0.005477   0.001423   3.849 0.000234 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.008682 on 82 degrees of freedom
## Multiple R-Squared: 0.2399,  Adjusted R-squared: 0.2028 
## F-statistic:  6.47 on 4 and 82 DF,  p-value: 0.0001414 
## 
## 
## Estimation results for equation lrw: 
## ==================================== 
## lrw = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##        Estimate Std. Error t value Pr(>|t|)  
## lhc.l1 0.042254   0.164771   0.256   0.7983  
## lrc.l1 0.413140   0.271355   1.523   0.1317  
## lrm.l1 0.655201   0.360337   1.818   0.0727 .
## lrw.l1 0.004466   0.116412   0.038   0.9695  
## const  0.004814   0.005004   0.962   0.3389  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.03053 on 82 degrees of freedom
## Multiple R-Squared: 0.08648, Adjusted R-squared: 0.04192 
## F-statistic: 1.941 on 4 and 82 DF,  p-value: 0.1114 
## 
## 
## 
## Covariance matrix of residuals:
##           lhc        lrc        lrm       lrw
## lhc 1.966e-04  2.095e-05  1.044e-05 8.142e-05
## lrc 2.095e-05  1.019e-04 -1.924e-05 6.151e-06
## lrm 1.044e-05 -1.924e-05  7.538e-05 7.721e-05
## lrw 8.142e-05  6.151e-06  7.721e-05 9.323e-04
## 
## Correlation matrix of residuals:
##         lhc      lrc      lrm     lrw
## lhc 1.00000  0.14809  0.08574 0.19019
## lrc 0.14809  1.00000 -0.21961 0.01996
## lrm 0.08574 -0.21961  1.00000 0.29124
## lrw 0.19019  0.01996  0.29124 1.00000

Test R tutorial

The null hypothesis of no serial correlation in the residuals

serial.test(var, lags.pt=10, type="PT.asymptotic")
## 
##  Portmanteau Test (asymptotic)
## 
## data:  Residuals of VAR object var
## Chi-squared = 160.44, df = 144, p-value = 0.1653

Var summary

summary(var)
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: lhc, lrc, lrm, lrw 
## Deterministic variables: const 
## Sample size: 87 
## Log Likelihood: 1013.209 
## Roots of the characteristic polynomial:
## 0.7658 0.466 0.3178 0.03153
## Call:
## VAR(y = diffdata, p = 1, type = "const")
## 
## 
## Estimation results for equation lhc: 
## ==================================== 
## lhc = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##         Estimate Std. Error t value Pr(>|t|)    
## lhc.l1  0.743965   0.075655   9.834 1.59e-15 ***
## lrc.l1  0.039250   0.124593   0.315    0.754    
## lrm.l1  0.083690   0.165449   0.506    0.614    
## lrw.l1 -0.007215   0.053451  -0.135    0.893    
## const   0.003635   0.002298   1.582    0.118    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.01402 on 82 degrees of freedom
## Multiple R-Squared: 0.5994,  Adjusted R-squared: 0.5798 
## F-statistic: 30.67 on 4 and 82 DF,  p-value: 1.316e-15 
## 
## 
## Estimation results for equation lrc: 
## ==================================== 
## lrc = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##          Estimate Std. Error t value Pr(>|t|)    
## lhc.l1 -0.0664483  0.0544663  -1.220    0.226    
## lrc.l1 -0.1355711  0.0896984  -1.511    0.135    
## lrm.l1  0.6876535  0.1191119   5.773 1.34e-07 ***
## lrw.l1  0.0562783  0.0384808   1.463    0.147    
## const   0.0005973  0.0016542   0.361    0.719    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.01009 on 82 degrees of freedom
## Multiple R-Squared: 0.3708,  Adjusted R-squared: 0.3401 
## F-statistic: 12.08 on 4 and 82 DF,  p-value: 9.14e-08 
## 
## 
## Estimation results for equation lrm: 
## ==================================== 
## lrm = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##        Estimate Std. Error t value Pr(>|t|)    
## lhc.l1 0.092855   0.046852   1.982 0.050843 .  
## lrc.l1 0.132531   0.077159   1.718 0.089637 .  
## lrm.l1 0.269603   0.102461   2.631 0.010160 *  
## lrw.l1 0.017162   0.033101   0.518 0.605528    
## const  0.005477   0.001423   3.849 0.000234 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.008682 on 82 degrees of freedom
## Multiple R-Squared: 0.2399,  Adjusted R-squared: 0.2028 
## F-statistic:  6.47 on 4 and 82 DF,  p-value: 0.0001414 
## 
## 
## Estimation results for equation lrw: 
## ==================================== 
## lrw = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##        Estimate Std. Error t value Pr(>|t|)  
## lhc.l1 0.042254   0.164771   0.256   0.7983  
## lrc.l1 0.413140   0.271355   1.523   0.1317  
## lrm.l1 0.655201   0.360337   1.818   0.0727 .
## lrw.l1 0.004466   0.116412   0.038   0.9695  
## const  0.004814   0.005004   0.962   0.3389  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.03053 on 82 degrees of freedom
## Multiple R-Squared: 0.08648, Adjusted R-squared: 0.04192 
## F-statistic: 1.941 on 4 and 82 DF,  p-value: 0.1114 
## 
## 
## 
## Covariance matrix of residuals:
##           lhc        lrc        lrm       lrw
## lhc 1.966e-04  2.095e-05  1.044e-05 8.142e-05
## lrc 2.095e-05  1.019e-04 -1.924e-05 6.151e-06
## lrm 1.044e-05 -1.924e-05  7.538e-05 7.721e-05
## lrw 8.142e-05  6.151e-06  7.721e-05 9.323e-04
## 
## Correlation matrix of residuals:
##         lhc      lrc      lrm     lrw
## lhc 1.00000  0.14809  0.08574 0.19019
## lrc 0.14809  1.00000 -0.21961 0.01996
## lrm 0.08574 -0.21961  1.00000 0.29124
## lrw 0.19019  0.01996  0.29124 1.00000

Forecast in VAR

fcst <- forecast(var)
plot(fcst, xlab="Year")

Forecast

summary(fcst)
## 
## Forecast method: VAR(1)
## 
## Model Information:
## 
## VAR Estimation Results:
## ======================= 
## 
## Estimated coefficients for equation lhc: 
## ======================================== 
## Call:
## lhc = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##       lhc.l1       lrc.l1       lrm.l1       lrw.l1        const 
##  0.743965451  0.039249548  0.083690164 -0.007214767  0.003634752 
## 
## 
## Estimated coefficients for equation lrc: 
## ======================================== 
## Call:
## lrc = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##        lhc.l1        lrc.l1        lrm.l1        lrw.l1         const 
## -0.0664482853 -0.1355710865  0.6876535018  0.0562782847  0.0005972531 
## 
## 
## Estimated coefficients for equation lrm: 
## ======================================== 
## Call:
## lrm = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##      lhc.l1      lrc.l1      lrm.l1      lrw.l1       const 
## 0.092855153 0.132531499 0.269603292 0.017162046 0.005477467 
## 
## 
## Estimated coefficients for equation lrw: 
## ======================================== 
## Call:
## lrw = lhc.l1 + lrc.l1 + lrm.l1 + lrw.l1 + const 
## 
##      lhc.l1      lrc.l1      lrm.l1      lrw.l1       const 
## 0.042254042 0.413140041 0.655200761 0.004466028 0.004813776 
## 
## 
## 
## Error measures:
##                             ME       RMSE         MAE        MPE
## lhc Training set -7.017717e-20 0.01361081 0.010030318   43.01055
## lrc Training set  9.779823e-21 0.00979887 0.006555468  123.33580
## lrm Training set  2.260702e-20 0.00842904 0.006092447 5856.65380
## lrw Training set  3.290382e-19 0.02964349 0.022340626   58.50191
##                        MAPE      MASE         ACF1
## lhc Training set   78.97531 0.6299238 -0.182100610
## lrc Training set  186.57130 0.5332630 -0.129157745
## lrm Training set 5947.27258 0.6350939 -0.019645607
## lrw Training set  134.17153 0.7260785  0.002108128
## 
## Forecasts:
## lhc 
##         Point Forecast         Lo 80      Hi 80        Lo 95      Hi 95
## 1998 Q1     0.02851435  1.054748e-02 0.04648123  0.001036385 0.05599232
## 1998 Q2     0.02649173  4.018966e-03 0.04896449 -0.007877397 0.06086086
## 1998 Q3     0.02468346 -1.486049e-05 0.04938178 -0.013089362 0.06245628
## 1998 Q4     0.02331189 -2.595149e-03 0.04921893 -0.016309508 0.06293329
## 1999 Q1     0.02222694 -4.360555e-03 0.04881443 -0.018435123 0.06288900
## 1999 Q2     0.02139285 -5.584928e-03 0.04837063 -0.019866102 0.06265181
## 1999 Q3     0.02074852 -6.455260e-03 0.04795229 -0.020856068 0.06235310
## 1999 Q4     0.02025378 -7.081569e-03 0.04758913 -0.021552028 0.06205959
## 2000 Q1     0.01987389 -7.538289e-03 0.04728607 -0.022049422 0.06179721
## 2000 Q2     0.01958263 -7.874495e-03 0.04703976 -0.022409421 0.06157469
## 
## lrc 
##         Point Forecast        Lo 80      Hi 80        Lo 95      Hi 95
## 1998 Q1    0.014375754  0.001440803 0.02731071 -0.005406546 0.03415805
## 1998 Q2    0.007722572 -0.008051241 0.02349638 -0.016401394 0.03184654
## 1998 Q3    0.008794147 -0.007121622 0.02470992 -0.015546922 0.03313522
## 1998 Q4    0.007865051 -0.008137460 0.02386756 -0.016608677 0.03233878
## 1999 Q1    0.007810961 -0.008211994 0.02383392 -0.016694034 0.03231596
## 1999 Q2    0.007607762 -0.008426392 0.02364192 -0.016914360 0.03212988
## 1999 Q3    0.007525529 -0.008514417 0.02356548 -0.017005452 0.03205651
## 1999 Q4    0.007449475 -0.008593820 0.02349277 -0.017086628 0.03198558
## 2000 Q1    0.007400161 -0.008645086 0.02344541 -0.017138927 0.03193925
## 2000 Q2    0.007361782 -0.008684610 0.02340817 -0.017179057 0.03190262
## 
## lrm 
##         Point Forecast         Lo 80      Hi 80        Lo 95      Hi 95
## 1998 Q1     0.01446204  3.335332e-03 0.02558876 -0.002554794 0.03147888
## 1998 Q2     0.01424173  2.406712e-03 0.02607675 -0.003858368 0.03234183
## 1998 Q3     0.01316970  9.993917e-04 0.02534000 -0.005443179 0.03178257
## 1998 Q4     0.01280392  4.912515e-04 0.02511659 -0.006026682 0.03163452
## 1999 Q1     0.01244882  5.748194e-05 0.02484016 -0.006502096 0.03139974
## 1999 Q2     0.01223345 -2.024926e-04 0.02466939 -0.006785682 0.03125258
## 1999 Q3     0.01206579 -3.961473e-04 0.02452773 -0.006993098 0.03112468
## 1999 Q4     0.01194537 -5.317993e-04 0.02442254 -0.007136813 0.03102755
## 2000 Q1     0.01185393 -6.321782e-04 0.02434004 -0.007241924 0.03094978
## 2000 Q2     0.01178520 -7.061541e-04 0.02427656 -0.007318678 0.03088908
## 
## lrw 
##         Point Forecast       Lo 80      Hi 80       Lo 95      Hi 95
## 1998 Q1     0.01819724 -0.02093351 0.05732798 -0.04164808 0.07804255
## 1998 Q2     0.02151463 -0.01847782 0.06150709 -0.03964855 0.08267782
## 1998 Q3     0.01855094 -0.02187958 0.05898146 -0.04328220 0.08038408
## 1998 Q4     0.01820161 -0.02233377 0.05873699 -0.04379191 0.08019513
## 1999 Q1     0.01751859 -0.02307054 0.05810772 -0.04455713 0.07959431
## 1999 Q2     0.01721469 -0.02340158 0.05783096 -0.04490253 0.07933191
## 1999 Q3     0.01695303 -0.02367876 0.05758482 -0.04518793 0.07909399
## 1999 Q4     0.01678081 -0.02385999 0.05742161 -0.04537393 0.07893555
## 2000 Q1     0.01664881 -0.02399727 0.05729490 -0.04551400 0.07881163
## 2000 Q2     0.01655189 -0.02409730 0.05720107 -0.04561567 0.07871945

VARMA in R/ not available in EViews

http://faculty.chicagobooth.edu/ruey.tsay/teaching/mtsbk/ http://www.rinfinance.com/agenda/2013/talk/RueyTsay.pdf

library(MTS)
## 
## Attaching package: 'MTS'
## The following object is masked from 'package:vars':
## 
##     VAR
mod <- VARMA(mydata)
## Number of parameters:  20 
## initial estimates:  0.1779 1.3911 0.1351 -0.5974 1.0007 0.0813 -0.2298 0.1245 -0.1163 0.4135 0.3242 0.1699 0.0446 0.1023 0.8151 0.0394 0.0722 0.325 -0.2076 0.9138 
## Par. lower-bounds:  -0.5772 0.9432 -0.2833 -2.1842 0.9389 -0.1761 -0.4063 0.0464 -0.1529 0.2608 0.2195 0.1236 0.0104 -0.0404 0.7173 -0.0038 -0.0575 -0.216 -0.5785 0.7497 
## Par. upper-bounds:  0.9331 1.8391 0.5535 0.9895 1.0624 0.3388 -0.0533 0.2026 -0.0797 0.5662 0.4289 0.2163 0.0788 0.2449 0.9129 0.0827 0.2019 0.866 0.1633 1.0779 
## Final   Estimates:  0.07927819 1.379054 0.2791564 -0.5643976 0.9885154 0.04649285 -0.2451457 0.1808956 -0.1029267 0.4412872 0.3014631 0.1589724 0.01637567 0.008136092 0.884023 0.06429161 0.03478935 0.239377 -0.1318689 0.9403475 
## 
## Coefficient(s):
##      Estimate  Std. Error  t value Pr(>|t|)    
## lhc  0.079278    0.428347    0.185 0.853167    
## lrc  1.379054    0.104232   13.231  < 2e-16 ***
## lrm  0.279156    0.183389    1.522 0.127956    
## lrw -0.564398    0.642472   -0.878 0.379684    
## lhc  0.988515    0.025323   39.037  < 2e-16 ***
## lrc  0.046493    0.127474    0.365 0.715318    
## lrm -0.245146    0.083285   -2.943 0.003246 ** 
## lrw  0.180896    0.038933    4.646 3.38e-06 ***
## lhc -0.102927    0.013052   -7.886 3.11e-15 ***
## lrc  0.441287    0.029220   15.102  < 2e-16 ***
## lrm  0.301463    0.034254    8.801  < 2e-16 ***
## lrw  0.158972    0.014500   10.964  < 2e-16 ***
## lhc  0.016376    0.008886    1.843 0.065361 .  
## lrc  0.008136    0.033356    0.244 0.807298    
## lrm  0.884023    0.002454  360.303  < 2e-16 ***
## lrw  0.064292    0.018391    3.496 0.000473 ***
## lhc  0.034789    0.041377    0.841 0.400469    
## lrc  0.239377    0.175999    1.360 0.173797    
## lrm -0.131869    0.131821   -1.000 0.317135    
## lrw  0.940347    0.040416   23.267  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## --- 
## Estimates in matrix form: 
## Constant term:  
## Estimates:  0.07927819 1.379054 0.2791564 -0.5643976 
## AR coefficient matrix 
## AR( 1 )-matrix 
##         [,1]    [,2]   [,3]   [,4]
## [1,]  0.9885 0.04649 -0.245 0.1809
## [2,] -0.1029 0.44129  0.301 0.1590
## [3,]  0.0164 0.00814  0.884 0.0643
## [4,]  0.0348 0.23938 -0.132 0.9403
##   
## Residuals cov-matrix: 
##              [,1]          [,2]          [,3]         [,4]
## [1,] 3.271263e-04  2.132811e-05  3.016422e-05 1.628138e-04
## [2,] 2.132811e-05  8.040960e-05 -4.119182e-06 7.018316e-05
## [3,] 3.016422e-05 -4.119182e-06  8.126028e-05 1.182583e-04
## [4,] 1.628138e-04  7.018316e-05  1.182583e-04 9.386931e-04
## ---- 
## aic=  -33.7979 
## bic=  -33.23866
summary(mod)
##           Length Class  Mode   
## data      356    mts    numeric
## ARorder     1    -none- numeric
## MAorder     1    -none- numeric
## cnst        1    -none- logical
## coef       20    -none- numeric
## secoef     20    -none- numeric
## residuals 352    -none- numeric
## Sigma      16    -none- numeric
## aic         1    -none- numeric
## bic         1    -none- numeric
## Phi        16    -none- numeric
## Theta       0    -none- NULL   
## Ph0         4    -none- numeric

Picking p and q

If you want some help picking p and q:

Eccm(mydata)
## p-values table of Extended Cross-correlation Matrices: 
## Column: MA order 
## Row   : AR order 
##        0      1      2      3      4      5      6
## 0 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
## 1 0.0000 0.0024 0.0151 0.0197 0.3613 0.4949 0.7091
## 2 0.3249 0.9138 0.2013 0.9747 0.9999 0.9995 0.9201
## 3 0.6588 0.2265 0.6549 0.7650 0.9905 0.9644 0.7366
## 4 0.9477 0.6140 0.8744 0.7971 0.8377 0.8719 0.8336
## 5 0.9999 0.8348 0.9772 0.9934 0.9994 0.9980 0.9690

VARMA(1,2)

mod <- VARMA(mydata, p=1, q =2)
## Number of parameters:  52 
## initial estimates:  0.0351 0.9792 -0.0913 -0.7615 1.0037 0.1328 -0.2706 0.1269 -0.0756 0.6036 0.2028 0.1245 0.0407 0.1644 0.7894 0.0311 0.0763 0.4109 -0.3048 0.9389 0.3589 -0.1944 0.585 -0.128 0.0816 0.1388 0.6159 -0.1287 0.0056 -0.3794 0.3935 0.0225 0.1442 -0.009 0.178 0.0506 0.3158 -0.0781 0.1414 -0.0552 0.1809 0.036 0.5513 0.0254 0.1031 1.7411 2.0088 -0.5688 0.2133 0.2831 1.7282 -0.3501 
## Par. lower-bounds:  -0.8679 0.5317 -0.5164 -2.5528 0.9254 -0.2054 -0.4939 0.0309 -0.1145 0.436 0.0921 0.0769 0.0038 0.0052 0.6843 -0.0141 -0.0792 -0.2599 -0.7477 0.7485 -0.3211 -1.2119 -0.4676 -0.3537 -0.5744 -0.8516 -0.4362 -0.3535 -0.3313 -0.8836 -0.1281 -0.0894 -0.1809 -0.4998 -0.3433 -0.0608 -0.0043 -0.5571 -0.3541 -0.1614 -0.1279 -0.4302 0.0561 -0.0804 -1.2457 -0.2773 -0.0792 -1.0167 -1.088 -1.6814 -0.3587 -0.7961 
## Par. upper-bounds:  0.9382 1.4266 0.3338 1.0298 1.0821 0.471 -0.0472 0.2229 -0.0368 0.7711 0.3134 0.1721 0.0776 0.3236 0.8945 0.0763 0.2318 1.0817 0.1382 1.1294 1.0389 0.8232 1.6377 0.0978 0.7376 1.1292 1.668 0.0961 0.3426 0.1248 0.9151 0.1344 0.4693 0.4817 0.6993 0.162 0.6359 0.4008 0.6369 0.0511 0.4897 0.5022 1.0466 0.1312 1.4519 3.7594 4.0968 -0.121 1.5145 2.2476 3.8151 0.0958 
## Final   Estimates:  0.03413497 0.9926826 -0.0788096 -0.7647428 1.009944 0.1253087 -0.2777156 0.1250925 -0.0817825 0.5996175 0.1809903 0.1455225 0.03863587 0.159784 0.7903303 0.02686827 0.06486433 0.4016138 -0.3148048 0.9265616 0.403499 -0.1679248 0.6076047 -0.09878171 0.01619433 0.06390291 0.5136661 -0.0757035 -0.008321967 -0.2541014 0.4071056 0.004559816 0.1447705 0.06112168 0.1930929 -0.06076389 0.2817123 0.01480061 0.2697276 -0.03735633 0.06610726 0.005250734 0.4674704 -0.07938088 0.1528256 1.680832 1.970627 -0.2407804 0.2136075 0.2298716 1.694647 -0.2742968
## Warning in sqrt(diag(solve(Hessian))): NaNs produced
## 
## Coefficient(s):
##      Estimate  Std. Error  t value Pr(>|t|)    
## lhc  0.034135    1.220725    0.028 0.977692    
## lrc  0.992683    0.522335    1.900 0.057372 .  
## lrm -0.078810    0.976916   -0.081 0.935703    
## lrw -0.764743    4.788171   -0.160 0.873106    
## lhc  1.009944    0.039345   25.669  < 2e-16 ***
## lrc  0.125309    0.095141    1.317 0.187812    
## lrm -0.277716    0.063316   -4.386 1.15e-05 ***
## lrw  0.125093    0.034723    3.603 0.000315 ***
## lhc -0.081782    0.020005   -4.088 4.35e-05 ***
## lrc  0.599617          NA       NA       NA    
## lrm  0.180990    0.043314    4.179 2.93e-05 ***
## lrw  0.145522    0.024955    5.831 5.50e-09 ***
## lhc  0.038636    0.029305    1.318 0.187364    
## lrc  0.159784    0.052254    3.058 0.002229 ** 
## lrm  0.790330    0.004553  173.574  < 2e-16 ***
## lrw  0.026868    0.017598    1.527 0.126824    
## lhc  0.064864    0.149083    0.435 0.663498    
## lrc  0.401614    0.356015    1.128 0.259285    
## lrm -0.314805    0.261479   -1.204 0.228613    
## lrw  0.926562    0.103033    8.993  < 2e-16 ***
##      0.403499    0.439418    0.918 0.358484    
##     -0.167925    0.107430   -1.563 0.118027    
##      0.607605          NA       NA       NA    
##     -0.098782    0.080996   -1.220 0.222621    
##      0.016194    0.199868    0.081 0.935422    
##      0.063903          NA       NA       NA    
##      0.513666          NA       NA       NA    
##     -0.075703    0.039706   -1.907 0.056574 .  
##     -0.008322    0.237307   -0.035 0.972025    
##     -0.254101          NA       NA       NA    
##      0.407106          NA       NA       NA    
##      0.004560    0.047305    0.096 0.923209    
##      0.144771    0.170937    0.847 0.397038    
##      0.061122          NA       NA       NA    
##      0.193093          NA       NA       NA    
##     -0.060764    0.025233   -2.408 0.016036 *  
##      0.281712    0.400267    0.704 0.481551    
##      0.014801          NA       NA       NA    
##      0.269728          NA       NA       NA    
##     -0.037356    0.071990   -0.519 0.603822    
##      0.066107    0.313322    0.211 0.832897    
##      0.005251    0.100873    0.052 0.958486    
##      0.467470          NA       NA       NA    
##     -0.079381    0.054986   -1.444 0.148834    
##      0.152826    1.910975    0.080 0.936259    
##      1.680832          NA       NA       NA    
##      1.970627          NA       NA       NA    
##     -0.240780    0.344503   -0.699 0.484602    
##      0.213608    1.002587    0.213 0.831283    
##      0.229872    0.840785    0.273 0.784545    
##      1.694647          NA       NA       NA    
##     -0.274297    0.218073   -1.258 0.208456    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## --- 
## Estimates in matrix form: 
## Constant term:  
## Estimates:  0.03413497 0.9926826 -0.0788096 -0.7647428 
## AR coefficient matrix 
## AR( 1 )-matrix 
##         [,1]  [,2]   [,3]   [,4]
## [1,]  1.0099 0.125 -0.278 0.1251
## [2,] -0.0818 0.600  0.181 0.1455
## [3,]  0.0386 0.160  0.790 0.0269
## [4,]  0.0649 0.402 -0.315 0.9266
## MA coefficient matrix 
## MA( 1 )-matrix 
##          [,1]    [,2]   [,3]     [,4]
## [1,] -0.40350  0.1679 -0.608  0.09878
## [2,]  0.00832  0.2541 -0.407 -0.00456
## [3,] -0.28171 -0.0148 -0.270  0.03736
## [4,] -0.15283 -1.6808 -1.971  0.24078
## MA( 2 )-matrix 
##         [,1]     [,2]   [,3]   [,4]
## [1,] -0.0162 -0.06390 -0.514 0.0757
## [2,] -0.1448 -0.06112 -0.193 0.0608
## [3,] -0.0661 -0.00525 -0.467 0.0794
## [4,] -0.2136 -0.22987 -1.695 0.2743
##   
## Residuals cov-matrix: 
##            [,1]       [,2]       [,3]      [,4]
## [1,] 0.18095381 0.08603523 0.14528222 0.7241540
## [2,] 0.08603523 0.04103382 0.06915376 0.3447155
## [3,] 0.14528222 0.06915376 0.11686436 0.5821019
## [4,] 0.72415400 0.34471554 0.58210191 2.9016109
## ---- 
## aic=  -24.93088 
## bic=  -23.47685
summary(mod)
##           Length Class  Mode   
## data      356    mts    numeric
## ARorder     1    -none- numeric
## MAorder     1    -none- numeric
## cnst        1    -none- logical
## coef       52    -none- numeric
## secoef     52    -none- numeric
## residuals 348    -none- numeric
## Sigma      16    -none- numeric
## aic         1    -none- numeric
## bic         1    -none- numeric
## Phi        16    -none- numeric
## Theta      32    -none- numeric
## Ph0         4    -none- numeric