-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparametersTemplate.m
120 lines (101 loc) · 5.07 KB
/
parametersTemplate.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
%% Sample script to set up the parameters object.
% You can not only assign values here, but have differential processing
% (e.g. to do different things on your desktop or cluster).
% Required members are described as they appear below.
%
%% Linear Sync Toolkit (linsync)
% Copyright (C) 2023 Joseph T. Lizier
% Distributed under GNU General Public License v3
clear parameters; % In case parameters previously held the name of the parameters file
% You can use this boolean to flag different folders for local and cluster runs:
if exist('/home/joseph/') > 0
isCluster = false;
else
isCluster = true;
end
% Set the location of the code library - only required for
% runComputeSyncResults which is designed for cluster use
if isCluster
parameters.syncToolkitPath = 'syncToolkit';
else
parameters.syncToolkitPath = '.';
end
% - N - Network size
parameters.N = 100;
% - b - b and c are weighting factors for the variational equation from Atay et al, SIAM 2006.
% b is the sum of all incoming weights for each node, including self.
% So (b - c) is the strength of coupling to previous state of the destination.
% For stability we require |b| < 1 when undirected, though b == 1 ensures
% zero-mode as an eigenvector (for our first sync paper we only use b =
% 1). Using this then does not guarantee stability in this case.
parameters.b = 1.0;
% - c - as above; c is the total strength of non-self coupling of the sources to the destinations.
% For stability we require |b - 2c| < 1 when undirected (though I don't
% think this guarantees stability if undirected).
% Can be an array to run experiments for each value (one of c or p can be
% an array)
parameters.c = 0.5;
% - undirected - whether it is an undirected network or not.
parameters.undirected = false;
% - discretized - whether the time-series is estimated from a discrete-time
% process (true) or use of exact method assuming continuous-time process (false)
parameters.discretized = false;
% - repeats - how many networks to sample with each parameter set.
% Want to have this as a large number for good sampling; setting it
% to a small number here so that any test run with this script runs
% quickly.
parameters.repeats = 2;
% - networkType. Options are:
% - 'rand' - random network
% - 'randFixedD' - random network with fixed in-degree
% - 'randRing' - a ring network with randomly rewired edges (Watts-Strogatz model).
parameters.networkType = 'randRing';
% Next 2 arguments that follow depend on which network type was requested:
% - p - is interpreted as either: connection probability for rand or randFixedD
% (disconnected networks are rejected), or rewiring probability for randRing
% Can be an array (instead of c), such that we will run over all values of p.
parameters.p = [0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0];
% - d - degree for randRing network type. d/2 links on either side of the
% node.
parameters.d = 4;
% - S - number of samples for the empirical calculation
% (known as L in our first sync paper). Need very large
% if you want high accuracy; see e.g. Fig 4 in Barnett (2009), though
% with large \lambda's (e.g. for regular network) our errors will be
% larger again. Try at least 1000.
% If S==0, then we won't run any empirical calculations, just make the
% analytic calculations.
% Must be a scalar; put arrays for iterating over multiple values
% into SRangeToPlot if using runComputeSyncResults etc
parameters.S = 0;
% runComputeSyncResults (on cluster) or plotErrorInEmpiricalSyncResults
% use the full range in the following:
parameters.SRangeToPlot = 0;
% - maxMotifLength - for continuous process, this is the max motif length (m)
% to make the sync approximations up to; for discrete process, this is the maximum walk
% length (u) to make the sync approximations up to (this is half the motif size,
% since the relevant motif here is two converging walks of the same size u).
parameters.maxMotifLength = 50;
% - folder - directory where all of the files are to be stored.
if isCluster
parameters.folder = './results/N100-randRing-d4-b1.00-c0.50-dir-k4-cont/[@P1]';
else
parameters.folder = './';
end
% combineResultsFrom - in the case of a cluster run, we will want to combine
% the results which are in various files in folders under this folder.
% They will be saved back to the parameters.folder above
parameters.combineResultsFrom = './results/clusterResults/';
% MaxK - maximum number of iterations for solving the power series for the
% covariance matrix.
% For the regular networks with small d (and therefore higher c/d), need up
% to tens of thousands of iterations; seems safe at 100000.
% Can leave it like this for all runs; they will terminate early when
% converging anyway.
parameters.MaxK = 100000;
% dt - time interval for iterating the exact method (continuous time). Ignored for discrete time.
parameters.dt = 1;
% randSeed - seed for Matlab's random number generator. Set to 'shuffle' to
% see back on current time (important for cluster runs so they are all
% different) or an integer to save repeatable runs.
parameters.randSeed = 'shuffle';