Comments (3)
We can rewrite those asserts
@assert max_p > 0
@assert max_q > 0
@assert max_d > 0
@assert max_P > 0
@assert max_D > 0
@assert max_Q > 0
@assert max_order > 0
There is no reason for them to be strictly positive
from statespacemodels.jl.
I changed the following line in the auto_arima function:
@Assert max_q >= 0
Changing ">" to ">=" allows me to call auto_arima with max_q=0 (my intention is to pick up the best AR model):
mdl_ar=StateSpaceModels.auto_arima(mdl_ivx["ols_residuals"], max_p=5, d=0, max_q=0, information_criteria="bic")
StateSpaceModels.fit!(mdl_ar)
print(mdl_ar.results)
However, the model chosen by auto_arima is p=2; d=0; q=2:
StateSpaceModels.Results{Float64}("SARIMA(2, 0, 2)x(0, 0, 0, 0) with zero mean ", StateSpaceModels.CoefficientTable{Float64}(["ar_L1", "ar_L2", "ma_L1", "ma_L2", "sigma2_η"], [0.5812890069326717, 0.3225272626177295, -0.0740566496419704, -0.3756228739571143, 7.081303066016176e-5], [NaN,
NaN, NaN, NaN, NaN], [NaN, NaN, NaN, NaN, NaN], [NaN, NaN, NaN, NaN, NaN]), 580.6591619420767, -1151.3183238841534, -1150.9590424470277, -1135.5518659116644, 173, 5) * Terminal will be reused by tasks, press any key to close it.
Obviously, (2, 0, 2) doesn't satisfy the requirement of max_q=0.
(2, 0, 2) was generated by the following block.
if seasonal == 0
push!(candidate_models, SARIMA(y; order = (2, d, 2), include_mean = include_mean, suppress_warns = true))
push!(candidate_models, SARIMA(y; order = (0, d, 0), include_mean = include_mean, suppress_warns = true))
push!(candidate_models, SARIMA(y; order = (1, d, 0), include_mean = include_mean, suppress_warns = true))
push!(candidate_models, SARIMA(y; order = (0, d, 1), include_mean = include_mean, suppress_warns = true))
I guess the two instances of “-1:1" in code below need to be changed.
function add_new_p_q_models!(candidate_models::Vector{SARIMA},
max_p::Int, max_q::Int, max_order::Int,
visited_models::Vector{NamedTuple})
best_model = candidate_models[1]
for p in -1:1, q in -1:1
new_p = best_model.order.p + p
new_q = best_model.order.q + q
# invalid new orders
from statespacemodels.jl.
Hi @dazhwu thanks for the tests, I will merge this PR tomorrow and release a new version with the fixes. If you want to test it right now you can add the specific branch of the fix add StateSpaceModels#gb/fix-auto-arima-orders
.
from statespacemodels.jl.
Related Issues (20)
- Scenarios of SARIMA
- ExponentialSmoothing: AssertionError ub > lb HOT 4
- Add keyword arg to ignore the hessian calculation HOT 1
- get_smoothed_state performance issues for larger time series HOT 5
- LAPACKException for missing/NaN values HOT 3
- Allow Polynomials v2 in [compat] HOT 1
- Possible Issue with Std.Error in SARIMA() HOT 2
- BasicStructuralExplanatory works ONLY for s = 12. HOT 3
- simulate_scenarios for BasicStructuralExplanatory fails if seasonality is not 12 HOT 2
- Feature suggestion: state space models for intermittent demand
- Example in the Quick Start not working HOT 1
- Getting DomainError when fitting some models HOT 2
- Unobserved components model with smooth trend is broken
- Enhancement Request - Add ability to specify innovations for simulation HOT 2
- Linear univariate time variant model implemented? HOT 8
- Holt-Winter Model HOT 1
- Can not fit MA(q) HOT 10
- Cannot predict for more steps than number of observations
- Fix all parameters and calculate just the likelihood for a filter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statespacemodels.jl.