@@ -29,9 +29,7 @@ function build_components(
29
29
X[:, components_indexes[key]] * coefs[components_indexes[key]]
30
30
end
31
31
if haskey (components, " exog" )
32
- components[" exog" ][" Selected" ] = findall (
33
- i -> i != 0 , components[" exog" ][" Coefs" ]
34
- )
32
+ components[" exog" ][" Selected" ] = findall (i -> i != 0 , components[" exog" ][" Coefs" ])
35
33
end
36
34
return components
37
35
end
@@ -134,14 +132,21 @@ get_stochastic_values(estimated_stochastic::Vector{Fl}, steps_ahead::Int, T::Int
134
132
# Returns
135
133
- `Vector{AbstractFloat}`: Vector of stochastic seasonal values.
136
134
"""
137
- function get_stochastic_values (estimated_stochastic:: Vector{Fl} , steps_ahead:: Int , T:: Int , start_idx:: Int , final_idx:: Int , seasonal_innovation_simulation:: Int ):: Vector{AbstractFloat} where {Fl<: AbstractFloat }
138
-
135
+ function get_stochastic_values (
136
+ estimated_stochastic:: Vector{Fl} ,
137
+ steps_ahead:: Int ,
138
+ T:: Int ,
139
+ start_idx:: Int ,
140
+ final_idx:: Int ,
141
+ seasonal_innovation_simulation:: Int ,
142
+ ):: Vector{AbstractFloat} where {Fl<: AbstractFloat }
139
143
if seasonal_innovation_simulation != 0
140
144
stochastic_term = Vector {AbstractFloat} (undef, steps_ahead)
141
145
for t in 1 : steps_ahead
142
146
143
147
# Generate potential seasonal indices
144
- seasonal_indices = (T + t) % seasonal_innovation_simulation : seasonal_innovation_simulation : T
148
+ seasonal_indices =
149
+ ((T + t) % seasonal_innovation_simulation): seasonal_innovation_simulation: T
145
150
146
151
# Filter indices to be within the valid range
147
152
valid_indices = filter (idx -> start_idx <= idx <= final_idx, seasonal_indices)
@@ -150,9 +155,9 @@ function get_stochastic_values(estimated_stochastic::Vector{Fl}, steps_ahead::In
150
155
stochastic_term[t] = rand (estimated_stochastic[valid_indices]) * rand ([1 , - 1 ])
151
156
end
152
157
else
153
- stochastic_term = rand (estimated_stochastic, steps_ahead) .* rand ([1 , - 1 ], steps_ahead)
158
+ stochastic_term =
159
+ rand (estimated_stochastic, steps_ahead) .* rand ([1 , - 1 ], steps_ahead)
154
160
end
155
161
156
162
return stochastic_term
157
-
158
163
end
0 commit comments