Skip to content

Commit 46ab7af

Browse files
fix system simulation
1 parent 225e8c5 commit 46ab7af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/systems.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ function simulate(
331331

332332
# The first state of the simulation is the update of a_0
333333
alpha[1, :] .= initial_state .+ sys.R * chol_Q.L * standard_η[1, :]
334-
y[1] = dot(sys.Z, initial_state) + sys.d + chol_H * standard_ε[1]
335-
alpha[2, :] = sys.T * initial_state + sys.c + sys.R * chol_Q.L * standard_η[2, :]
334+
y[1] = dot(sys.Z, alpha[1, :]) + sys.d + chol_H * standard_ε[1]
335+
alpha[2, :] = sys.T * alpha[1, :] + sys.c + sys.R * chol_Q.L * standard_η[2, :]
336336
# Simulate scenarios
337337
for t in 2:n
338338
y[t] = dot(sys.Z, alpha[t, :]) + sys.d + chol_H * standard_ε[t]
@@ -363,8 +363,8 @@ function simulate(
363363

364364
# The first state of the simulation is the update of a_0
365365
alpha[1, :] .= initial_state .+ sys.R * chol_Q.L * standard_η[1, :]
366-
y[1, :] = sys.Z * initial_state + sys.d + chol_H.L * standard_ε[1, :]
367-
alpha[2, :] = sys.T * initial_state + sys.c + sys.R * chol_Q.L * standard_η[2, :]
366+
y[1, :] = sys.Z * alpha[1, :] + sys.d + chol_H.L * standard_ε[1, :]
367+
alpha[2, :] = sys.T * alpha[1, :] + sys.c + sys.R * chol_Q.L * standard_η[2, :]
368368
# Simulate scenarios
369369
for t in 2:n
370370
y[t, :] = sys.Z * alpha[t, :] + sys.d + chol_H.L * standard_ε[t, :]

0 commit comments

Comments
 (0)