iisayoo / johansen Goto Github PK
View Code? Open in Web Editor NEWPython implementation of the Johansen test for cointegration
License: MIT License
Python implementation of the Johansen test for cointegration
License: MIT License
When first importing johansen
(in python3), it gives me a "module not found error".
Prior, it also gave me errors relating to python 2 vs 3 in the johansen.py
file, but I edited those to conform to python 3.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-a1c691410a6a> in <module>()
----> 1 import johansen
~/.local/lib/python3.6/site-packages/johansen/__init__.py in <module>()
----> 1 from .johansen import Johansen
~/.local/lib/python3.6/site-packages/johansen/johansen.py in <module>()
2 from statsmodels.tsa.tsatools import lagmat
3
----> 4 import critical_values
5
6
ModuleNotFoundError: No module named 'critical_values'
However, in ~/.local/lib/python3.6/site-packages/johansen
, the critical_values.py
file is there!
This question / problem may be better suited for StackOverflow--however I thought I would try here.
Any insight is appreciated.
Edit: added sys.path.append('/home/theo/.local/lib/python3.6/site-packages/johansen')
andimport johansen
worked properly, however from johansen import coint_johansen
did not work properly.
Hi dear,
Thanks for these awesome scripts. One question I have is that when johansen() returns eigenvectors and rejected_r_values, if r=x null hypothesis got rejected, should we append x+1 into the rejected_r_values list?
My idea is that if we rejected the null hypothesis r=0 , we should have 1 (using maxeigen) or 3(using trace) cointegrating vectors, therefore we should append r=1 into the rejected_r_values list.
For example,
rejected_r_values = []
for r in range(m):
if self.h_test(eigenvalues, r):
rejected_r_values.append(r+1)
In your notebook example, where the johansen function returns r=[1], I don't quite understand how you get r=[1] only. Because in the johansen function, rejected_r_values should be like [0,1]. Could you elaborate more on this? Thank you so much!
Once again, thanks for the awesome work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.