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

Skip to first unread message

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:

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).

Thank you in advance!

Chad Fulton

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.


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
To view this discussion on the web visit

Alina S.

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

thank you so much for your reply. 
I have just one more question about this: 
If I have, let's say, an exponential smoothing or ARIMA model and I were to simulate a few multi-step trajectories for my time series,
can I expect the different forecasts to "fan out" for a large forecast horizon because of increasing uncertainty and error propagation?
Or should the difference between the forecasts stay more or less the same over time?
I'm still pretty new to state-space models and not quite sure I understand this.

Thanks again,
Reply all
Reply to author
0 new messages