@@ -2855,7 +2855,6 @@ def _run_pcalg_test(self, graph, i, abstau, j, S, lagged_parents, max_conds_py,
28552855 val , pval , dependent = self .cond_ind_test .run_test (X = [(i , - abstau )], Y = [(j , 0 )],
28562856 Z = Z , tau_max = tau_max ,
28572857 alpha_or_thres = alpha_or_thres ,
2858- # verbosity=self.verbosity
28592858 )
28602859
28612860 return val , pval , Z , dependent
@@ -3925,7 +3924,8 @@ def _optimize_pcmciplus_alpha(self,
39253924
39263925if __name__ == '__main__' :
39273926 from tigramite .independence_tests .parcorr import ParCorr
3928- from tigramite .independence_tests .cmiknn import CMIknn
3927+ from tigramite .independence_tests .regression_ci import RegressionCI
3928+ # from tigramite.independence_tests.cmiknn import CMIknn
39293929
39303930 import tigramite .data_processing as pp
39313931 from tigramite .toymodels import structural_causal_processes as toys
@@ -4009,39 +4009,20 @@ def _optimize_pcmciplus_alpha(self,
40094009 # data, _ = toys.structural_causal_process(links_coeffs, T=T, seed=3)
40104010 # T, N = data.shape
40114011
4012- # # Initialize dataframe object
4013- # dataframe = pp.DataFrame(data)
4014- # pcmci = PCMCI(
4015- # dataframe=dataframe,
4016- # cond_ind_test=ParCorr(),
4017- # verbosity=0)
4018-
4019- # multidata[0][40:100, :] = 999.
4020-
4021- # dataframe = pp.DataFrame(multidata, analysis_mode='multiple',
4022- # missing_flag = 999.,
4023- # time_offsets = {0:50, 1:0}
4024- # # reference_points=list(range(500, 1000))
4025- # )
4026-
4027- # pcmci = PCMCI(dataframe=dataframe,
4028- # cond_ind_test=ParCorr(verbosity=0), verbosity=0)
40294012
4030- # # results = pcmci.run_pcmciplus(tau_max=1)
4013+ multidata = np .random .randn (10 , 100 , 5 )
4014+ data_type = np .zeros ((10 , 100 , 5 ), dtype = 'bool' )
4015+ data_type [:,:,:3 ] = True
40314016
4032- # results = pcmci.run_sliding_window_of(
4033- # window_step=499, window_length=500,
4034- # method='run_pcmciplus', method_args={'tau_max':1,
4035- # 'link_assumptions':{
4036- # 0: {(0, -1): '-->'},
4037- # 1: {(1, -1): '-->', (0, -1): '-!>'},
4038- # }
4039- # })
4017+ dataframe = pp .DataFrame (multidata ,
4018+ data_type = data_type ,
4019+ analysis_mode = 'multiple' ,
4020+ missing_flag = 999. ,
4021+ time_offsets = {0 :50 , 1 :0 }
4022+ # reference_points=list(range(500, 1000))
4023+ )
40404024
4041- # # tp.plot_graph(results['graph'])
4042- # print(multidata[0].shape, multidata[1].shape)
4043- # print(results['window_results']['val_matrix'])
4044- # print(results['window_results']['val_matrix'][0][0,1])
4045- # print(results['window_results']['val_matrix'][1][0,1])
4025+ pcmci = PCMCI (dataframe = dataframe ,
4026+ cond_ind_test = RegressionCI (verbosity = 0 ), verbosity = 0 )
40464027
4047- # plt.show( )
4028+ # results = pcmci.run_pcmciplus(tau_max=1 )
0 commit comments