Learn R Programming

qardlr (version 1.0.1)

qardl_simulate: Monte Carlo Simulation for QARDL

Description

Performs Monte Carlo simulation to assess the finite-sample properties of QARDL estimators under specified data generating processes.

Usage

qardl_simulate(
  nobs = 200L,
  reps = 1000L,
  tau = c(0.25, 0.5, 0.75),
  p = 1L,
  q = 1L,
  k = 1L,
  beta_true = NULL,
  phi_true = NULL,
  gamma_true = NULL,
  sigma_u = 1,
  sigma_x = 1,
  seed = NULL,
  parallel = FALSE,
  ncores = NULL
)

Value

An object of class "qardl_mc" containing:

beta_sim

Array of simulated beta estimates (k x ntau x reps)

phi_sim

Array of simulated phi estimates (p x ntau x reps)

gamma_sim

Array of simulated gamma estimates (k x ntau x reps)

beta_true

True beta values

phi_true

True phi values

gamma_true

True gamma values

bias_beta

Bias in beta estimates

rmse_beta

RMSE of beta estimates

coverage_beta

Empirical coverage of 95% CI for beta

reps

Number of replications

nobs

Sample size

tau

Vector of quantiles

Arguments

nobs

Integer. Sample size for each simulation. Default is 200.

reps

Integer. Number of Monte Carlo replications. Default is 1000.

tau

Numeric vector of quantiles. Default is c(0.25, 0.50, 0.75).

p

Integer. AR lag order. Default is 1.

q

Integer. Distributed lag order. Default is 1.

k

Integer. Number of covariates. Default is 1.

beta_true

Numeric vector. True long-run parameters (length k). Default is rep(1, k).

phi_true

Numeric vector. True AR parameters (length p). Default is rep(0.5, p).

gamma_true

Numeric vector. True impact parameters (length k). Default is rep(0.3, k).

sigma_u

Numeric. Standard deviation of the error term. Default is 1.

sigma_x

Numeric. Standard deviation of covariate innovations. Default is 1.

seed

Integer. Random seed for reproducibility. Default is NULL.

parallel

Logical. Use parallel processing. Default is FALSE.

ncores

Integer. Number of cores for parallel processing. Default is parallel::detectCores() - 1.

Details

The data generating process is: $$y_t = \sum_{i=1}^{p} \phi_i y_{t-i} + \sum_{j=1}^{k} \gamma_j x_{jt} + u_t$$

where \(u_t \sim N(0, \sigma_u^2)\) and \(x_{jt}\) follows a random walk with innovations \(\sim N(0, \sigma_x^2)\).

References

Cho, J.S., Kim, T.-H., & Shin, Y. (2015). Quantile cointegration in the autoregressive distributed-lag modeling framework. Journal of Econometrics, 188(1), 281-300. tools:::Rd_expr_doi("10.1016/j.jeconom.2015.01.003")

See Also

qardl, print.qardl_mc

Examples

Run this code
# Small simulation for illustration
mc <- qardl_simulate(nobs = 100, reps = 50, tau = c(0.25, 0.50, 0.75),
                     p = 1, q = 1, k = 1, seed = 123)
print(mc)

Run the code above in your browser using DataLab