arx: Estimate an AR-X model with log-ARCH-X errors

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/arx.R

Description

Estimation by OLS, two-step OLS if a variance specification is specified: In the first the mean specification (AR-X) is estimated, whereas in the second step the log-variance specification (log-ARCH-X) is estimated.

The AR-X mean specification can contain an intercept, AR-terms, lagged moving averages of the regressand and other conditioning covariates ('X'). The log-variance specification can contain log-ARCH terms, asymmetry or 'leverage' terms, log(EqWMA) where EqWMA is a lagged equally weighted moving average of past squared residuals (a volatility proxy) and other conditioning covariates ('X').

Usage

1
2
3
4
5
arx(y, mc=FALSE, ar=NULL, ewma=NULL, mxreg=NULL, vc=FALSE,
  arch=NULL, asym=NULL, log.ewma=NULL, vxreg=NULL, zero.adj=0.1,
  vc.adj=TRUE, vcov.type=c("ordinary", "white", "newey-west"),
  qstat.options=NULL, user.estimator=NULL, user.diagnostics=NULL,
  tol=1e-07, LAPACK=FALSE, plot=NULL)

Arguments

y

numeric vector, time-series or zoo object. Missing values in the beginning and at the end of the series is allowed, as they are removed with the na.trim command

mc

logical. TRUE includes an intercept in the mean specification, whereas FALSE (default) does not

ar

either NULL (default) or an integer vector, say, c(2,4) or 1:4. The AR-lags to include in the mean specification. If NULL, then no lags are included

ewma

either NULL (default) or a list with arguments sent to the eqwma function. In the latter case a lagged moving average of y is included as a regressor

mxreg

either NULL (default) or a numeric vector or matrix, say, a zoo object, of conditioning variables. Note that, if both y and mxreg are zoo objects, then their samples are chosen to match

vc

logical. TRUE includes an intercept in the log-variance specification, whereas FALSE (default) does not. If the log-variance specification contains any other item but the log-variance intercept, then vc is set to TRUE

arch

either NULL (default) or an integer vector, say, c(1,3) or 2:5. The log-ARCH lags to include in the log-variance specification

asym

either NULL (default) or an integer vector, say, c(1) or 1:3. The asymmetry (i.e. 'leverage') terms to include in the log-variance specification

log.ewma

either NULL (default) or a vector of the lengths of the volatility proxies, see leqwma

vxreg

either NULL (default) or a numeric vector or matrix, say, a zoo object, of conditioning variables. If both y and mxreg are zoo objects, then their samples are chosen to match

zero.adj

numeric value between 0 and 1. The quantile adjustment for zero values. The default 0.1 means the zero residuals are replaced by the 10 percent quantile of the absolute residuals before taking the logarithm

vc.adj

logical. If TRUE (default), then the log-variance intercept is adjusted by the estimate of E[ln(z^2)], where z is the standardised error. This adjustment is needed for the conditional scale to be equal to the conditional standard deviation. If FALSE, then the log-variance intercept is not adjusted

vcov.type

character vector, "ordinary" (default), "white" or "newey-west". If "ordinary", then the ordinary variance-covariance matrix is used for inference. If "white", then the White (1980) heteroscedasticity-robust matrix is used. If "newey-west", then the Newey and West (1987) heteroscedasticity and autocorrelation-robust matrix is used

qstat.options

NULL (default) or an integer vector of length two, say, c(1,1). The first value sets the lag-order of the AR diagnostic test, whereas the second value sets the lag-order of the ARCH diagnostic test. If NULL, then the two values of the vector are set automatically

user.estimator

NULL (default) or a list with one entry, name, containing the name of the user-defined estimator

user.diagnostics

NULL (default) or a list with two entries, name and pval, see the user.fun argument in diagnostics

tol

numeric value (default = 1e-07). The tolerance for detecting linear dependencies in the columns of the regressors (see qr function). Only used if LAPACK is FALSE (default)

LAPACK

logical. If TRUE, then use LAPACK. If FALSE (default), then use LINPACK (see qr function)

plot

NULL or logical. If TRUE, then the fitted values and the residuals are plotted. If NULL (default), then the value set by options determines whether a plot is produced or not.

Details

See Sucarrat and Escribano (2012)

Value

A list of class 'arx'

Author(s)

Genaro Sucarrat, http://www.sucarrat.net/

References

Genaro Sucarrat and Alvaro Escribano (2012): 'Automated Financial Model Selection: General-to-Specific Modelling of the Mean and Volatility Specifications', Oxford Bulletin of Economics and Statistics 74, Issue no. 5 (October), pp. 716-735

