Giter Site home page Giter Site logo

telmo-correa / time-series-analysis Goto Github PK

View Code? Open in Web Editor NEW
33.0 1.0 19.0 33.17 MB

Self study on Cryer and Chan's "Time series analysis with applications in R"

Jupyter Notebook 99.64% Python 0.29% R 0.07%
r python time-series-analysis self-study solutions eacf armasubsets gbox mcleod-li setar

time-series-analysis's Introduction

time-series-analysis

Repository for self study on Jonathan, D. Cryer, and Chan Kung-Sik. "Time series analysis with applications in R." SpringerLink, Springer eBooks (2008).

Exercises are conducted on both R and Python for language practice purposes.

Notable packages used

  • R: TSA (functions mostly extracted / used as reference), ggplot, zoo, tseries
  • Python: matplotlib, statsmodels, scipy, arch

Implementation notes

  • Regression diagnostic graphs, in the same style as R, are implemented in Python/utils.py.
  • eacf, from the TSA library, is reimplemented in Python in Python/eacf.py. Note that it uses statsmodels' ACF, rather than R, which may lead to small numerical computation differences.
  • armasubsets, from the TSA library, is reimplemented in Python in Python/armasubsets.py. It uses its own subset search code, rather than relying on R's regsubsets library.
  • gBox, the generalized portmanteu test from the TSA library, is reimplemented in Python in Python/gBox.py. It expects a fitted model from Python's arch library, and it uses Numpy for linear filters and linear algebra calculations, statsmodels for ACF, and matplotlib for plotting.
  • Spectral density utilities from R are partially reimplemented in Python/spectrum.py, providing support for tapering, convolution with arbitrary kernels, and plotting, as adapted versions of R's state::spec.pgram and state::spec.ar.
  • Self-Exciting Threhold AutoRegression models, with 2 regions, are reimplemented in Python/tar.py. The OLS solver for statsmodels is used for the lower and upper regimes, but the general method signatures and return parameters are adapted from R TSA library, rather than shaped as statsmodels's regression objects.
  • The corresponding suite of nonlinearity tests (Keenan, Tsay, and threshold detection) are implemented in Python/nonlinearity_tests.py.

time-series-analysis's People

Contributors

telmo-correa avatar

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

Watchers

 avatar

time-series-analysis's Issues

Code License

Hi,

I currently try to port some R code to python and the code includes the function stats::spec.pgram. I tried your python implementation and it worked quite well.

Could you maybe add a permissive license to the code, so that I could reuse the code with minor changes?

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.