Python for ARIMA model Monte Carlo? I'm interested in fitting a time series with an ARIMA model in Python and then performing a Monte Carlo simulation to generate many possible future paths assuming the time series follows that model.
I'm currently using statsmodels to fit the ARIMA models. However, the .simulate() method on the fitted model doesn't appear to be simulating paths which are meant to be continuations of my initial time series. I think it's just using the coefficients of the ARIMA model alone to generate the paths. These paths generated by .simulate() do not seem consistent with the confidence intervals generated by using .get_forecast() followed by .conf_int() on the fitted model, in that they seem to have immediately converged to the limiting distribution while the confidence intervals take time to converge in this way.
Is this functionality I'm desiring part of the statsmodels toolkit or any other Python module?

To simulate from the end of the series, pass the argument anchor='end' to the simulate method. For example:
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt

# Load data
y = sm.datasets.macrodata.load_pandas().data['cpi']
y.index = pd.period_range('1959Q1', '2009Q3', freq='Q')

# Create and fit the model
mod = sm.tsa.SARIMAX(y, order=(1, 1, 0), trend='c')
res = mod.fit()

# Simulate data starting at the end of the time series
sim = res.simulate(100, anchor='end', repetitions=100)

# Plot the data and simulations
fig, ax = plt.subplots(figsize=(15, 4))
y.plot(color='k', ax=ax)
sim.plot(ax=ax, color='C0', alpha=0.2, legend=False);

Gives:

