Module Import alias identifier Import alias identifier ImportFrom alias Import alias Expr Call NameLoad AttributeLoad NameLoad attr ImportFrom alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num Num Num body Expr Str Assign NameStore Dict Str Str NameLoad NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assert Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr keyword Str keyword TupleLoad Num Num Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr keyword Str keyword TupleLoad Num Num Assign NameStore Num Assign NameStore ListLoad Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body Print Str NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp AttributeLoad AttributeLoad NameLoad attr attr comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp AttributeLoad AttributeLoad NameLoad attr attr comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpFloorDiv NameLoad Num Assign NameStore Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice NameLoad Ellipsis attr keyword Num Assign NameStore Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice NameLoad Ellipsis attr keyword Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call AttributeLoad NameLoad attr Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list Expr Call NameLoad
N/A N/A numpy np N/A matplotlib.pyplot plt sklearn.metrics roc_auc_score N/A pyhawkes.models N/A N/A reload N/A pyhawkes models pyhawkes.models DiscreteTimeNetworkHawkesModelSpikeAndSlab N/A N/A N/A N/A np random seed 0 demo N/A N/A K T dt_max p N/A 3 1000 20 0.25 N/A N/A 

    :param K:       Number of nodes
    :param T:       Number of time bins to simulate
    :param dt_max:  Number of future time bins an event can influence
    :param p:       Sparsity of network
    :return:
     N/A network_hypers N/A p allow_self_connections p False N/A true_model N/A DiscreteTimeNetworkHawkesModelSpikeAndSlab K K dt_max dt_max network_hypers network_hypers N/A N/A N/A true_model check_stability N/A N/A S R N/A N/A true_model generate T T keep True print_interval 50 N/A N/A N/A plt ion N/A N/A true_figure _ N/A N/A true_model plot color #377eb8 T_slice N/A 0 100 N/A test_model N/A DiscreteTimeNetworkHawkesModelSpikeAndSlab K K dt_max dt_max network_hypers network_hypers N/A N/A N/A test_model add_data S N/A N/A test_figure test_handles N/A N/A test_model plot color #e41a1c T_slice N/A 0 100 N/A N_samples 100 N/A samples N/A N/A lps N/A N/A itr N/A xrange N_samples N/A N/A Gibbs iteration  itr N/A N/A N/A test_model resample_model N/A N/A N/A lps append N/A N/A test_model log_probability N/A N/A N/A samples append N/A N/A test_model copy_sample N/A N/A N/A test_model plot handles test_handles N/A N/A analyze_samples true_model samples lps N/A analyze_samples N/A N/A true_model samples lps N/A N/A N/A N_samples N/A len samples N/A A_samples N/A N/A np array N/A N/A N/A s weight_model A N/A s samples N/A W_samples N/A N/A np array N/A N/A N/A s weight_model W N/A s samples N/A lps N/A N/A np array lps N/A offset N/A N_samples 2 N/A A_mean N/A N/A N/A A_samples N/A N/A offset N/A mean axis 0 N/A W_mean N/A N/A N/A W_samples N/A N/A offset N/A mean axis 0 N/A N/A N/A plt figure N/A N/A N/A plt plot N/A N/A np arange N_samples lps k N/A N/A N/A plt xlabel Iteration N/A N/A N/A plt ylabel Log probability N/A N/A N/A plt show N/A auc_A_mean N/A roc_auc_score N/A N/A N/A N/A true_model weight_model A ravel N/A N/A A_mean ravel N/A auc_W_mean N/A roc_auc_score N/A N/A N/A N/A true_model weight_model A ravel N/A N/A W_mean ravel N/A aucs N/A N/A A A_samples N/A N/A N/A N/A aucs append N/A roc_auc_score N/A N/A N/A N/A true_model weight_model A ravel N/A N/A A ravel N/A N/A N/A plt figure N/A N/A N/A plt plot aucs -r N/A N/A N/A plt plot N/A auc_A_mean N/A N/A np ones_like aucs --r N/A N/A N/A plt plot N/A auc_W_mean N/A N/A np ones_like aucs --b N/A N/A N/A plt xlabel Iteration N/A N/A N/A plt ylabel Link prediction AUC N/A N/A N/A plt show N/A N/A N/A plt ioff N/A N/A N/A plt show N/A N/A N/A demo