Skip to content

Commit

Permalink
✅ Add sarima basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LuizFCDuarte committed May 28, 2024
1 parent 7e81db3 commit 2e53b1c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/models/sarima.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,26 @@
airPassengersLog = log.(airPassengers)

modeloLog = SARIMA(airPassengersLog, 3, 0, 1; seasonality=12, P=1, D=1, Q=1)
@test Sarimax.typeofModelElements(modeloLog) == Float64
@test Sarimax.isFitted(modeloLog) == false
@test getHyperparametersNumber(modeloLog) == 7
fit!(modeloLog)
predict!(modeloLog; stepsAhead=10, displayConfidenceIntervals=true)
@test size(modeloLog.forecast,1) == 10
@test size(modeloLog.forecast,2) == 3

@test Sarimax.isFitted(modeloLog) == true
@test mean(modeloLog.ϵ) 0 atol=1e-1

autoModelML = auto(airPassengersLog; seasonality=12 ,objectiveFunction="ml")
@test autoModelML.d == 0 # Output of forecast package in R
@test autoModelML.D == 1 # Output of forecast package in R

simulation = simulate(modeloLog, 10, 301)
@test length(simulation) == 301
@test length(simulation[1]) == 10


end

@testset "ARMA to MA" begin
Expand Down

0 comments on commit 2e53b1c

Please sign in to comment.