In [1]:
%matplotlib inline
import os, sys
sys.path.append(os.path.expanduser('~/work/git/cjs/bmlingam/'))
sys.path.append(os.path.expanduser('~/work/git/github/pymc-devs/pymc3/'))

from bmlingam.tests.test_infer_causality import test_infer_causality

test_infer_causality()


Artificial data is generated and saved as /tmp/tmppm6t2c17.csv
---- Algorithm parameters ----
Number of MC samples: 10000
Number of candidate models: 450

---- Data ----
Data loaded from /tmp/tmppm6t2c17.csv.
Data contains 100 samples.
Variable names: ['x1_dst' 'x2_src']

---- Inference for variables "x1_dst" and "x2_src" ----
Inferred  : x1_dst -> x2_src (posterior prob: 0.189, loglikelihood: -256.786)
(best_rev): x2_src -> x1_dst (posterior prob: 0.043, loglikelihood: -258.258)

Hyper parameters of the optimal model:
Causality      : var1 -> var2
Standardize    : True
subtract_mu_reg: False
fix_mu_zero    : True
prior_var_mu   : auto
prior_indvdl   : t
v_indvdl_1     : 0.200000
v_indvdl_2     : 0.200000
df_indvdl      : 8.000000
L_cov12/21     : -0.900000
dist_noise     : laplace

Hyper parameters of the reverse optimal model:
Causality      : var2 -> var1
Standardize    : True
subtract_mu_reg: False
fix_mu_zero    : True
prior_var_mu   : auto
prior_indvdl   : t
v_indvdl_1     : 0.200000
v_indvdl_2     : 0.200000
df_indvdl      : 8.000000
L_cov12/21     : 0.700000
dist_noise     : laplace


In [ ]: