顧客ごとに統計モデルを当てはめる

読了まで約44 分分、10 節 節の 6 例 例。

第2026.11.11版 2026年11月20日時点で例が通過 41 例中 41 例が合格 変更点

AIによる翻訳。英語版は人による検証済みである。 当社の書籍の作り方

英語版の書籍(版2026.11.11)から翻訳した。 原文を読む

本章では、同一のバックテストに対して、顧客ごとに AutoETS と固定の季節 ARIMA を当てはめ、両者を季節ナイーブと比較して採点する。また、開始が遅い顧客については、最初の測定値から予測を始める方法を学ぶ。本章は、これより前の二つの章で扱ったベースラインとバックテストを前提とする。

供給事業者の各顧客には、それぞれ翌日予測が必要である。しかし、第2章の季節ナイーブは、どの顧客にも同じ答え、すなわち前日の同じ時刻の値を返す。この規則は、顧客の水準もトレンドも推定しないが、顧客ごとにその二つは異なる。そこで本章では、顧客ごとに統計モデルを当てはめ、その追加の手間に見合う効果があるかどうかを検討する。

なぜ次に統計モデルを扱うのか

最終変更:版2026.11.11

第2章で基準を定めた。季節ナイーブは各時刻を前日の同じ時刻として予測する。また、スケール化誤差であるMASEにより、負荷の異なるクライアントを同じ尺度で比較できる。第3章では、この予測を多数のカットオフにわたってバックテストした。カットオフとは予測を行う時点であり、履歴はそこで終わる。ウィンドウとは、1つのカットオフとその後の24時間をあわせたものであり、この24時間が予測ホライズンである。各ウィンドウの履歴はカットオフで終わるため、ある時刻の予測にその日自身のデータが使われることはない。

統計モデルは、この手順に新たな要素を加える。時系列には状態がある。時系列のレベルとは典型的な読み取り値であり、トレンドとはレベルの緩やかな推移であり、季節性とは負荷の1日の中での形である。これらのいずれでも説明できないものが誤差である。統計モデルは、時系列の状態を構成するこれらの各部分の推定値を保持し、読み取り値が届くたびに推定値を更新し、それらをホライズンにわたって先へ投影する。季節ナイーブにはこのような状態がない。前日をそのまま写すだけなので、クライアントのレベルを捉える精度は前日の値の精度にとどまる。

クライアント別モデルとは、クライアントごとに、そのクライアントの履歴だけを用いて1つずつ当てはめるモデルである。したがって、コストはクライアント数とウィンドウ数の積に等しい回数の当てはめとなる。この章で用いるサブセットSUBSET8には8つのクライアントがある。本書の標準の3つのカットオフ、すなわち2014年12月29日から12月31日までを用いると、モデルごとに24回の当てはめになる。この3日は、ホールドアウト週の最後の3日であり、以降のすべての章が報告するウィンドウである。コードは当てはめを1つのワーカーで実行する(n_jobs=1)ため、実行のたびに出力が同一になる。この章のすべてのモデルには、同じ3つのカットオフと、各カットオフ以前の同じ1,344時間の履歴を与える。カットオフはホールドアウト週に含まれ、サブセットには後の節で必要となる、開始が遅い系列が1つ含まれている。

実践ルール: クライアントごとにモデルを当てはめるのは、基準とバックテストが整ってからにする。ウィンドウ数を決める前に、当てはめの回数を数える。回数は、クライアント数にウィンドウ数を掛けたものであり、モデルを毎日再当てはめするならさらにその回数を掛ける。比較するすべてのモデルで、同じカットオフと同じ履歴を用いる。そうしなければ、比較が測るのはモデルの差ではなくウィンドウの差になる。

この部分はまだ翻訳されていないため、英語で表示している。

Fit exponential smoothing

最終変更:版2026.11.11

Seasonal naive keeps only yesterday, so the first candidate keeps a level instead. Exponential smoothing moves its level toward each new reading. The simplest form updates the level as level_t = alpha * y_t + (1 - alpha) * level_(t-1). The constant alpha, between 0 and 1, sets how fast the level follows the data. The forecast for every hour of the horizon is the last level. Recent readings count for more than older ones, and the weights fall off with age.

ETS, for error, trend and season, extends the simplest form of exponential smoothing. Each part is chosen from a short list. The trend can be none, additive or damped. The error can be additive or multiplicative, and the season can be none, additive or multiplicative. A name such as ETS(A,N,A) reads in that order: additive error, no trend, additive season. ETS(M,Ad,M) has a multiplicative error, a damped trend and a multiplicative season.

AutoETS chooses the ETS form for you. Its default criterion is AICc, the corrected Akaike information criterion, which charges a model for each parameter and corrects for small samples, as the AutoETS docstring in statsforecast 2.1.1 (statsforecast/models.py) says. Two of its defaults matter for hourly demand. The season length defaults to 1, which means no season at all, and the model gives no warning when you leave it that way. The model argument defaults to "ZZZ", which lets the model choose all three parts. For hourly demand with a daily pattern, the call sets season_length=24.

Which form does AutoETS pick for each client, and do its forecasts beat seasonal naive? The lines it prints answer both.

