diff --git a/src/models/sarima.jl b/src/models/sarima.jl index d69c62e..ea39ffe 100644 --- a/src/models/sarima.jl +++ b/src/models/sarima.jl @@ -359,9 +359,9 @@ function fit!(model::SARIMAModel;silent::Bool=true,optimizer::DataType=Ipopt.Opt fix.(ϵ[1:lb-1],0.0) if model.seasonality > 1 - @expression(mod, ŷ[t=lb:T], c + trend*t + sum(β[i]*exogValues[t,i] for i=1:nExog) + sum(ϕ[i]*yValues[t - i] for i=1:model.p) + sum(θ[j]*ϵ[t - j] for j=1:model.q if (t-j > 0)) + sum(Φ[k]*yValues[t - (model.seasonality*k)] for k=1:model.P) + sum(Θ[w]*ϵ[t - (model.seasonality*w)] for w=1:model.Q if (t - (model.seasonality*w) > 0))) + @expression(mod, ŷ[t=lb:T], c + trend + sum(β[i]*exogValues[t,i] for i=1:nExog) + sum(ϕ[i]*yValues[t - i] for i=1:model.p) + sum(θ[j]*ϵ[t - j] for j=1:model.q if (t-j > 0)) + sum(Φ[k]*yValues[t - (model.seasonality*k)] for k=1:model.P) + sum(Θ[w]*ϵ[t - (model.seasonality*w)] for w=1:model.Q if (t - (model.seasonality*w) > 0))) else - @expression(mod, ŷ[t=lb:T], c + trend*t + sum(β[i]*exogValues[t,i] for i=1:nExog) + sum(ϕ[i]*yValues[t - i] for i=1:model.p) + sum(θ[j]*ϵ[t - j] for j=1:model.q if (t-j > 0))) + @expression(mod, ŷ[t=lb:T], c + trend + sum(β[i]*exogValues[t,i] for i=1:nExog) + sum(ϕ[i]*yValues[t - i] for i=1:model.p) + sum(θ[j]*ϵ[t - j] for j=1:model.q if (t-j > 0))) end includeModelConstraints!(mod, yValues, T, lb, objectiveFunction) @@ -1002,7 +1002,7 @@ function auto( end allowMean = isnothing(allowMean) ? (d+D == 0) : allowMean - allowDrift = isnothing(allowDrift) ? (d+D >= 1) : allowDrift + allowDrift = isnothing(allowDrift) ? (d+D == 1) : allowDrift # Include initial models candidateModels = Vector{SARIMAModel}()