spGARCHsim: Simulation of spatial ARCH models

sim.spGARCHR Documentation

Simulation of spatial ARCH models

Description

The function generates n random numbers of a spatial GARCH process for given parameters and weighting schemes.

Usage

sim.spGARCH(n = dim(W1)[1], rho, lambda, alpha, W1, W2,
            b = 2, zeta = 0.5, theta = 0.5, type = "spGARCH",
            control = list())

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required. Default dim(W1)[1]

rho

spatial dependence parameter rho

lambda

spatial dependence parameter lambda

alpha

unconditional variance level alpha

W1

n times n spatial weight matrix (ARCH component, parameter rho)

W2

n times n spatial weight matrix (GARCH component, parameter lambda)

b

parameter b for logarithmic spatial GARCH (only needed if type = "log-spGARCH"). Default 2.

zeta

parameter zeta for exponential spatial GARCH (only needed if type = "e-spGARCH"). Default 0.5.

theta

parameter theta for exponential spatial GARCH (only needed if type = "e-spGARCH"). Default 0.5.

type

type of simulated spGARCH process (see details)

control

list of control arguments (see below)

Details

The function simulates n observations Y = (Y_1, ..., Y_n)' of a spatial GARCH process, i.e.,

\boldsymbol{Y} = diag(\boldsymbol{h})^{1/2} \boldsymbol{\varepsilon} \, ,

where \boldsymbol{\varepsilon} is a spatial White Noise process. The definition of \boldsymbol{h} depends on the chosen type. The following types are available.

  • type = "spGARCH" - simulates \boldsymbol{\varepsilon} from a truncated normal distribution on the interval [-a, a], such that \boldsymbol{h} > 0 with

    \boldsymbol{h} = \alpha + \rho \mathbf{W}_1 \boldsymbol{Y}^{(2)} + \lambda \mathbf{W}_2 \boldsymbol{h} \; \mbox{and} \; a = 1 / ||\rho^2\mathbf{W}_1^2||_1^{1/4}.

    Note that the normal distribution is not trunctated (a = \infty), if \mathbf{W}_1 is a strictly triangular matrix, as it is ensured that \boldsymbol{h} > \boldsymbol{0}. Generally, it is sufficient that if there exists a permutation such that \mathbf{W}_1 is strictly triangular. In this case, the process is called oriented spGARCH process.

  • type = "e-spGARCH" - simulates an exponential spARCH process (e-spGARCH), i.e.,

    \ln\boldsymbol{h} = \alpha + \rho \mathbf{W}_1 g(\boldsymbol{\varepsilon}) + \lambda \mathbf{W}_2 log(\boldsymbol{h}) \, .

    For the e-spGARCH process, the errors follow a standard normal distribution. The function g is given by

    g(\boldsymbol{\varepsilon}) = \Theta {\varepsilon} + \zeta (|\varepsilon| - E(|\varepsilon|)) \, .

  • type = "log-spGARCH" - simulates a logarithmic spARCH process (log-spGARCH), i.e.,

    \ln\boldsymbol{h} = \alpha + \rho \mathbf{W}_1 g(\boldsymbol{\varepsilon}) + \lambda \mathbf{W}_2 log(\boldsymbol{h}) \, .

    For the log-spGARCH process, the errors follow a standard normal distribution. The function g is given by

    g(\boldsymbol{\varepsilon}) = (\ln|\varepsilon(\boldsymbol{s}_1)|^{b}, \ldots, \ln|\varepsilon(\boldsymbol{s}_n)|^{b})' \, .

  • type = "complex-spGARCH" - allows for complex solutions of \boldsymbol{h}^{1/2} with

    \boldsymbol{h} = \alpha + \rho \mathbf{W}_1 \boldsymbol{Y}^{(2)} + \lambda \mathbf{W}_2 \boldsymbol{h} \, .

    The errors follow a standard normal distribution.

Value

The functions returns a vector \boldsymbol{y}.

Control Arguments

  • seed - positive integer to initialize the random number generator (RNG), default value is a random integer in [1, 10^6]

  • silent - if FALSE, current random seed is reported

  • triangular - if TRUE, \mathbf{W} is a triangular matrix and there are no checks to verify this assumption (default FALSE)

Author(s)

Philipp Otto philipp.otto@glasgow.ac.uk

References

Philipp Otto, Wolfgang Schmid (2019). Spatial GARCH Models - A Unified Approach. arXiv: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.1908.08320")}

Examples

require("spdep")

# 1st example (spatial GARCH)
##############

# parameters

rho    <- 0.5
lambda <- 0.3
alpha  <- 1
d      <- 5

nblist <- cell2nb(d, d, type = "rook") # lattice process with Rook's contiguity matrix
W_1    <- nb2mat(nblist)
W_2    <- W_1

# simulation

Y      <- sim.spGARCH(rho = rho, lambda = lambda, alpha = alpha,
                      W1 = W_1, W2 = W_2, type = "spGARCH")

# visualization

image(1:d, 1:d, array(Y, dim = c(d,d)), xlab = expression(s[1]), ylab = expression(s[2]))

# 2nd example (exponential spatial GARCH)
##############

# parameters

rho    <- 0.5
lambda <- 0.3
alpha  <- 1
zeta   <- 0.5
theta  <- 0.5
d      <- 5

nblist <- cell2nb(d, d, type = "rook") # lattice process with Rook's contiguity matrix
W_1    <- nb2mat(nblist)
W_2    <- W_1

# simulation

Y      <- sim.spGARCH(rho = rho, lambda = lambda, alpha = alpha,
                      W1 = W_1, W2 = W_2, zeta = zeta, theta = 0.5, type = "e-spGARCH")

# visualization

image(1:d, 1:d, array(Y, dim = c(d,d)), xlab = expression(s[1]), ylab = expression(s[2]))


spGARCH documentation built on April 11, 2025, 5:51 p.m.

Related to spGARCHsim in spGARCH...