Associations.jl icon indicating copy to clipboard operation
Associations.jl copied to clipboard

Penchants and leanings

Open kahaaga opened this issue 3 years ago • 3 comments

An implementation of the penchants and leanings algorithms from McCracken and Weigel (2016), which is meant for exploratory causal inference. Addresses #28.

The docs are here.

kahaaga avatar Dec 01 '21 04:12 kahaaga

Hey @Datseris,

If you have time, could you check out the Github Action error logs for the most recent tests in this PR?

The tests fail due to what seems to an error in DelayEmbeddings when constructing Datasets from multiple time series. I cannot reproduce the error when running the tests in a clean Julia environment locally, though.

Pairwise asymmetric inference: Error During Test at /home/runner/work/CausalityTools.jl/CausalityTools.jl/test/methods/test_crossmapping.jl:12
230
  Test threw exception
231
  Expression: pai(x, y, 3, 1) isa Float64
232
  The function body AST defined by this generated function is not pure. This likely means it contains a closure, a comprehension or a generator.
233
  Stacktrace:
234
   [1] Dataset(::Vector{Float64}, ::Vararg{Vector{Float64}})
235
     @ DelayEmbeddings ~/.julia/packages/DelayEmbeddings/rap7T/src/dataset.jl:189

The function body AST defined by this generated function is not pure. This likely means it contains a closure, a comprehension or a generator.

Have you seen this error before? I have no experience with generated functions, so I don't know currently how to resolve this, or where to start looking.

EDIT: The logs specify that DelayEmbeddings v2.0.1 gets installed when running CI test. This is the most recent version of the package. Tests don't seem to fail for DelayEmbeddings, so I am not sure what causes this.

kahaaga avatar Dec 01 '21 09:12 kahaaga

Ihaven't seen this before no, but indeed delay embeddings are done using generated functions. I guess simply assinging x = delay... and then @test x isa .... will solve it?

Datseris avatar Dec 01 '21 10:12 Datseris

Codecov Report

Merging #153 (c8607c8) into master (934cfec) will increase coverage by 0.58%. The diff coverage is 77.94%.

@@            Coverage Diff             @@
##           master     #153      +/-   ##
==========================================
+ Coverage   70.64%   71.22%   +0.58%     
==========================================
  Files          39       42       +3     
  Lines         780      848      +68     
==========================================
+ Hits          551      604      +53     
- Misses        229      244      +15     
Impacted Files Coverage Δ
src/CausalityTools.jl 100.00% <ø> (ø)
src/Leanings/example.jl 0.00% <0.00%> (ø)
...ple_systems/discretemaps/nonlinear_sindriver_2d.jl 0.00% <0.00%> (ø)
src/Leanings/penchants.jl 100.00% <100.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

codecov-commenter avatar Dec 01 '21 14:12 codecov-commenter