1
$\begingroup$

I read the example code here on how to simulate a time series:

Sampling with python statsmodels ARIMA package

I used myseries data and it simulated a series. However, the values are negative? I noticed when I change anchor from 'start' to 'end' it becomes positive again.

My intention is to simulate a time series with the same p,d,q as myseries. Not to project/forecast into the future. That's why I did start and not end.

Also how do I also incorporate the seasonal components P,D,Q from SARIMA not just p,d,q?

from statsmodels.tsa.api import SARIMAX
model = SARIMAX(myseries, order=(0, 1, 0), trend='c')
fitted = model.fit()

fcast = fitted.get_forecast(30)
fc = fcast.predicted_mean
se = fcast.se_mean
conf_99 = fcast.conf_int(alpha=0.01)

fitted.simulate(30, anchor='start')
$\endgroup$

1 Answer 1

0
$\begingroup$

ARIMA and SARIMA processes are not constrained in any way. See here for an introduction to ARIMA modeling. If you do not want negative values, then you should presumably use other models (or just truncate your simulations at zero, or put them through the exponential function, but then they won't be SARIMA any more.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.