Coder Social home page Coder Social logo

rafat / ctsa Goto Github PK

View Code? Open in Web Editor NEW
56.0 7.0 25.0 16 MB

A Univariate Time Series Analysis and ARIMA Modeling Package in ANSI C. Updated with SARIMAX and Auto ARIMA.

Home Page: https://code.google.com/p/ctsa/

License: Other

C 99.65% CMake 0.35%
c cpp arima sarimax auto-arima time-series

ctsa's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ctsa's Issues

Undeterministic behaviour of some time series

Hi,

First of all, thanks a lot great sarima package and your effort!.

We are testing ctsa and for some combination of parameters and time series, the algorithm will behave nondeterministic manner. Meaning that for the same combination, sometimes CTSA will return different results.

Note:

  • with Sarima package from python, this problem is not appearing.
  • this problem is appearing same way in new SARIMAX

Time series: [40,70,0,50,30,50,0,30,30,0,20,26,50,0,0,0,0,0]

Configuration of SARIMA

method: 0
optimizer: 6
p: 1
d: 1
q: 2
s: 11
P: 1
D: 1
Q: 1

Exit commands in the code

Hey,

In the ctsa package, the exception handling is implemented using exit commands. This is creating an issue when ctsa is used as a library. We are testing ctsa for node https://www.npmjs.com/package/ctsa and when there are exit commands, ctsa will bring down whole node-js process.

Would it be possible to replace exit commands with N/A return value instead?

Thanks
Jozef

Unappropriate return of SARIMAX model

When using auto ARIMA with no exogenous variables (r=0, xreg=NULL), in the case of differencing (d+D) equals 1 and a constant term being allowed, the auto ARIMA will find a model with exogenous variables. It will create helper variables from 1...N.
However, if you try to use auto_arima_predict with xreg=NULL it will inevitably fail, as the model will try to access exogenous variables, that are actually not present.

This should not be the case in my opinion, as this disallows using auto arima in a script. (Seg Faults appearing, even though everything is correct).

[Auto Arima] Auto_Arima related functions may predict incorrect results?

Hello, @rafat I tried your ctsa package, but found that it seems that the prediction result from the auto_arima related functions is a bit incorrect. Can you check it? Thank you~

auto_arima_test1

0.05


 Exit Status
Return Code : 1
Exit Message : Probable Success

  ARIMA Seasonal Order : ( 1, 1, 1) * (0, 0, 0)

Coefficients        Value               Standard Error

AR1              0.215257            0.10121
MA1              0.819075            0.0631273

MEAN             0
TREND            0

SIGMA^2          0.0994924

ESTIMATION METHOD : CSS-MLE

OPTIMIZATION METHOD : BFGS

AIC criterion : 108.68

BIC criterion : 118.514

AICC criterion : 108.805

Log Likelihood : -51.3401

Auto ARIMA Parameters

Approximation: FALSE
Stepwise: FALSE
Predicted Values : 17.4807 17.4975 17.5011 17.5019 17.5021
Standard Errors  : 0.313811 0.337541 0.347725 0.355671 0.363058

image

auto_arima_test2

0.05
p: 2 d: 1 q: 2 P: 1 D: 1 Q: 1 Drift/Mean: 0 ic: -398.699
p: 0 d: 1 q: 0 P: 0 D: 1 Q: 0 Drift/Mean: 0 ic: -354.135
p: 1 d: 1 q: 0 P: 1 D: 1 Q: 0 Drift/Mean: 0 ic: -399.221
p: 0 d: 1 q: 1 P: 0 D: 1 Q: 1 Drift/Mean: 0 ic: -403.494
p: 0 d: 1 q: 1 P: 0 D: 1 Q: 0 Drift/Mean: 0 ic: -369.379
p: 0 d: 1 q: 1 P: 1 D: 1 Q: 1 Drift/Mean: 0 ic: -400.008
p: 0 d: 1 q: 1 P: 0 D: 1 Q: 2 Drift/Mean: 0 ic: -401.604
p: 0 d: 1 q: 1 P: 1 D: 1 Q: 0 Drift/Mean: 0 ic: -401.702
p: 0 d: 1 q: 1 P: 1 D: 1 Q: 2 Drift/Mean: 0 ic: -407.71
p: 0 d: 1 q: 1 P: 2 D: 1 Q: 2 Drift/Mean: 0 ic: -410.034
p: 0 d: 1 q: 1 P: 2 D: 1 Q: 1 Drift/Mean: 0 ic: -410.037
p: 0 d: 1 q: 1 P: 2 D: 1 Q: 0 Drift/Mean: 0 ic: -411.992
p: 0 d: 1 q: 0 P: 2 D: 1 Q: 0 Drift/Mean: 0 ic: -398.065
p: 1 d: 1 q: 1 P: 2 D: 1 Q: 0 Drift/Mean: 0 ic: -409.417
p: 0 d: 1 q: 2 P: 2 D: 1 Q: 0 Drift/Mean: 0 ic: -410.088
p: 1 d: 1 q: 0 P: 2 D: 1 Q: 0 Drift/Mean: 0 ic: -408.77

 Exit Status
Return Code : 1
Exit Message : Probable Success

  ARIMA Seasonal Order : ( 0, 1, 1) * (2, 1, 0)

Coefficients        Value               Standard Error

MA1              0.425617            0.0862409
SAR1             -0.558599           0.0895498
SAR2             -0.197882           0.0973616

MEAN             0
TREND            0

SIGMA^2          0.00140784

ESTIMATION METHOD : CSS-MLE

OPTIMIZATION METHOD : BFGS

AIC criterion : -479.278

BIC criterion : -467.777

AICC criterion : -478.961

Log Likelihood : 243.639

Auto ARIMA Parameters

Approximation: TRUE
Stepwise: TRUE

Forecast : 5 Point Look Ahead
Predicted Values : 6.11024 6.05009 6.16814 6.1935 6.23349
Standard Errors  : 1.03779 1.0437 1.04894 1.05371 1.05811

image

Included third party works under a different license?

Although the code is under a BSD 3- Clause license, there is a components_copyright directory containing other licenses' texts: LGPL, the BSD-like license of MINPACK and the ACM Software License Agreement. The later is not free software as it excludes commercial use.

Are such licenses relevant to CTSA? MINPACK was in Fortran, a C/C++ version was created under the same license, but it is not clear to me if some of it made its way into CTSA. Regarding the ACM Software License Agreement, I have no idea what could be impacted... And I'm not sure which parts would be LGPL.

In order to users to comply with the licenses, it would be nice to clarify if the whole code is BSD 3- Clause or if some parts are under one of these additional 3 licenses (we are integrating CTSA into an LGPL library, so it is important for us to know if the use of ctsa should be restricted to non-commercial works as well as if the advertisement clause only applies to ctsa or also to another code).

empty array initialization

in ctsa.h the array params is always initialized as
double params[0]
(invalid in ISO C/C++)
why not simply
double *params

Im using this library in a data processing software, and was wondering if it had a purpose, because if not it would be nice to change, to avoid compiler warnings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.