signaflo / java-timeseries

Time series analysis in Java
MIT License
195 stars 49 forks source link

ArimaCoefficients need refactoring and public access #14

Open signaflo opened 6 years ago

signaflo commented 6 years ago

The ArimaCoefficients is a simple structure containing arrays of doubles representing the AR and MA parameters in addition to the mean/drift terms.

There are a few issues. One is that we need to differentiate between a coefficient that is fixed and known, and therefore has no standard error, and a coefficient that either has been or is in the process of being estimated, and therefore should have an associated uncertainty measure.

Another issue is that the only way to obtain information about standard errors of the coefficients in the Arima class is by getting a flat array. Knowing which coefficient corresponds to which standard error in the array is then a matter of guesswork.

Finally, the coefficients in the Arima class are not public, which has been a problem for many users.

To fix these issues, the following tasks should be completed:

  1. Make coefficient objects public, so they can be accessed from the Arima class.
  2. Create a coefficient object hierarchy to represent model coefficients.
  3. The hierarchy should allow us to differentiate between fixed and estimated standard errors.

It's possible that changes should be made to the Arima class itself. For example, an ARIMA model whose coefficients are fixed is different from an ARIMA model whose coefficients are estimated through an optimization routine, but it is unclear whether that difference needs to be explicitly represented in the code structure.

jeremylcfr commented 6 years ago

Hello,

Thanks for your library, it is very helpful since it is quite rare in Java. Could you do the same for ArimaOrder ?

I use your library in Clojure and it is "harder" to keep track of orders we use (we must carry over a map accross functions especially for auto-selected coefficients while we could simply get all from ArimaModel directly). It would be nice to have a getter from ArimaOrder like asHashMap, asArray or to make p(), d(), q(), P(), D(), Q() getters public.

Thanks

signaflo commented 6 years ago

@DeusSanctum , yes, we should do something similar for ArimaOrder while fixing coefficients. Can you help me fill out the following sentence: "In terms of a data structure, the order of an Arima model is __ "

nirupamarachuri commented 4 years ago

Hello,

Is this feature yet to be implemented because I see that the get coefficients methods still have default access modifiers as opposed to being public. The coefficients() returns the information about all coefficients as string but I'm looking for more like a get method for each coefficient type.

Thanks in advance.