How to use R language to simulate the data of time series model.

as mentioned, I must simulate the integer attribute GARCH (INGARCH) model in the R environment without using the R packet (package). Unlike the original GARCH, this model is not a normal distribution (normal distribution) but a Poisson split (poisson distribution).

. The

model is as follows.
INGARCH (1pm 1)

Xerot ~ Poisson (lamb_t)

lamb_t = alpha_0 + alpha_1 (X_t-1) + beta_1 (lamb_t-1)

the program I wrote could not successfully simulate the data of this pattern.

set.seed
a0 <-2
A1 <-0.4
b1 <-1
mu <-5
n <-1000
w <-rpois
X <-lamb <-rep (0,n)

for (i in 2 n) {

X [I] <-w [I]
lamb [I] <-a0 + A1 (X [I-1]) + b1 Lamb [I-1]
}

this question has perplexed me for a long time. I would like to thank you for your advice.


I suggest you take a look at Rstan's example of Garch, which can be reused directly

https://github.com/stan-dev/e.


your lamb and w do not reflect any relationship in the program

Menu