Skip to content

Commit b15f942

Browse files
Merge pull request #331 from LAMPSPUC/unobserved_components_with_exp
add explanatory variables to unobserved_components
2 parents b0fe56c + 5c4ea4b commit b15f942

File tree

4 files changed

+338
-68
lines changed

4 files changed

+338
-68
lines changed

src/StateSpaceModels.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ include("models/basicstructural_multivariate.jl")
5050
include("models/sarima.jl")
5151
include("models/linear_regression.jl")
5252
include("models/unobserved_components.jl")
53+
5354
include("models/exponential_smoothing.jl")
5455
include("models/naive_models.jl")
5556
include("models/dar.jl")

src/forecast.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ function forecast(
8989
for i in 1:steps_ahead
9090
if isunivariate(model)
9191
expected_value[i] = [
92-
dot(model.system.Z[end - steps_ahead + i - 1], fo.a[end - steps_ahead + i - 1]) +
93-
model.system.d[end - steps_ahead + i - 1],
92+
dot(forecasting_model.system.Z[end - steps_ahead + i], fo.a[end - steps_ahead + i - 1]) +
93+
forecasting_model.system.d[end - steps_ahead + i],
9494
]
9595
else
9696
expected_value[i] =
97-
model.system.Z[end - steps_ahead + i - 1] * fo.a[end - steps_ahead + i - 1] +
98-
model.system.d[end - steps_ahead + i - 1]
97+
forecasting_model.system.Z[end - steps_ahead + i] * fo.a[end - steps_ahead + i - 1] +
98+
forecasting_model.system.d[end - steps_ahead + i]
9999
end
100100
covariance[i] = fo.F[end - steps_ahead + i]
101101
end

0 commit comments

Comments
 (0)