Hello. I’m new in Julia, but I need some performance so I’m rewriting from R and Python to Julia but I have problems with built-in functions. I know that Julia is not as wide as R and Python, but I was sure that I would find typical stats tests.
But I have problems with 2 of them:
- Johansen cointegration test and VECM modeling
- Durbin Watson autocorrelation test
Could you please give me some links for repos or packages for that?
- DW in Python and R:
from statsmodels.stats.stattools import durbin_watson
res = durbin_watson(x_norm) # 2.1573
if(!require(car)){install.packages('car')}
res <- durbinWatsonTest(x_norm) # 2.1573
Julia has DurbinWatsonTest
from HypothesisTests.jl
says “X is the matrix of regressors from the original regression model and e the vector of residuals. Note that the Durbin-Watson test is not valid if X includes a lagged dependent variable.”
DurbinWatsonTest(X::AbstractArray, e::AbstractVector; p_compute::Symbol = :ndep)
What? I just need to run something like dw([1, -1, 1, -1])
on the vector and get results. Why regression, why all this stuff?
- About cointegration and VECM - nothing at all. I have got some code that was written in Julia 0.3 almost 10 years ago with even another keyword for struct - “type”, and it doesn’t work. And it contains a few thousands of lines.
In Python and R :
from statsmodels.tsa.vector_ar import vecm; vecm.coint_johansen(***)
library(ursa); ca.jo(***)
Maybe you know where I can find this tests, and not rewriting them from scratch?