mschauer / CausalInference.jl

Causal inference, graphical models and structure learning in Julia
https://mschauer.github.io/CausalInference.jl/latest/
Other
189 stars 24 forks source link

Heisenbug #116

Closed mschauer closed 1 year ago

mschauer commented 1 year ago

MWE

using CausalInference, DataFrames

# Generate some sample data to use with the PC algorithm

N = 1000 # number of data points
p = 0.1

# define simple linear model with added noise
N = 20
A = rand(N)
C = rand(N) + 0.4 .* A
F = rand(N) + 0.5 .* C
B = rand(N)
E = rand(N) + 0.4 .* B
H = rand(N) + 0.5 .* E
G = rand(N) + 0.4 .* F
H = rand(N) + 0.5 .* G
D = rand(N) + 0.2 .* A + 0.3 .* B
F += 0.9 .* D
H += 0.95 .* D
df = DataFrame(A=A, B=B, C=C, D=D, E=E, F=F, G=G, H=H)

println("\nPcalg cmi df")
est_pcalg_cmi_df = pcalg(df, p, cmitest)
est_pcalg_cmi_df |> display

Originally posted by @goedman in https://github.com/mschauer/CausalInference.jl/issues/102#issuecomment-1685286572

goedman commented 1 year ago

I'll try it as soon as we're landing! Thanks.

goedman commented 1 year ago

This seems to have fixed it. Just ran both test programs and both no longer produced the internal error. I will do some more check after my arrival in Amsterdam (flying from DC to Amsterdam). Thanks for your super quick response!

goedman commented 1 year ago

Hi @mschauer

Just now confirmed that the internal error no longer shows up.

Rob