Home 21090308 › Forums › Numerical Method › Statistics › ARMA fitting
Tagged: SuanShu JAVA
 This topic has 6 replies, 1 voice, and was last updated 3 years, 10 months ago by dayyoung0324.

AuthorPosts

November 15, 2016 at 2:22 pm #5611dayyoung0324Member
I wanna forecast a value by fitting an ARIMA model based on a time series of historical records. I’ve used the trial SuanShu 3.4.0 API. With this trial API, could I train ARMA model parameters and predict the next term value? Does the offical version of SuanShu provide some simple examples or user manual about ARIMA mode. I am new with Suanshu and any advise or help will be appreciated. Thank you.
November 16, 2016 at 5:06 pm #5612RyuMemberThe full version of SS has classes to estimate ARMA models. Please see these examples.
But the free version does not allow using the statistical API. You may request a full one month trial license by emailing info [a t] nm [d o t] sg
November 22, 2016 at 10:33 pm #5613dayyoung0324MemberThank you for your response.
In ARMA modeling, the first step is to identify the model (i.e., the values of p for AR and q for MA) by looking at plots of the ACF and PACF. Is it possible to realize this step by SuanShu API (without figuring out these two plots)?November 24, 2016 at 2:49 pm #5614RyuMemberHere is what we/SuanShu suggests:
1.
Determine the lags (p and q) of the ARMA process and fit an ARMA(p, q) model. This is done by the usual ARMA fitting procedure., e.g.,ConditionalSumOfSquares
2.
Select a suitable set of orders (P, Q) for the GARCH process. We can do this by looking at the PACF and ACF of the squared residuals and possibly use LjungBox test.
3.
Fit a pure GARCH(P, Q) model to the residuals using conditional MLE.
4.
Diagnostic checks.You can do all steps 1 – 4 in SuanShu by calling the appropriate classes.
See this for more information:
http://numericalmethod.com/forums/topic/questionaboutarmainnewcversionofsuanshu/March 6, 2017 at 3:21 am #5638dayyoung0324MemberThank you for your guidance. After reviewing the discussions shown in the C# topics, it helps me a lot, even if I purchased SuanShu JAVA version. I have a question about how to determine suitable p lags for AR model and q lags for MA model by SuanShu. In principle, the first step of modeling ARMA is to identify p and q lags by looking at “plots” of the ACF and PACF. Does this step correspond to STEP 2 (or STEP 1) you mentioned? In SuanShu, should we plot ACF and PACF to determine suitable p for AR model and q for MA model?
March 14, 2017 at 2:53 am #5639dayyoung0324MemberHello,
I think I got a solution to my previous question. I follow the following reference.
https://www.quantstart.com/articles/AutoregressiveMovingAverageARMApqModelsforTimeSeriesAnalysisPart3Choosing the Best ARMA(p,q) Model
In order to determine which order p,q of the ARMA model is appropriate for a series, we need to use the AIC (or BIC) across a subset of values for p,q, and then apply the LjungBox test to determine if a good fit has been achieved, for particular values of p,q.
To show this method we are going to firstly simulate a particular ARMA(p,q) process. We will then loop over all pairwise values of p∈{0,1,2,3,4} and q∈{0,1,2,3,4} and calculate the AIC. We will select the model with the lowest AIC and then run a LjungBox test on the residuals to determine if we have achieved a good fit.
We will now create an object final to store the best model fit and lowest AIC value. We loop over the various p,q combinations and use the current object to store the fit of an ARMA(i,j) model, for the looping variables i and j.
If the current AIC is less than any previously calculated AIC we set the final AIC to this current value and select that order.
March 14, 2017 at 8:50 am #5640RyuMemberYes. Alternatively, you may use this class which automates the trial loop.

AuthorPosts
 You must be logged in to reply to this topic.