Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions python/statsforecast/ets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,7 @@ def _class3models(
sigma,
last_state,
season_length,
error,
trend,
seasonality,
damped,
alpha,
beta,
Expand Down Expand Up @@ -1192,16 +1190,16 @@ def _class3models(
)
Vh = exp1 + sigma * (exp2 + exp3 + exp4 + exp5)

if trend == "N":
Mh = (
F1 * np.matmul(Mh, np.transpose(F2))
+ G1 * np.matmul(Mh, np.transpose(G2)) * sigma
)
else:
Mh = (
np.matmul(F1, np.matmul(Mh, np.transpose(F2)))
+ np.matmul(G1, np.matmul(Mh, np.transpose(G2))) * sigma
)
if trend == "N":
Mh = (
F1 * np.matmul(Mh, np.transpose(F2))
+ G1 * np.matmul(Mh, np.transpose(G2)) * sigma
)
else:
Mh = (
np.matmul(F1, np.matmul(Mh, np.transpose(F2)))
+ np.matmul(G1, np.matmul(Mh, np.transpose(G2))) * sigma
)

return var

Expand Down Expand Up @@ -1341,9 +1339,7 @@ def _compute_pred_intervals(model, forecasts, h, level):
sigma,
last_state,
season_length,
error,
trend,
seasonality,
damped,
alpha,
beta,
Expand Down
2 changes: 1 addition & 1 deletion src/ets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void Forecast(Ref f, double l, double b, CRef s, int m, Component trend,
if (std::abs(phi - 1.0) < TOL) {
phistar += 1.0;
} else {
phistar += std::pow(phi, i + 1);
phistar += std::pow(phi, i + 2);
}
}
}
Expand Down
Loading