autoets-subset-backtest.py Python 3.13.16 · numpy 2.5.5 · pandas 2.3.3 · statsforecast 2.1.1 · utilsforecast 0.2.17 合格
"""Backtest AutoETS and seasonal naive for the eight clients of SUBSET8 over the three standard cutoffs, and score both.The fits lines count the forms AutoETS chose, and the MASE and coverage lines are the scores the comparison table quotes."""from collections import Counter, defaultdictimport numpy as npimport pandas as pdfrom statsforecast import StatsForecastfrom statsforecast.models import AutoETS, SeasonalNaivefrom lib.scoring import book_scalefrom lib.electricity import loadfrom lib.quirks import filled_history, mask_clock_changesfrom lib.settings import EVAL_CUTOFFS, HORIZON, SEED, SUBSET8, showfrom lib.subsets import score_clients, show_client_linesnp.random.seed(SEED)                                        # the seed from lib/settings.py, set before any fitmasked = mask_clock_changes(load(SUBSET8))                  # clock-change hours become NaN, so they are never scored; filled_history fills them from their neighbours before each fitscale = book_scale(load(SUBSET8), EVAL_CUTOFFS[0])        # MASE scale: rows before the first cutoff, from each client's first reading# season_length=24 for hourly demand; the default of 1 would mean no season at all. n_jobs=1 keeps the output the same from run to run.sf = StatsForecast(models=[AutoETS(season_length=24), SeasonalNaive(season_length=24)], freq="h", n_jobs=1)parts, forms, by_client = [], Counter(), defaultdict(list)for c in pd.to_datetime(EVAL_CUTOFFS):    sf.fit(df=filled_history(masked, c)[["unique_id", "ds", "y"]])   # the eight weeks before c, clock hours filled from them    part = sf.predict(h=HORIZON, level=[95])                          # level=[95] asks for the 95% interval the coverage line scores    # the first forecast hour must be the cutoff itself, or the window is misaligned    if part["ds"].min() != c:        raise ValueError(f"forecast for {c:%Y-%m-%d} does not start at the cutoff")    parts.append(part)    for i, uid in enumerate(sf.uids):        form = sf.fitted_[i, 0].model_["method"]                    # model 0 is AutoETS; its method name is the form, such as ETS(A,N,A)        forms[form] += 1        by_client[uid].append(form)forecasts = pd.concat(parts, ignore_index=True)summary, per_client = score_clients(forecasts, masked, ["AutoETS", "SeasonalNaive"], scale, interval_model="AutoETS")show("horizon hours", HORIZON)show("windows", len(parts))for form, n in sorted(forms.items()):    show(f"fits that chose {form}", n)# the form reads ETS(error,trend,season): a multiplicative part is an M in any of the three slotsshow("fits with a multiplicative part", sum(n for form, n in forms.items() if "M" in form[4:-1].split(",")))for label, value in summary.items():    show(label, value, digits=3 if label.startswith("coverage") else 2)   # coverage is a share, to three decimals; the rest are kWh or ratiosshow("clients where AutoETS has lower MASE", int((per_client["AutoETS"] < per_client["SeasonalNaive"]).sum()))show_client_lines(by_client, per_client, ["AutoETS", "SeasonalNaive"])
出力python autoets-subset-backtest.py
horizon hours: 24
windows: 3
fits that chose ETS(A,Ad,A): 1
fits that chose ETS(A,N,A): 8
fits that chose ETS(A,N,N): 9
fits that chose ETS(M,Ad,M): 2
fits that chose ETS(M,N,A): 3
fits that chose ETS(M,N,M): 1
fits with a multiplicative part: 6
clients: 8
scored hours per client: 72
MAE AutoETS: 362.11
RMSE AutoETS: 537.20
MASE AutoETS: 1.30
MAE SeasonalNaive: 423.68
RMSE SeasonalNaive: 591.25
MASE SeasonalNaive: 1.16
coverage 95 AutoETS: 0.910
clients where AutoETS has lower MASE: 4
forms MT_014, one per cutoff: ETS(A,N,N) ETS(A,N,N) ETS(A,N,N)
MASE MT_014 AutoETS: 1.18
MASE MT_014 SeasonalNaive: 0.97
forms MT_064, one per cutoff: ETS(A,N,N) ETS(A,N,N) ETS(A,N,N)
MASE MT_064 AutoETS: 2.32
MASE MT_064 SeasonalNaive: 1.08
forms MT_115, one per cutoff: ETS(M,N,A) ETS(M,N,A) ETS(M,N,A)
MASE MT_115 AutoETS: 0.95
MASE MT_115 SeasonalNaive: 1.31
forms MT_166, one per cutoff: ETS(A,Ad,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_166 AutoETS: 1.18
MASE MT_166 SeasonalNaive: 1.29
forms MT_217, one per cutoff: ETS(M,N,M) ETS(M,Ad,M) ETS(M,Ad,M)
MASE MT_217 AutoETS: 1.76
MASE MT_217 SeasonalNaive: 1.25
forms MT_268, one per cutoff: ETS(A,N,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_268 AutoETS: 0.94
MASE MT_268 SeasonalNaive: 0.89
forms MT_319, one per cutoff: ETS(A,N,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_319 AutoETS: 1.11
MASE MT_319 SeasonalNaive: 1.26
forms MT_370, one per cutoff: ETS(A,N,N) ETS(A,N,N) ETS(A,N,N)
MASE MT_370 AutoETS: 0.96
MASE MT_370 SeasonalNaive: 1.25

The chosen form changes from client to client, and for some clients from one cutoff to the next. Across the 24 fits, AutoETS chose ETS(A,N,N), with no season, for 9 of them, and ETS(A,N,A), with an additive season, for 8. ETS(A,Ad,A), a damped trend with an additive season, came up in 1 of the fits. The other fits used a multiplicative part, in the error, the season or both. The lines under the totals give each client's three forms. Three clients, MT_014, MT_064 and MT_370, take the flat form at all three cutoffs. MT_014 is the lead client, the one Chapter 1 met.

A flat form winning looks odd when the seasonal form contains it. ETS(A,N,N) is ETS(A,N,A) with the seasonal part switched off, so the best seasonal fit cannot have a lower likelihood than the flat fit on the same history. Fitting both forms on each of the 24 windows shows whether that happens.

flat-form-check.py Python 3.13.16 · numpy 2.5.5 · pandas 2.3.3 · statsforecast 2.1.1 · utilsforecast 0.2.17 合格
"""For each subset window, fit the flat form ETS(A,N,N) and the additive-season form ETS(A,N,A) on the same history, and count where the seasonal fit has the lower likelihood.The two counts printed last are the ones the prose quotes."""import numpy as npimport pandas as pdfrom statsforecast import StatsForecastfrom statsforecast.models import AutoETSfrom lib.electricity import loadfrom lib.quirks import filled_history, mask_clock_changesfrom lib.settings import EVAL_CUTOFFS, SEED, SUBSET8, shownp.random.seed(SEED)                                        # the seed from lib/settings.py, set before any fitmasked = mask_clock_changes(load(SUBSET8))windows = seasonal_lower_loglik = seasonal_higher_aicc = 0for c in pd.to_datetime(EVAL_CUTOFFS):    hist = filled_history(masked, c)[["unique_id", "ds", "y"]]    # ANN is additive error, no trend, no season: the flat form. ANA is the same with an additive season.    sf = StatsForecast(models=[AutoETS(model="ANN", season_length=24, alias="flat"),                               AutoETS(model="ANA", season_length=24, alias="seasonal")], freq="h", n_jobs=1)    sf.fit(df=hist)    for i in range(len(sf.uids)):        flat = sf.fitted_[i, 0].model_                          # models are fitted in the order listed: 0 is the flat fit        seasonal = sf.fitted_[i, 1].model_                      # 1 is the seasonal fit        windows += 1        # ANA contains ANN, so a lower seasonal likelihood points to a fit that stopped short of its best        seasonal_lower_loglik += int(seasonal["loglik"] < flat["loglik"])        # AICc charges each parameter, so this count can differ from the likelihood count        seasonal_higher_aicc += int(seasonal["aicc"] > flat["aicc"])show("windows", windows)show("seasonal fit has the lower log-likelihood", seasonal_lower_loglik)show("seasonal fit has the higher AICc", seasonal_higher_aicc)
出力python flat-form-check.py
windows: 24
seasonal fit has the lower log-likelihood: 9
seasonal fit has the higher AICc: 9

The seasonal fit loses on likelihood, not only on AICc. Its log-likelihood is lower in 9 of the 24 windows, and its AICc is higher in 9. Those are the same nine windows in which the default run chose the flat form. AICc charges a model for each parameter, and the seasonal form has 24 more. That charge adds to the gap; it does not cause it, because the seasonal fit's likelihood is already lower before any charge. The seasonal fit most likely stopped short of its best value, and the flat form won by default. The book does not chase the optimiser; it tests the choice with a forced season.

Chapter 1 forced an additive season on the lead client, with model="ZZA", and seasonal naive still had the lower error there. Does that hold across all eight? The forced run covers the same eight clients, beside the default.

autoets-forced-season-backtest.py Python 3.13.16 · numpy 2.5.5 · pandas 2.3.3 · statsforecast 2.1.1 · utilsforecast 0.2.17 合格
"""Backtest AutoETS with the season forced to additive (model ZZA) and seasonal naive, for the eight clients of SUBSET8 over the three standard cutoffs.The ZZA lines are the forced-season scores that the comparison table and the forced-season paragraph quote."""from collections import Counter, defaultdictimport numpy as npimport pandas as pdfrom statsforecast import StatsForecastfrom statsforecast.models import AutoETS, SeasonalNaivefrom lib.scoring import book_scalefrom lib.electricity import loadfrom lib.quirks import filled_history, mask_clock_changesfrom lib.settings import EVAL_CUTOFFS, HORIZON, SEED, SUBSET8, showfrom lib.subsets import score_clients, show_client_linesnp.random.seed(SEED)                                        # the seed from lib/settings.py, set before any fitmasked = mask_clock_changes(load(SUBSET8))                  # clock-change hours become NaN, so they are never scored; filled_history fills them from their neighbours before each fitscale = book_scale(load(SUBSET8), EVAL_CUTOFFS[0])        # MASE scale: rows before the first cutoff, from each client's first reading# ZZA: Z lets the model choose the error and the trend, A forces an additive season. alias names the output columns.sf = StatsForecast(models=[AutoETS(model="ZZA", season_length=24, alias="ZZA"), SeasonalNaive(season_length=24)],                   freq="h", n_jobs=1)parts, forms, by_client = [], Counter(), defaultdict(list)for c in pd.to_datetime(EVAL_CUTOFFS):    sf.fit(df=filled_history(masked, c)[["unique_id", "ds", "y"]])   # the eight weeks before c, clock hours filled from them    part = sf.predict(h=HORIZON, level=[95])                          # level=[95] asks for the 95% interval the coverage line scores    # the first forecast hour must be the cutoff itself, or the window is misaligned    if part["ds"].min() != c:        raise ValueError(f"forecast for {c:%Y-%m-%d} does not start at the cutoff")    parts.append(part)    for i, uid in enumerate(sf.uids):        form = sf.fitted_[i, 0].model_["method"]                    # model 0 is the forced AutoETS; its method name is the form        forms[form] += 1        by_client[uid].append(form)forecasts = pd.concat(parts, ignore_index=True)summary, per_client = score_clients(forecasts, masked, ["ZZA", "SeasonalNaive"], scale, interval_model="ZZA")show("horizon hours", HORIZON)show("windows", len(parts))for form, n in sorted(forms.items()):    show(f"fits that chose {form}", n)for label, value in summary.items():    show(label, value, digits=3 if label.startswith("coverage") else 2)show("clients where ZZA has lower MASE", int((per_client["ZZA"] < per_client["SeasonalNaive"]).sum()))show_client_lines(by_client, per_client, ["ZZA", "SeasonalNaive"])
出力python autoets-forced-season-backtest.py
horizon hours: 24
windows: 3
fits that chose ETS(A,Ad,A): 1
fits that chose ETS(A,N,A): 17
fits that chose ETS(M,N,A): 6
clients: 8
scored hours per client: 72
MAE ZZA: 365.24
RMSE ZZA: 553.11
MASE ZZA: 1.17
MAE SeasonalNaive: 423.68
RMSE SeasonalNaive: 591.25
MASE SeasonalNaive: 1.16
coverage 95 ZZA: 0.925
clients where ZZA has lower MASE: 4
forms MT_014, one per cutoff: ETS(A,N,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_014 ZZA: 1.08
MASE MT_014 SeasonalNaive: 0.97
forms MT_064, one per cutoff: ETS(A,N,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_064 ZZA: 1.27
MASE MT_064 SeasonalNaive: 1.08
forms MT_115, one per cutoff: ETS(M,N,A) ETS(M,N,A) ETS(M,N,A)
MASE MT_115 ZZA: 0.95
MASE MT_115 SeasonalNaive: 1.31
forms MT_166, one per cutoff: ETS(A,Ad,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_166 ZZA: 1.18
MASE MT_166 SeasonalNaive: 1.29
forms MT_217, one per cutoff: ETS(M,N,A) ETS(M,N,A) ETS(M,N,A)
MASE MT_217 ZZA: 1.78
MASE MT_217 SeasonalNaive: 1.25
forms MT_268, one per cutoff: ETS(A,N,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_268 ZZA: 0.94
MASE MT_268 SeasonalNaive: 0.89
forms MT_319, one per cutoff: ETS(A,N,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_319 ZZA: 1.11
MASE MT_319 SeasonalNaive: 1.26
forms MT_370, one per cutoff: ETS(A,N,A) ETS(A,N,A) ETS(A,N,A)
MASE MT_370 ZZA: 1.05
MASE MT_370 SeasonalNaive: 1.25

On mean MASE, forcing the season brings AutoETS within a hair of seasonal naive, though not below it: 1.17 against 1.30 for the default and 1.16 for seasonal naive.

The forced season helps some clients and hurts others. It lowers the lead client's MASE, from 1.18 to 1.08, and MT_064's too, but it raises MT_370's, from 0.96 to 1.05. So forcing the season is a change to test on each client, not a fix to apply to all of them.

Working rule: Start with AutoETS for hourly demand with season_length=24, and print the chosen forms in every backtest. When a client takes a flat form, check that its seasonal form is not failing. If the seasonal fit has the lower likelihood, force the season with model="ZZA", and score both forms on earlier windows before you keep either: cutoffs before the held-out week that the report does not score, such as the four ordinary days in late November and early December 2014, which Chapter 5 sets aside for choices. The standard cutoffs show the comparison here, but they do not decide it. When a forecast gets worse, look first for a form that changed between cutoffs.

固定の季節 ARIMA を当てはめる

最終変更:版2026.11.5

2番目の候補は、季節ナイーブ法が残した部分をモデル化する。それが何を加えるかを確かめる検証が、第3章のバックテストである。ARIMA モデルは、差分をとった後の次の観測値を、過去の観測値と過去の誤差の重み付き和として表す。差分とは、観測値から 1 季節前の観測値を引くことである。このモデルは ARIMA(p,d,q)(P,D,Q)[m] と書く。非季節部分には、p 個の自己回帰項、d 回の差分、q 個の移動平均項がある。季節部分にも同じ 3 つがあり、そのラグは季節の長さ m の倍数となる。

本書のモデルは ARIMA(1,0,0)(1,1,0)[24] である。自己回帰項が 1 つ、通常の差分はなし、移動平均項はなし、ラグ 24 の季節差分が 1 回、ラグ 24 の季節自己回帰項が 1 つである。B を 1 ステップ戻す演算子とし、B y_t を y_(t-1) とすると、このモデルは次のように書ける。

(1 - phi1 B)(1 - Phi1 B^24)(1 - B^24) y_t = e_t

(1 - B^24) という項は、各観測値を、前日の同じ時刻からの変化量に置き換える。ラグ 24 は、1 時間ごとの需要に対するこのモデルの要点である。各時刻を前日の同じ時刻と比較する。これは季節ナイーブ法が行う比較と同じであり、自己回帰項はその比較が残した部分をモデル化する。季節差分は水準を取り除くので、このモデルには平均項がない。statsforecast の ARIMA は、差分をとった系列では既定で平均を除く(statsforecast/models.py、ARIMA の docstring)。

次数は探索せずに固定する。その理由は自動探索の節で説明する。次数をバックテストに入れる前に、最初の標準的なカットオフより前の、主要クライアントの履歴に対して statsmodels 0.15.0 で一度当てはめ、当てはめたパラメータの名前を表示する。これにより、書き下した項がモデルに含まれているかどうかが分かる。

arima-summary-look.py Python 3.13.16 · numpy 2.5.5 · pandas 2.3.3 · statsmodels 0.15.0 · utilsforecast 0.2.17 合格
"""Fit the fixed seasonal ARIMA with statsmodels on the lead client's history before the first standard cutoff, and print its parameter names. The parameter lines are what the prose reads."""import pandas as pdfrom statsmodels.tsa.statespace.sarimax import SARIMAXfrom lib.backtest import history_beforefrom lib.electricity import loadfrom lib.settings import EVAL_CUTOFFS, LEAD, showhist = history_before(load([LEAD]), pd.Timestamp(EVAL_CUTOFFS[0]))y = pd.Series(hist["y"].to_numpy(), index=pd.DatetimeIndex(hist["ds"], freq="h"))res = SARIMAX(y, order=(1, 0, 0), seasonal_order=(1, 1, 0, 24)).fit(disp=False)show("hours of history", len(y))for name in res.params.index:    show("parameter", name)
出力python arima-summary-look.py
hours of history: 1344
parameter: ar.L1
parameter: ar.S.L24
parameter: sigma2

一覧には ar.L1、ar.S.L24、sigma2 の 3 つの名前がある。1 つ目は自己回帰項であり、前日の同じ時刻からの変化量のうち、どれだけが次の時刻に持ち越されるかを表す。2 つ目はラグ 24 の季節項であり、ある時刻における 1 日の変化のうち、どれだけが翌日の同じ時刻に持ち越されるかを表す。3 つ目は誤差の分散である。一覧に切片はない。statsmodels が季節 ARIMA に切片を加えるのは trend を設定したときだけである。そのため、系列に差分をとったかどうかにかかわらず、一覧には切片が現れない(trend を設定していなければ)。いずれにせよ、季節差分をとったモデルに切片は不要である。statsmodels の完全な summary には各値も出力される。本書ではそれらを引用しない。値はウィンドウやライブラリのバージョンによって変わるので、読者にとっては、数値そのものより各項の意味のほうが必要だからである。

この固定モデルは、AutoETS と季節ナイーブ法に並ぶもう 1 つの候補としてバックテストに加わる。そのスコアは、後述の比較の節に示す。

実践ルール: 探索が遅すぎて各カットオフで実行できないときは、次数を固定し、呼び出しの中に書く。summary を一度表示し、そこに挙がる項が意図したものであることを確かめる。固定した次数は、ほかのモデルと同様に、カットオフごとに再当てはめする。次数は固定のままだが、係数は固定ではない。

同じカットオフでモデルを比較する

最終変更:版2026.11.11

4つの予測が、同じ8週間の履歴をもとに、同じ8クライアントについて、同じ3つのカットオフで同じ24時間を対象としている。季節ナイーブ、AutoETS、季節を固定したAutoETS、ARIMAの4つである。各バックテストは個別のスクリプトであり、いずれも、本書が2 CPUでの1つの例に許す45秒の枠内に十分に収まって完了する。

まだ欠けているスコアが1つある。固定したARIMAのスコアを、同じウィンドウと同じ指標で求める必要がある。

arima-subset-backtest.py Python 3.13.16 · numpy 2.5.5 · pandas 2.3.3 · statsforecast 2.1.1 · utilsforecast 0.2.17 合格
"""Backtest the fixed seasonal ARIMA(1,0,0)(1,1,0)[24] and seasonal naive for the eight clients of SUBSET8 over the three standard cutoffs.The MASE gap and the count of clients where ARIMA wins, printed last, are the figures the comparison section quotes."""import numpy as npimport pandas as pdfrom statsforecast import StatsForecastfrom statsforecast.models import ARIMA, SeasonalNaivefrom lib.scoring import book_scalefrom lib.electricity import loadfrom lib.quirks import filled_history, mask_clock_changesfrom lib.settings import EVAL_CUTOFFS, HORIZON, SEED, SUBSET8, showfrom lib.subsets import score_clientsnp.random.seed(SEED)                                        # the seed from lib/settings.py, set before any fitmasked = mask_clock_changes(load(SUBSET8))                  # clock-change hours become NaN, so they are never scored; filled_history fills them from their neighbours before each fitscale = book_scale(load(SUBSET8), EVAL_CUTOFFS[0])        # MASE scale: rows before the first cutoff, from each client's first reading# The order is fixed, not searched: one AR term, one seasonal difference and one seasonal AR term, all at lag 24.# n_jobs=1 keeps the output the same from run to run.sf = StatsForecast(models=[ARIMA(order=(1, 0, 0), season_length=24, seasonal_order=(1, 1, 0)),                           SeasonalNaive(season_length=24)], freq="h", n_jobs=1)parts = []for c in pd.to_datetime(EVAL_CUTOFFS):    sf.fit(df=filled_history(masked, c)[["unique_id", "ds", "y"]])   # the eight weeks before c, clock hours filled from them    part = sf.predict(h=HORIZON)    # the first forecast hour must be the cutoff itself, or the window is misaligned    if part["ds"].min() != c:        raise ValueError(f"forecast for {c:%Y-%m-%d} does not start at the cutoff")    parts.append(part)forecasts = pd.concat(parts, ignore_index=True)summary, per_client = score_clients(forecasts, masked, ["ARIMA", "SeasonalNaive"], scale)show("horizon hours", HORIZON)show("windows", len(parts))for label, value in summary.items():    show(label, value)show("MASE gap, SeasonalNaive minus ARIMA", summary["MASE SeasonalNaive"] - summary["MASE ARIMA"])show("clients where ARIMA has lower MASE", int((per_client["ARIMA"] < per_client["SeasonalNaive"]).sum()))
出力python arima-subset-backtest.py
horizon hours: 24
windows: 3
clients: 8
scored hours per client: 72
MAE ARIMA: 386.13
RMSE ARIMA: 576.30
MASE ARIMA: 1.09
MAE SeasonalNaive: 423.68
RMSE SeasonalNaive: 591.25
MASE SeasonalNaive: 1.16
MASE gap, SeasonalNaive minus ARIMA: 0.07
clients where ARIMA has lower MASE: 5

MAEの単位はキロワット時であり、RMSE(二乗平均平方根誤差)は大きな外れをより強く罰する。どちらもクライアントごとに評価対象の72時間で計算し、その後8クライアントで平均するため、各クライアントは1回ずつ数えられる。MASEは、各クライアントのMAEを、そのクライアント自身の履歴で季節ナイーブが出すMAEで割ったものである。この履歴は、各クライアントの最初の観測値から2014年12月29日より前までのすべての観測値で、時計の切り替えにあたる時間は除く。その後、クライアントについて平均する。MASEが1であれば、そのモデルは季節ナイーブが自身の過去に対して出した精度と同等であることを意味する。AutoETSのカバレッジは、評価対象の時間のうち、95%予測区間に収まった時間の割合である。予測区間とは、モデルが各時間について示す範囲のことである。

モデル MAE (kWh) RMSE (kWh) MASE MASEで季節ナイーブに勝ったクライアント数
SeasonalNaive 423.68 591.25 1.16 該当なし
AutoETS 362.11 537.20 1.30 4
AutoETS、季節固定 (ZZA) 365.24 553.11 1.17 4
ARIMA 386.13 576.30 1.09 5

最後の列は、スコアではなく、8クライアントのうちの件数として読む。AutoETSの区間は評価対象の時間の0.910を覆い、季節固定の区間は0.925を覆っている。名目上の割合は0.95であるから、この標本では区間がやや狭いことになる。カバレッジが検査するのは区間であり、点予測ではない。カバレッジが低すぎる区間は狭すぎ、その区間に合わせて購入を計画する担当者は、ラベルが示すより頻繁に不足に直面する。第8章で区間に戻り、過去のウィンドウで区間を較正する方法を示す。

AutoETSについては、2つの指標の評価が食い違う。平均MAEは4つの行のうちで最も低く、平均MASEは最も高い。キロワット時で測るMAEは、負荷の大きいクライアントの誤差が大きくなるため、そうしたクライアントにより大きな重みを与える。MASEは各クライアントの誤差をそのクライアント自身の履歴で正規化するため、どのクライアントもおおむね同じ重みで数えられる。AutoETSの実行でのクライアントごとの出力行から、MASEの由来が分かる。MT_064のMASEは2.32であり、季節ナイーブの1.08に対して高い。このクライアントは、形状が平坦なクライアントの1つである。MT_217のMASEは1.76で、季節ナイーブの1.25に対する値であり、その形状はカットオフごとに変わる。順位は指標に依存するため、指標の選択も意思決定の一部である。

第3章で説明したとおり、3つのウィンドウは小さな標本である。AutoETSが季節ナイーブに勝つのは8クライアントのうち4であり、ARIMAは5である。ARIMAは両方の指標で季節ナイーブより良く、MASEでは0.07の差がある。3つのウィンドウでは、これほど小さな差に決着をつけることはできない。

実践ルール: すべての候補を、同じカットオフ、同じ履歴、同じスケールで採点し、MAEとMASEを並べて報告する。両者が食い違うときは、意思決定にどちらが必要かを明示する。MASEの差がおよそ0.1未満の2つのモデルから選ぶ前には、ウィンドウを増やすことを勧める。この閾値はこの標本に基づく判断であり、測定値ではない。

遅れて始まるクライアント

最終変更:版2026.11.5

サブセットには、開始が遅いクライアントが1つある。MT_115の最初の非ゼロの読み取り値は、2014年1月14日の00:00である。それ以前、メーターはゼロを報告しており、データはその時間帯にbefore_first_readingというフラグを付けている。これらのゼロは使用量が少ないことを意味しない。モデルがこれを読むと、クライアントが持たない水準を学習してしまう。遅れて始まるクライアントとは、最初の読み取り値が、そのモデルが読む履歴の内側にあるクライアントである。対処は開始規則である。系列は最初の読み取り値から始める。これは供給事業者の意思決定にとって重要である。水準が低く引き下げられると、そのクライアント向けの購入量が少なすぎることになる。これは供給事業者が犯す2種類の誤りのうち、費用のかさむ方である。

12月のカットオフでは、各カットオフ前の8週間はすべて読み取り値であるため、この節では2月のカットオフを用いる。2014年2月1日、2014年2月15日、2014年2月28日である。これらの8週間の履歴は、最初の読み取り値より前にまでさかのぼるため、この事例が含まれている。第6章では、同じ規則を30クライアントすべてに適用する。

ゼロから始まる履歴

最終変更:版2026.11.5

まず、2月の各カットオフ前の8週間を、ゼロを含めた生の履歴として扱う。この履歴に占めるゼロの時間の割合は、2014年2月1日で68%、2014年2月15日で43%、2014年2月28日で20%である。カットオフが最初の測定値より後になるにつれて、この割合は低下する。

履歴を最初の測定値から始めれば、問題を解消できる可能性がある。2月の各カットオフでAutoETSを2回あてはめる。1回目は生の8週間に対して、2回目はMT_115の最初の測定値から始まる開始履歴に対して行う。各カットオフからの24時間で採点すると、解消できるかどうかが分かる。

late-starter-trim.py Python 3.13.16 · numpy 2.5.5 · pandas 2.3.3 · statsforecast 2.1.1 · utilsforecast 0.2.17 合格
"""Backtest AutoETS for MT_115, a late starter, on three February cutoffs: once on its raw eight weeks and once on its history from its first reading.The start-rule counts, printed first, and the three-window MAE lines are the figures the point rests on."""import numpy as npimport pandas as pdfrom statsforecast import StatsForecastfrom statsforecast.models import AutoETSfrom lib.backtest import history_beforefrom lib.electricity import loadfrom lib.quirks import fill_clock_change_hours, mask_clock_changesfrom lib.settings import HORIZON, SEED, SUBSET8, showfrom lib.starts import check_start_rule, history_from_startLATE = "MT_115"                                             # the one late starter in SUBSET8, first non-zero reading on Jan 14, 2014# February cutoffs: at the December cutoffs every hour of the history is a reading, so the rule changes nothing thereCUTOFFS = pd.to_datetime(["2014-02-01", "2014-02-15", "2014-02-28"])np.random.seed(SEED)                                        # the seed from lib/settings.py, set before any fitdropped, flagged = check_start_rule(load(SUBSET8))           # raises unless the rule drops exactly the flagged rows, so the counts agreeshow("start rule drops, SUBSET8", dropped)show("flagged before_first_reading, SUBSET8", flagged)masked = mask_clock_changes(load([LATE]))[["unique_id", "ds", "y", "quirk"]]def fit_and_score(hist, c):    """Fit AutoETS on one history, forecast the 24 hours from c, and score it on those hours."""    sf = StatsForecast(models=[AutoETS(season_length=24)], freq="h", n_jobs=1)    sf.fit(df=fill_clock_change_hours(hist)[["unique_id", "ds", "y"]])   # clock-change hours filled from their neighbouring hours, as elsewhere    fc = sf.predict(h=HORIZON)    actual = masked[(masked["ds"] >= c) & (masked["ds"] < c + pd.Timedelta(hours=HORIZON))]   # the day's 24 readings, to score against    joined = fc.merge(actual[["ds", "y"]], on="ds", how="left")    # the form's method name, the mean forecast, the day's MAE, and the mean of the readings    return sf.fitted_[0, 0].model_["method"], float(joined["AutoETS"].mean()), float((joined["y"] - joined["AutoETS"]).abs().mean()), float(joined["y"].mean())maes = {"raw": [], "start": []}for c in CUTOFFS:    raw_hist = history_before(masked, c)                     # the eight weeks before c, zeros included; it insists on exactly 1,344 rows    # the share of hours that read zero, including the leading zeros before the first reading    show(f"zero percent before {c:%Y-%m-%d}", round(100 * (raw_hist["y"] == 0).mean()))    # the start history begins at the first reading, so it is shorter wherever the client starts late    for label, hist in [("raw", raw_hist), ("start", history_from_start(masked, c))]:        form, fc_mean, window_mae, actual_mean = fit_and_score(hist, c)        show(f"{label} history hours {c:%Y-%m-%d}", len(hist))        show(f"{label} form {c:%Y-%m-%d}", form)        show(f"{label} mean forecast {c:%Y-%m-%d}", fc_mean)        show(f"{label} mean actual {c:%Y-%m-%d}", actual_mean)        show(f"MAE {label} {c:%Y-%m-%d}", window_mae)        maes[label].append(window_mae)for label in maes:    show(f"MAE {label}, three windows", np.mean(maes[label]))    show(f"MAE {label}, 2014-02-15 and 2014-02-28", np.mean(maes[label][1:]))   # [1:] skips Feb 1, the first cutoff
出力python late-starter-trim.py
start rule drops, SUBSET8: 9072
flagged before_first_reading, SUBSET8: 9072
zero percent before 2014-02-01: 68
raw history hours 2014-02-01: 1344
raw form 2014-02-01: ETS(A,N,N)
raw mean forecast 2014-02-01: 16.43
raw mean actual 2014-02-01: 24.06
MAE raw 2014-02-01: 8.81
start history hours 2014-02-01: 432
start form 2014-02-01: ETS(M,Ad,A)
start mean forecast 2014-02-01: 23.88
start mean actual 2014-02-01: 24.06
MAE start 2014-02-01: 3.72
zero percent before 2014-02-15: 43
raw history hours 2014-02-15: 1344
raw form 2014-02-15: ETS(A,N,A)
raw mean forecast 2014-02-15: 24.54
raw mean actual 2014-02-15: 27.11
MAE raw 2014-02-15: 4.29
start history hours 2014-02-15: 768
start form 2014-02-15: ETS(M,Ad,A)
start mean forecast 2014-02-15: 23.84
start mean actual 2014-02-15: 27.11
MAE start 2014-02-15: 4.77
zero percent before 2014-02-28: 20
raw history hours 2014-02-28: 1344
raw form 2014-02-28: ETS(A,N,A)
raw mean forecast 2014-02-28: 23.73
raw mean actual 2014-02-28: 23.54
MAE raw 2014-02-28: 2.93
start history hours 2014-02-28: 1080
start form 2014-02-28: ETS(M,Ad,A)
start mean forecast 2014-02-28: 22.48
start mean actual 2014-02-28: 23.54
MAE start 2014-02-28: 2.73
MAE raw, three windows: 5.34
MAE raw, 2014-02-15 and 2014-02-28: 3.61
MAE start, three windows: 3.74
MAE start, 2014-02-15 and 2014-02-28: 3.75

悪影響は水準に現れ、2月1日が最も大きい。AutoETSは生の履歴に対してもエラーを出さずにあてはまり、警告なしに予測を出す。2014年2月1日には平坦な形式 ETS(A,N,N) を選び、その予測は1日を通して平均16.43 kWh/時になる。その後の実測値の平均は24.06 kWh/時である。この日のMAEは8.81 kWhである。原因はおそらくゼロにある。ゼロが水準を押し下げるが、モデルはそれが使用量ではないことを見分けられない。

他の2日では、生の履歴の誤差ははるかに小さく、2014年2月15日で4.29 kWh、2014年2月28日で2.93 kWhである。したがって、損害の大きさは窓に含まれるゼロの数に左右される。先頭のゼロは使用量ではないので、ゼロの割合にかかわらずこのルールは正しい。

各系列を最初の読み取り値から始める

最終変更:版2026.11.5

開始ルールは、系列が最初の読み取り値から始まるとするものである。このルールは、顧客の最初の非ゼロの読み取り値より前にある読み取り値をすべて除外し、それ以降の読み取り値はゼロも含めてすべて残す。開始後のゼロは実際の低使用量であり、モデルに必要だからである。最初の読み取り値より後に始まる窓は、すべての時間を保持する。このルールが除くのは先頭のゼロだけだからである。ルールは examples/lib/starts.py にあり、後の章でも同じコードを呼び出す。関数 history_from_start(df, cutoff) は、1 つのカットオフについて、このルールを適用した履歴を返す。その履歴は、カットオフ前の 8 週間の読み取り値のうち、最初の読み取り値以降のものである。最初の読み取り値はカットオフより前の行だけから見つけるので、カットオフより後の読み取り値がモデルに渡ることはない。カットオフより前に読み取り値がない顧客や、履歴が 48 時間に満たない顧客がある場合は、エラーを送出する。

ルールを使う前に、それがフラグの示すとおりに動作することを確認する。check_start_rule は、系列全体でルールが除外する行を数え、それがちょうど before_first_reading のフラグが付いた行でなければエラーを送出する。サブセットでは、ルールが除外するのは 9072 時間であり、フラグが付いているのは 9072 である。両者は一致する。サブセットで遅れて開始した顧客は MT_115 だけである。

ルールによる履歴の短縮は最初のカットオフで最も大きく、1,344 時間に対して 432 時間となる。カットオフが最初の読み取り値から離れるほど短縮は小さくなり、2 月 15 日では 768 時間、2 月 28 日では 1080 時間である。

開始ルールを適用した履歴は、3 つのカットオフのすべてで ETS(M,Ad,A) を選ぶ。これは、乗法誤差、減衰トレンド、加法季節を持つ形である。生の履歴は日によって形が変わり、2 月 1 日の平坦な形から、2014 年 2 月 15 日には ETS(A,N,A)、2014 年 2 月 28 日には ETS(A,N,A) になる。

3 つの窓の MAE は 5.34 kWh から 3.74 kWh に下がる。改善は窓ごとに均一ではなく、その改善のすべては 2 月 1 日によるものであり、この日の MAE は 8.81 から 3.72 kWh に下がる。

2 月 15 日にはルールのほうが悪くなり、2 月 28 日には少しだけ良くなる。この 2 日を合わせると、生の履歴のほうがわずかに良く、平均 MAE は 3.61 kWh であるのに対し、開始ルールの履歴では 3.75 kWh である。

2 月 15 日にルールが負ける理由は、当てはめの結果から分かる。開始後の履歴は 768 時間とまだ短く、その減衰トレンドは生の当てはめより低い予測を出す。予測の平均は 1 時間あたり 23.84 kWh であり、生の当てはめでは 24.54 である。このとき読み取り値の平均は 27.11 kWh であった。この低い予測が、このケースで警告しているコストである。1 人の顧客と 3 日間は小さな標本であるから、この数値はルールを証明するものではなく、例示するものである。

実践ルール: 顧客の履歴にゼロが含まれるときは、最初の非ゼロの読み取り値が履歴の内側にあるかどうかを確認する。内側にあるなら、ゼロの割合にかかわらず、どのモデルにも履歴を見せる前に開始ルールを適用する。先頭のゼロは使用量ではないからである。まず系列全体に対して check_start_rule を実行し、失敗した場合は、何かを切り詰める前にその理由を調べる。各カットオフでの履歴の長さを出力する。履歴が短いことは、ルールが取りすぎたことを示す最初の兆候だからである。

本書が season 24 で自動 ARIMA を避ける理由

最終変更:版2026.11.5

AutoARIMA は、次数を固定せずに探索する。候補となる次数に対して stepwise 探索を行い、既定の基準である AICc で最良のものを選び、最大 94 個の候補モデルを試した時点で停止する(statsforecast 2.1.1、statsforecast/models.py、および停止メッセージを示す statsforecast/arima.py)。各候補は完全な状態空間モデルの当てはめである。season が 24 の場合、ラグ 24 の季節項を持つ候補はそれぞれ遅く、探索はそのような候補を何十個も試すため、本章の当てはめよりもはるかに長い時間がかかる。

本書が固定した環境、すなわち 2 基の CPU と statsforecast 2.1.1 では、1 クライアント 1 ウィンドウに約 75 秒かかった。これは、最初の標準カットオフでの MT_014 に対する 1 回の実行である。サブセットには 24 個のこのようなウィンドウが必要なため、そのバックテストを 1 回行うと約 30 分かかる。本書が 1 つの例に認める 45 秒とは大きな差がある。これは本書自身の測定であり、本書に載せた例ではない。また環境に依存するため、スケジュールを組む前に自分のマシンで時間を測ること。固定した次数であれば、ウィンドウごとの当てはめは 1 回で済む。ここで重要なのはこの違いである。固定した次数の弱点は、パターンがその次数の想定と異なるクライアントである。それを確かめるのがバックテストであり、見るべき場所は比較の節のスコアである。

固定した次数は判断であり、発見ではない。本書では、データに日周期のパターンがあり、本章のバックテストには最後まで実行できるモデルが必要なため、season を 24 とした (1,0,0)(1,1,0) を選んだ。次数は呼び出しの中に書かれており、読者はそれを見て変更できる。後の章では同じウィンドウでこれと比較するので、次数を変えればスコアに現れる。

実践ルール: 毎日再学習するスケジュールで、1 時間単位のデータに season 24 の自動探索を実行してはならない。採用を決める前に、1 クライアントで探索の時間を測ること。遅すぎる場合は次数を固定し、その次数をバックテストで検証する。

本番運用で起こる問題

  • 季節の欠落。 季節の長さを 1 のままにすると、日周パターンを持たないモデルになり、エラーも出ない。兆候は、すべてのクライアントが ETS(A,N,N) のように季節のない形を選ぶことである。数件のクライアントだけがそうなる場合は別の事象であり、季節ありの当てはめが失敗している。これは指数平滑法の節の平坦形チェックで検証できる。再学習のたびに、選ばれた形をログに記録する。
  • 後から始まるクライアントのゼロ。 履歴の途中で開始したクライアントでは、最初の観測値が窓から外れるまで、水準が引き下げられる。兆候は、開始後の数日間にわたって予測が低めに出ることである。再学習の前に、各クライアントの履歴に占めるゼロの割合を数え、最初の観測値が履歴の内側にあるクライアントには開始ルールを適用する。
  • 形の変化。 選ばれる形は、再学習のたびに同じクライアントでも変わりうる。それ自体は誤りではないが、季節ありの形から季節なしの形への切り替えは、観測値と照らして確認する価値がある。形は実行ログに残しておく。
  • 積み上がるコスト。 当てはめの回数は、クライアント数、窓の数、再学習の回数の積に比例して増える。スケジュールにクライアントを追加する前に、その回数を数える。
  • 外れる区間。 このサンプルでは、AutoETS の区間が時間の 0.910 を覆っており、名目値の 0.95 に届かなかった。第 8 章では、過去の窓で帯を較正する方法を示す。その方法で較正するまでは、帯を 95% 範囲として示してはならない。
  • 気づく方法。 毎日の窓で、すべての統計モデルと並べて季節ナイーブ予測を実行し、MASE の差をログに記録する。差の符号が日ごとに変わる場合は、結果として報告するのではなく、モデルを調べるべき合図である。

この章で行った決定

最終変更:版2026.11.5
  • 季節周期を24とするAutoETS。 既定の model="ZZZ" と、季節周期を強制した実行 model="ZZA" の両方を報告する。平坦な選択は、季節性を当てはめた結果の失敗である場合があるからである。この章は二つの形のどちらかを選ぶことはしない。標準の予測起点による比較は報告するだけで選択には用いず、選択は、より前の期間の窓で行うべきものである。第1章では主要な顧客に対して ZZA を強制したが、この章では8顧客すべてについて、その強制実行を示す。
  • 探索を行わない、固定のARIMA(1,0,0)(1,1,0)[24]。 これは明示した判断であり、バックテストがそれを検証する。
  • 30顧客ではなく8顧客。 第6章では1つのモデルで30顧客すべてを当てはめる。30顧客すべてに対して顧客ごとにAutoETSを当てはめ、3つの窓で評価すると、固定した環境で約97秒かかる。本書が1つの例に許す時間は45秒であるため、この章ではサブセットを用いる。
  • サブセット、予測起点、スケール。 SUBSET8、3つの標準の予測起点、2014年12月29日から12月31日まで、1,344時間の履歴、そしてすべての比較で基準とする季節ナイーブ予測である。MASEのスケールは、各顧客を最初の観測値から読み取り、時計切り替えの時間は除外する。
  • 時計切り替えの時間。 第3章で述べたとおり、サブセットのどの例も、これらの時間をマスクし、履歴から補完する。3つの窓のいずれにも時計切り替えの時間は含まれないため、マスクによって予測も採点対象の時間も変わらない。一方、MASEのスケールは2014年12月29日より前のすべての履歴を読み、MT_115 については2014年1月14日から数えるため、スケールは変わる。
  • 開始の遅い顧客: 2月の予測起点と開始規則。 12月の予測起点は MT_115 の開始の遅さに当たらないが、2月の予測起点は当たる。第6章では、この規則を30顧客すべてに適用する。
  • カバレッジは2つのAutoETS実行のみ。 ARIMAのバックテストは、ここでは区間なしで採点する。
  • 当てはめた値は引用しない。 ARIMAのスクリプトはパラメータ名だけを出力し、平坦な形の確認は件数だけを出力する。誤差は小数第2位まで、カバレッジは小数第3位まで丸める。
  • 第5章のための統計的ベースライン。 これらの窓における顧客ごとのAutoETSとARIMAのスコアが、勾配ブースティングモデルが上回るべき基準となる。
  • 次に引き継ぐこと。 平坦な形は季節性の当てはめの失敗である場合があるため、どのスコアも、選ばれた形と並べて読むこと。MAEとMASEはモデルの順位付けが異なる場合があるため、判断にどちらが必要かを明示すること。各系列は最初の観測値から始めること。近接したモデルの間で選ぶ前に、窓を増やすこと。

この版における本章

第2026.11.11版2026年11月20日時点で例が通過この章の6 例件のうち6件が合格

英語版の書籍(版2026.11.11)から翻訳した。

この節を引用する

形式

いずれの形式も、本訳書が従う英語版の書籍を出典として示す。

いずれの形式もこの版を明示している。そのリンクは現行版を開き、節の見出しには本文が最後に変更された日付が示される。アクセス日と取得日は、これを開いた日である。

このページの内容

全10章中の第4章: 顧客ごとに統計モデルを当てはめる

  1. なぜ次に統計モデルを扱うのか
  2. Fit exponential smoothing
  3. 固定の季節 ARIMA を当てはめる
  4. 同じカットオフでモデルを比較する
  5. 遅れて始まるクライアント
  6. ゼロから始まる履歴
  7. 各系列を最初の読み取り値から始める
  8. 本書が season 24 で自動 ARIMA を避ける理由
  9. 本番運用で起こる問題
  10. この章で行った決定

ページの先頭に戻るすべての章