Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StateSpaceLearning"
uuid = "971c4b7c-2c4e-4bac-8525-e842df3cde7b"
authors = ["andreramosfc <[email protected]>"]
version = "2.0.10"
version = "2.0.11"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
10 changes: 7 additions & 3 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,13 @@ function get_stochastic_values(
valid_indices = filter(idx -> start_idx <= idx <= final_idx, seasonal_indices)

# Sample with randomness and sign flip
stochastic_term[t, :] =
rand(estimated_stochastic[valid_indices], N_scenarios) .*
rand([1, -1], N_scenarios)
if !isempty(estimated_stochastic[valid_indices])
stochastic_term[t, :] =
rand(estimated_stochastic[valid_indices], N_scenarios) .*
rand([1, -1], N_scenarios)
else
stochastic_term[t, :] .= 0.0
end
end
else
stochastic_term =
Expand Down
Loading