midas_lstr_sim: Simulate LSTR MIDAS regression model

Description Usage Arguments Value Examples

View source: R/simulate.R

Description

Simulate LSTR MIDAS regression model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
midas_lstr_sim(
  n,
  m,
  theta,
  intercept,
  plstr,
  ar.x,
  ar.y,
  rand.gen = rnorm,
  n.start = NA,
  ...
)

Arguments

n

number of observations to simulate.

m

integer, frequency ratio

theta

vector, restriction coefficients for high frequency variable

intercept

vector of length 1, intercept for the model.

plstr

vector of length 4, slope for the LSTR term and LSTR parameters

ar.x

vector, AR parameters for simulating high frequency variable

ar.y

vector, AR parameters for AR part of the model

rand.gen

function, a function for generating the regression innovations, default is rnorm

n.start

integer, length of a 'burn-in' period. If NA, the default, a reasonable value is computed.

...

additional parameters to rand.gen

Value

a list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
nnbeta <- function(p, k) nbeta(c(1,p),k)

dgp <- midas_lstr_sim(250, m = 12, theta = nnbeta(c(2, 4), 24), 
                           intercept = c(1), plstr = c(1.5, 1, log(1), 1), 
                           ar.x = 0.9, ar.y = 0.5, n.start = 100)
z <- cbind(1, mls(dgp$y, 1:2, 1))
colnames(z) <- c("Intercept", "y1", "y2")
X <- mls(dgp$x, 0:23, 12)

lstr_mod <- midas_lstr_plain(dgp$y, X, z, nnbeta, 
                          start_lstr = c(1.5, 1, 1, 1), 
                          start_x = c(2, 4), start_z=c(1, 0.5, 0)) 

coef(lstr_mod)

midasr documentation built on Feb. 23, 2021, 5:11 p.m.