-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain_sim_1N_high_freq.m
36 lines (24 loc) · 1.68 KB
/
main_sim_1N_high_freq.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
%%%%------------------ Configure Simulation--------------------------------
model_true.show_all_plots = true; % if true, all plots for all signal fits will be
% ... will be output. If false, only print-out of
% ... results will be shown.
%%% Simulation parameters
model_true.true_coefficients = single_node_high_freq ;
model_true.model_coefficients = model_true.true_coefficients;
model_true.sampling_frequency = 500; % sampling frequency of signal in Hertz.
model_true.T = 2; % time in seconds of window
model_true.noise = 0.25; % standard deviation of the noise
model_true.taxis = (1/model_true.sampling_frequency):(1/model_true.sampling_frequency):model_true.T;
%%% Define model inputs for spline Granger & standard Granger
model_true.s = 0.5; % spline tension paramter
model_true.estimated_model_order = 30; % history dependence in model (samples)
model_true.cntrl_pts =0:5:model_true.estimated_model_order; % control points
%%% Define network testing parameters
model_true.q = 0.05; % FDR parameter: acceptable proportion of false discoveries
model_true.nsurrogates = 10000; % Number of surrogates used for bootstrap coefficients
%%%---------------------- Simulate data -----------------------------------
model_true = simulate_data(model_true);
%%%-------- Infer networks using standard-Granger and spline-Granger-------
[model_true, model_spline, model_standard] = infer_nets(model_true);
%%% ---------------------- Check goodness of fit -------------------------
model_testing;