TARMAGARCH.test: ARMA GARCH versus TARMA GARCH supLM test for nonlinearity

View source: R/TARMAGARCH.test.R

TARMAGARCH.testR Documentation

ARMA GARCH versus TARMA GARCH supLM test for nonlinearity

Description

Implements a supremum Lagrange Multiplier test for a ARMA-GARCH specification versus a TARMA-GARCH specification. Both the AR and MA parameters are tested. Also includes the ARCH case.

Usage

TARMAGARCH.test(
  x,
  pa = 0.25,
  pb = 0.75,
  ar.ord = 1,
  ma.ord = 1,
  arch.ord = 1,
  garch.ord = 1,
  d = 1,
  thd.range,
  ...
)

Arguments

x

A univariate time series.

pa

Real number in [0,1]. Sets the lower limit for the threshold search to the 100*pa-th sample percentile. The default is 0.25

pb

Real number in [0,1]. Sets the upper limit for the threshold search to the 100*pb-th sample percentile. The default is 0.75

ar.ord

Order of the AR part. It must be a positive integer

ma.ord

Order of the MA part. It must be a positive integer

arch.ord

Order of the ARCH part. It must be a positive integer

garch.ord

Order of the GARCH part. It must be a non negative integer.

d

Delay parameter. Defaults to 1.

thd.range

Vector of optional user defined threshold range. If missing then pa and pb are used.

...

Additional arguments to be passed to ugarchfit.

Details

Implements an asymptotic supremum Lagrange Multiplier test to test an ARMA-GARCH specification versus a TARMA-GARCH specification. In other words, the test is robust with respect to heteroskedasticity. Both the AR parameters and the MA parameters are tested. This is an asymptotic test and the value of the test statistic has to be compared with the critical values reported in the output and taken from \insertCiteAnd03tseriesTARMA. It includes the ARCH case if garch.ord=0. The null ARMA-GARCH model is estimated in one step with the function ugarchfit from the package rugarch. The estimated AR and MA polynomials are checked for stationarity and invertibility.

Value

A list of class htest with components:

statistic

The value of the supLM statistic.

parameter

A named vector: threshold is the value that maximises the Lagrange Multiplier values.

test.v

Vector of values of the LM statistic for each threshold given in thd.range.

thd.range

Range of values of the threshold.

fit

The null model: ARMA-GARCH fit using rugarch.

sigma2

Estimated innovation variance from the ARMA fit.

data.name

A character string giving the name of the data.

prop

Proportion of values of the series that fall in the lower regime.

p.value

The p-value of the test. It is NULL for the asymptotic test.

method

A character string indicating the type of test performed.

d

The delay parameter.

pa

Lower threshold quantile.

dfree

Effective degrees of freedom. It is the number of tested parameters.

Author(s)

Simone Giannerini, simone.giannerini@uniud.it

Greta Goracci, greta.goracci@unibz.it

References

  • \insertRef

    Ang23tseriesTARMA

  • \insertRef

    Gor21tseriesTARMA

  • \insertRef

    And03tseriesTARMA

See Also

TARMA.test and TAR.test.B for the asymptotic and bootstrap test without the GARCH component. TARMA.sim to simulate from a TARMA process. TARMA.fit and TARMA.fit2 for TARMA modelling.

Examples

## Function to simulate from a ARMA-GARCH process

arma11.garch11 <- function(n, ph, th, a, b, a0=1, rand.gen = rnorm, innov = rand.gen(n, ...),
n.start = 500, start.innov = rand.gen(n.start, ...),...){

  #  Simulates a ARMA(1,1)-GARCH(1,1) process
  #  with parameters ph, th, a, b, a0.
  #         x[t] <- ph*x[t-1] + th*eps[t-1] + eps[t]
  #       eps[t] <- e[t]*sqrt(v[t])
  #         v[t] <- a0 + a*eps[t-1]^2 + b*v[t-1];
  # ph  : AR
  # th  : MA
  # a   : ARCH
  # b   : GARCH

  # checks
  if(abs(a+b)>=1)   stop("model is not stationary")
  if(b/(1-a)>=1) stop("model has infinite fourth moments")

  if (!missing(start.innov) && length(start.innov) < n.start)
    stop(gettextf("'start.innov' is too short: need %d points", n.start), domain = NA)
  e <- c(start.innov[1L:n.start], innov[1L:n])
  ntot <- length(e)
  x <- v <- eps <- double(ntot)
  v[1]   <- a0/(1.0-a-b);
  eps[1] <- e[1]*sqrt(v[1])
  x[1]   <- eps[1];
  for(i in 2:ntot){
    v[i]   <- a0 + a*eps[i-1]^2 + b*v[i-1];
    eps[i] <- e[i]*sqrt(v[i])
    x[i]   <- ph*x[i-1] + th*eps[i-1] + eps[i]
  }
  if (n.start > 0)  x <- x[-(1L:n.start)]
  return(ts(x));
}

## **************************************************************************
## Comparison between the robust and the non-robust test in presence of GARCH errors
## Simulates from the ARMA(1,1)-GARCH(1,1)

set.seed(12)
x1 <- arma11.garch11(n=100, ph=0.9, th=0.5, a=0.85, b=0.1, a0=1,n.start=500)
TARMAGARCH.test(x1, ar.ord=1, ma.ord=1, arch.ord=1, garch.ord=1, d=1)
TARMA.test(x1, ar.ord=1, ma.ord=1, d=1, ma.fixed=FALSE)

## a TARMA(1,1,1,1) where the threshold effect is on the AR parameters
set.seed(123)
x2  <- TARMA.sim(n=100, phi1=c(0.5,-0.5), phi2=c(0.0,0.8), theta1=0.5, theta2=0.5, d=1, thd=0.2)
TARMAGARCH.test(x2, ar.ord=1, ma.ord=1, d=1)



tseriesTARMA documentation built on Oct. 8, 2024, 5:11 p.m.