Skip to content

Commit 7a83217

Browse files
author
andre_ramos
committed
fix cycle decomposition for stochastic start > 0
1 parent ee616a0 commit 7a83217

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StateSpaceLearning"
22
uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b"
33
authors = ["andreramosfc <[email protected]>"]
4-
version = "2.0.1"
4+
version = "2.0.2"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"

src/models/structural_model.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,13 +1226,17 @@ function get_cycle_decomposition(
12261226
end
12271227

12281228
for t in 2:T
1229-
ϕ_indexes =
1230-
max(2, model.stochastic_start):min(t, (T - max(1, model.ϕ_threshold)))
1231-
cycle[t] =
1232-
dot(c1, [cos(λ[t]), sin(λ[t])]) + sum(
1233-
ϕ_cos[i] * cos(λ[t]) + ϕ_sin[i] * sin(λ[t]) for
1234-
i in eachindex(ϕ_indexes)
1235-
)
1229+
if max(2, model.stochastic_start) <= min(t, (T - max(1, model.ϕ_threshold)))
1230+
ϕ_indexes =
1231+
max(2, model.stochastic_start):min(t, (T - max(1, model.ϕ_threshold)))
1232+
cycle[t] =
1233+
dot(c1, [cos(λ[t]), sin(λ[t])]) + sum(
1234+
ϕ_cos[i] * cos(λ[t]) + ϕ_sin[i] * sin(λ[t]) for
1235+
i in eachindex(ϕ_indexes)
1236+
)
1237+
else
1238+
cycle[t] = dot(c1, [cos(λ[t]), sin(λ[t])])
1239+
end
12361240
end
12371241

12381242
else

0 commit comments

Comments
 (0)