Halbert White (1980): 'A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity', Econometrica 48, pp. 817-838

Whitney K. Newey and Kenned D. West (1987): 'A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix', Econometrica 55, pp. 703-708

See Also

Extraction functions (mostly S3 methods): coef.arx, ES, fitted.arx, plot.arx,
print.arx, recursive, residuals.arx, sigma.arx, rsquared,
summary.arx, VaR and vcov.arx

Related functions: getsm, getsv, isat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
##Simulate from an AR(1):
set.seed(123)
y <- arima.sim(list(ar=0.4), 70)

##estimate an AR(2) with intercept:
arx(y, mc=TRUE, ar=1:2)

##Simulate four independent Gaussian regressors:
xregs <- matrix(rnorm(4*70), 70, 4)

##estimate an AR(2) with intercept and four conditioning
##regressors in the mean:
arx(y, mc=TRUE, ar=1:2, mxreg=xregs)

##estimate a log-variance specification with a log-ARCH(4)
##structure:
arx(y, arch=1:4)

##estimate a log-variance specification with a log-ARCH(4)
##structure and an asymmetry/leverage term:
arx(y, arch=1:4, asym=1)

##estimate a log-variance specification with a log-ARCH(4)
##structure, an asymmetry or leverage term, a 10-period log(EWMA) as
##volatility proxy, and the log of the squareds of the conditioning
##regressors in the log-variance specification:
arx(y, arch=1:4, asym=1, log.ewma=list(length=10), vxreg=log(xregs^2))

##estimate an AR(2) with intercept and four conditioning regressors
##in the mean, and a log-variance specification with a log-ARCH(4)
##structure, an asymmetry or leverage term, a 10-period log(EWMA) as
##volatility proxy, and the log of the squareds of the conditioning
##regressors in the log-variance specification:
arx(y, mc=TRUE, ar=1:2, mxreg=xregs, arch=1:4, asym=1,
  log.ewma=list(length=10), vxreg=log(xregs^2))

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric


Date: Tue Oct 31 19:56:00 2017 
Dependent var.: y 
Method: Ordinary Least Squares (OLS) 
Variance-Covariance: Ordinary 
No. of observations (mean eq.): 68 
Sample: 3 to 70 

Mean equation:

            coef std.error  t-stat p-value
mconst  0.013715  0.115112  0.1191 0.90553
ar1     0.323324  0.125262  2.5812 0.01211
ar2    -0.040814  0.124257 -0.3285 0.74361

Diagnostics:

                     Chi-sq df p-value
Ljung-Box AR(3)   3.8157196  3 0.28206
Ljung-Box ARCH(1) 0.0087708  1 0.92538
Jarque-Bera       0.3225323  2 0.85107
                          
SE of regression   0.94884
R-squared          0.09647
Log-lik.(n=68)   -91.41661

Date: Tue Oct 31 19:56:01 2017 
Dependent var.: y 
Method: Ordinary Least Squares (OLS) 
Variance-Covariance: Ordinary 
No. of observations (mean eq.): 68 
Sample: 3 to 70 

Mean equation:

            coef std.error  t-stat p-value
mconst -0.020030  0.117600 -0.1703 0.86532
ar1     0.314052  0.130041  2.4150 0.01875
ar2    -0.058036  0.129614 -0.4478 0.65591
mxreg1 -0.045191  0.126042 -0.3585 0.72118
mxreg2  0.108048  0.126116  0.8567 0.39494
mxreg3  0.159350  0.133675  1.1921 0.23785
mxreg4  0.145276  0.114408  1.2698 0.20898

Diagnostics:

                   Chi-sq df p-value
Ljung-Box AR(3)   2.92995  3 0.40255
Ljung-Box ARCH(1) 0.17116  1 0.67908
Jarque-Bera       0.68521  2 0.70992
                          
SE of regression   0.95304
R-squared          0.14454
Log-lik.(n=68)   -89.71711

Date: Tue Oct 31 19:56:01 2017 
Dependent var.: y 
Method: Ordinary Least Squares (OLS) 
No. of observations (variance eq.): 66 
Sample: 1 to 70 

Log-variance equation:

            coef std.error  t-stat p-value
vconst -0.334531  0.471100  0.5042  0.4776
arch1   0.040073  0.128641  0.3115  0.7565
arch2  -0.076960  0.133758 -0.5754  0.5672
arch3  -0.124580  0.133945 -0.9301  0.3560
arch4  -0.058274  0.134204 -0.4342  0.6657

Diagnostics:

                   Chi-sq df  p-value
Ljung-Box AR(1)   5.81809  1 0.015862
Ljung-Box ARCH(5) 3.66769  5 0.598180
Jarque-Bera       0.50863  2 0.775447
                          
SE of regression   0.97479
R-squared         -0.00002
Log-lik.(n=66)   -91.89688

Date: Tue Oct 31 19:56:01 2017 
Dependent var.: y 
Method: Ordinary Least Squares (OLS) 
No. of observations (variance eq.): 66 
Sample: 1 to 70 

Log-variance equation:

            coef std.error  t-stat p-value
vconst -0.123582  0.468464  0.0696 0.79193
arch1   0.246437  0.174802  1.4098 0.16376
arch2  -0.071564  0.131724 -0.5433 0.58895
arch3  -0.130442  0.131916 -0.9888 0.32672
arch4  -0.018810  0.134119 -0.1402 0.88893
asym1  -0.378539  0.221001 -1.7128 0.09191

Diagnostics:

                  Chi-sq df  p-value
Ljung-Box AR(1)   5.2578  1 0.021849
Ljung-Box ARCH(5) 1.4461  5 0.919207
Jarque-Bera       2.2276  2 0.328317
                          
SE of regression   0.97479
R-squared         -0.00002
Log-lik.(n=66)   -95.13333

Date: Tue Oct 31 19:56:01 2017 
Dependent var.: y 
Method: Ordinary Least Squares (OLS) 
No. of observations (variance eq.): 66 
Sample: 1 to 70 

Log-variance equation:

                  coef std.error  t-stat p-value
vconst        0.365119  0.665309  0.3012 0.58315
arch1         0.301905  0.187916  1.6066 0.11387
arch2        -0.036126  0.138548 -0.2607 0.79526
arch3        -0.087623  0.140498 -0.6237 0.53543
arch4         0.064056  0.146672  0.4367 0.66402
asym1        -0.404899  0.235561 -1.7189 0.09126
logEqWMA(10) -1.259386  0.996093 -1.2643 0.21145
vxreg1       -0.132749  0.173628 -0.7646 0.44780
vxreg2        0.041071  0.175363  0.2342 0.81570
vxreg3        0.161644  0.153319  1.0543 0.29636
vxreg4        0.058217  0.134571  0.4326 0.66699

Diagnostics:

                  Chi-sq df  p-value
Ljung-Box AR(1)   4.6148  1 0.031697
Ljung-Box ARCH(5) 5.0951  5 0.404380
Jarque-Bera       8.6671  2 0.013121
                           
SE of regression    0.97479
R-squared          -0.00002
Log-lik.(n=66)   -100.00487

Date: Tue Oct 31 19:56:01 2017 
Dependent var.: y 
Method: Ordinary Least Squares (OLS) 
Variance-Covariance: Ordinary 
No. of observations (mean eq.): 68 
No. of observations (variance eq.): 64 
Sample: 3 to 70 

Mean equation:

            coef std.error  t-stat p-value
mconst -0.020030  0.117600 -0.1703 0.86532
ar1     0.314052  0.130041  2.4150 0.01875
ar2    -0.058036  0.129614 -0.4478 0.65591
mxreg1 -0.045191  0.126042 -0.3585 0.72118
mxreg2  0.108048  0.126116  0.8567 0.39494
mxreg3  0.159350  0.133675  1.1921 0.23785
mxreg4  0.145276  0.114408  1.2698 0.20898

Log-variance equation:

                   coef  std.error  t-stat p-value
vconst       -0.7557661  0.5189110  2.1212 0.14527
arch1         0.0847695  0.1567522  0.5408 0.59092
arch2         0.0368367  0.1393747  0.2643 0.79257
arch3        -0.0447772  0.1311476 -0.3414 0.73413
arch4        -0.1020461  0.1305049 -0.7819 0.43773
asym1        -0.4486150  0.2423142 -1.8514 0.06969
logEqWMA(10) -0.5774913  0.7910264 -0.7301 0.46857
vxreg1       -0.1238884  0.1260718 -0.9827 0.33023
vxreg2        0.0448394  0.1229734  0.3646 0.71684
vxreg3       -0.0076974  0.1144433 -0.0673 0.94663
vxreg4       -0.0165456  0.0967990 -0.1709 0.86493

Diagnostics:

                  Chi-sq df  p-value
Ljung-Box AR(3)   6.2873  3 0.098438
Ljung-Box ARCH(5) 2.6166  5 0.758844
Jarque-Bera       1.4104  2 0.494006
                          
SE of regression   0.95304
R-squared          0.14454
Log-lik.(n=64)   -83.12129

gets documentation built on April 4, 2018, 5:03 p.m.