Slackbot
12/07/2023, 8:10 AMJosé Morales
12/07/2023, 4:43 PM[m.model_['arma'][i] for i in [0, 5, 1]]
(p, d, q)Alexander März
12/11/2023, 11:12 AMJosé Morales
12/11/2023, 4:38 PMAlexander März
12/11/2023, 4:46 PMJosé Morales
12/11/2023, 4:53 PM_cs
attribute of each model, which we later add and subtract to the forecasts to get the intervals (code). You can get these conformity scores for the first model after calling fit with the following:
np.vstack([m._cs for m in sf.fitted_[:, 0]])
which is of shape (n_series * n_windows, horizon).
Is that what you were looking for?Alexander März
12/12/2023, 10:06 AMJosé Morales
12/12/2023, 3:57 PMimport numpy as np
from statsforecast import StatsForecast
from statsforecast.models import AutoARIMA
from statsforecast.utils import ConformalIntervals
from utilsforecast.data import generate_series
series = generate_series(2, freq='M', with_trend=True)
sf = StatsForecast(
models=[AutoARIMA(season_length=12)],
freq='M',
)
sf.fit(series, prediction_intervals=ConformalIntervals(h=5, n_windows=4))
orders = {uid: [m.model_['arma'][i] for i in [0, 5, 1, 2, 6, 3]] for uid, m in zip(sf.uids, sf.fitted_[:, 0])} # these are (p, d, q, P, D, Q)
conformity_scores = np.vstack([m._cs for m in sf.fitted_[:, 0]]) # Array of shape (n_series * n_windows, horizon) where each value is abs(y_hat - y) in each of the windows
Alexander März
12/13/2023, 11:17 AMJosé Morales
12/13/2023, 5:06 PMwe save the conformity scores in a^ That's how we do it for the intervals. If you're looking to compute quantiles on the errors you can just do it directly on the scoresattribute of each model, which we later add and subtract to the forecasts to get the intervals (code)_cs
Alexander März
12/15/2023, 10:16 AMsecarman18
01/10/2024, 11:10 PMmodel_['arma'][i] for i in [0, 5, 1]
. What's the correct ordering to get the seasonal order?José Morales
01/10/2024, 11:30 PMfrom statsforecast.arima import arima_string
print(arima_string(arima_model))
secarman18
01/11/2024, 1:28 AM