Skip to content

Commit

Permalink
🐛 Fix step_range in sarima_predict
Browse files Browse the repository at this point in the history
  • Loading branch information
LuizFCDuarte committed Jun 1, 2024
1 parent 36aefdc commit 0efe7cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/models/sarima_predict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ function generateARseries(p,s,ARcoeff, seasCoeff,trend,seed::Int = 1234, error::
end
#trend
x = 1:200
seriesValues = randn(s) .+ trend*x[1:s] .+ whiteNoise[1:s]
for i in s+1:200
numInitialValues = max(s,p)
seriesValues::Vector{Float64} = Vector{Float64}()
for i in 1:numInitialValues
value = randn() + trend*x[i] + whiteNoise[i]
push!(seriesValues,value)
end
for i in numInitialValues+1:200
value = seriesValues[i-s]*seasCoeff + sum(ARcoeff[j]*seriesValues[i-j] for j in 1:p) + trend*x[i] + whiteNoise[i]
push!(seriesValues,value)
end
Expand Down

0 comments on commit 0efe7cb

Please sign in to comment.