# Question: "Pseudo-random number generator" for shocks to equations in ARIMAResults.simulate

42 views

### Alina S.

Aug 24, 2022, 7:05:23 AM8/24/22
to pystatsmodels
Hi all,

I am currently writing my thesis on forecasting and using statsmodels. Right now, I am looking into the ARIMAResults.simulate function which is described here:

https://www.statsmodels.org/devel/generated/statsmodels.tsa.arima.model.ARIMAResults.simulate.html#statsmodels.tsa.arima.model.ARIMAResults.simulate

I would like to understand how this function works exactly. How does the "pseudo-random number generator" for the measurement and state shocks work? Do the shocks scale with the amplitude of my data? Could you direct me to the source? I wasn't able to find it (maybe a rookie mistake).

Best,
Alina

Aug 27, 2022, 12:08:15 AM8/27/22
Hi Alina,

State space models (of which ARIMA models are a special case) have 3 fundamental sources of randomness: (1) the initial state vector, (2) the error terms in the transition equation, and (3) the error terms in the measurement equation.  All of these are assumed to be independent and multivariate normal.

So, the first step is to simulate these from the respective multivariate normal distributions using, for example, numpy.random.multivariate_normal. With these terms available, the state vector can be simulated by applying the transition equation, and the observed vector can be simulated by applying the measurement equation.

Best,

--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.

### Alina S.

Sep 28, 2022, 5:34:04 AM9/28/22
to pystatsmodels