Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Penchants and leanings #153

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft

Penchants and leanings #153

wants to merge 30 commits into from

Conversation

kahaaga
Copy link
Member

@kahaaga kahaaga commented Dec 1, 2021

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 kahaaga marked this pull request as draft December 1, 2021 05:33
@kahaaga
Copy link
Member Author

kahaaga commented Dec 1, 2021

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.

@Datseris
Copy link
Member

Datseris commented Dec 1, 2021

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?

@kahaaga kahaaga mentioned this pull request Dec 1, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2021

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%> (ø)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants