9
10
3
4
5
1
2
6
7
8
11
23
24
25
30
31
32
33
26
27
28
29
34
35
36
37
38
39
40
41
42
16
17
18
19
12
13
14
15
20
21
22
Supplementary Material for: Social networks in changing environments
Behavioral Ecology and Sociobiology
A.D.M. Wilson*, S. Krause, I.W. Ramnarine, K.K. Borner, R.J.G. Clement, R.H.J.M.
Kurvers & J. Krause
*Centre for Integrative Ecology, Deakin University, 75 Pigdons Road, Waurn Ponds, Victoria
3216 Australia
*Corresponding Author:alexander.wilson@ymail.com
Markov chain modelling approach and parameter estimation
Our observations consist of sequences of ‘behavioural states’. In the presence of k potential neighbours at each time point a focal fish can either be with a nearest neighbour g
, 1 ≤ g ≤ k , denoted by s g
or alone (no conspecific within 4 body lengths) denoted by a . A focal fish is regarded as being social, if it is in state s g
for some neighbour g . ‘Being social’ is not an explicit state in the model, but is implicitly defined by the set of states s
1
... s k
. Following
Wilson & Krause et al. (2014) we used the three probabilities p leave_nn
= Prob(state n+1
≠ s g
| state n
= s g
). p s
a
= Prob(state n+1
= a | state n
{ s
1
, ..., s k
}), and p a
s
= Prob(state n+1
{ s
1
, ..., s k
} | state n
= a ) to construct a model that describes the transitions between these states. Here, p leave_nn
denotes the probability of leaving the current nearest neighbour, and p s
a
( p a
s
) the probability that the focal fish will be alone (social) in the next state when it is currently social (alone). These probabilities can be estimated based on relative frequencies (Fink 2008). Following Wilson &
Krause et al. 2014 we did not take the specific individual identities into account when estimating the model probabilities, i.e. we counted the state changes regardless of the individual identities. Therefore, our model describes the general dynamics common to all observed individuals. Figure 1 in the main text shows a graphical representation of the resulting model. Its probabilities define the transition probabilities of a (first-order) Markov chain without having to introduce any further assumptions or parameters.
From these probabilities the probability p switch_nn
(of switching the nearest neighbours while staying social) and p retain_nn
(of retaining the nearest neighbour) can be derived as follows. p switch_nn
= p leave_nn
p s
a
. p retain_nn
= 1
p switch_nn
p s
a
.
72
73
74
75
76
77
66
67
68
69
70
71
59
60
61
62
63
64
65
78
79
80
81
82
83
84
85
86
52
53
54
55
56
57
58
43
44
45
46
47
48
49
50
51
A Markov model can be used to produce state sequences by simply ‘running’ the model. In our case, this allows predictions regarding the frequency distributions of the lengths of contact with a specific neighbour, of phases of being social, and of phases of being alone. These predictions can be used to analyse the goodness of fit of our model, which is described in more detail in the next section.
Goodness of fit of the Markov chain model
The time spent in a state of a Markov chain follows a geometric distribution. In our study system this means, the frequencies of phase lengths of, e.g., being social should decrease exponentially with increasing phase length. To compare the model predictions with the observed data we simulated observations of the model’s behaviour where we took into account the 2 min observation time per focal individual. This is necessary because incompletely observed phases (that started or ended outside the observation period) will lead to higher numbers of short phases than theoretically expected. We repeated the simulation 10
4 times and computed the mean frequencies and the 2.5% and 97.5% percentiles for each phase length. The simulation was based on the estimated probabilities and did not take into account their confidence intervals. Therefore, the predicted percentile ranges are conservative. Our results show that the observed data are well approximated by the model predictions (Figure
S1).
Movement simulation
In order to construct a movement simulation that can be used as a null model for the investigation of density changes we tried to introduce as few parameters as possible. We used a discrete-time simulation where between two successive time points an individual can be moving or resting. At each time point, an individual can retain its state (moving or resting) with fixed probabilities p moving
and p resting
, respectively, or change it. A moving individual moves by a fixed distance l in a direction given by the individual’s heading h . Additionally, at each time point an individual can decide to change its heading with probability p change_heading
.
A new heading is computed by adding a randomly chosen value α to the current heading.
We tried out two different probability distributions for α, a uniform distribution on the range
(-π/2, +π/2) and a von Mises distribution, which is a circular analogue of the normal distribution, on the range (-π, +π) with concentration 1. This choice had little influence on our results and the trends were exactly the same. Therefore, we decided to only use the von Mises distribution as it seemed more natural. We also tried out two different ways to define the simulation ‘world’ in which the individuals move, a circle with fixed radius r and a torus constructed from a square by pasting the opposite edges together. Our results did not seem to depend very much on these variants and we decided to use a circular world with a fixed radius as this seemed more natural to us. However, in this case we need to prevent individuals from
‘leaving’ the simulation world. We did this by letting individuals that are about to leave choose a new heading (using the von Mises distribution) until a movement in this direction of length l is within the circle.
111
112
113
114
115
116
117
118
119
120
102
103
104
105
106
107
108
109
110
97
98
99
100
101
87
88
89
90
91
92
93
94
95
96
Summarized, our movement simulation consists of the 3 probabilities p moving
, p resting
, and p change_heading
, the step length l , and the choices regarding the probability distribution of heading changes and the shape and size of the simulation world. To be able to draw comparisons with our real observations we additionally introduced a distance d that defines the distance within which two individuals are regarded as ‘neighbours’ having social contact.
We examined a wide range of parameter settings for the 3 probabilities, the step length l , and the distance d and found that regardless of the settings a) the lengths of contact with a particular neighbour, of being social and of being alone could be described by a Markov chain model with parameters estimated from the simulated movements and b) the estimated model probabilities p a
s
(of ending being alone) and p switch_nn
(of switching the current neighbour) increased with increasing density always following the same pattern (a linear function, see
Figure S2 for an illustration of this for specific parameter settings). This means, although we do not know whether our movement simulation exactly describes the real movements of our fish it makes sense to use the movement model to assess the influence of density changes on the estimated model probabilities p a
s
and p switch_nn
. The same holds for the probability p s
a
(of ending being social) which equals p leave_nn
- p switch_nn
and therefore decreases with increasing density. The probability p leave_nn
(of leaving the current neighbour) does not depend on the density (however, see the remarks in the next paragraph). By changing the number of individuals or the radius r of the simulation world while keeping constant all other parameters of the movement simulation we can investigate the relative magnitude of changes to the model probabilities caused by increased or decreased density.
We found that the probability p leave_nn
slightly increased with increasing density although these changes were very minor (Figure S2). One reason for this might be that with higher density it happens more often that the nearest neighbour of the focal individual changes because a third individual approaches the focal individual. This leads to shorter contact phases with the same individual and thus increases p leave_nn
.
References
Fink GA (2008) Markov Models for Pattern Recognition. Springer-Verlag
130
131
132
133
134
135
136
137
138
139
140
141
121
122
123
124
125
126
127
128
129
Figures
Figure S1. Frequency distributions of the lengths of contact with a particular nearest neighbour, the lengths of social contact, and the lengths of being alone in the observed data
(circles) before manipulations for a) pool 1a, b) pool 1b, c) pool 2, and d) pool 3. Also shown are the means (x’s) and the 2.5% and 97.5% percentiles as predicted by our Markov chain models.
(Note that 0 values cannot be displayed in a logarithmic plot and are omitted.)
Figure S2. Markov chain model probabilities p leave_nn
(open circles), p s
a
(filled circles), p a
s
(squares), and p switch_nn
(triangles) as a function of the density. The R-squared values of all fitted lines were > 0.98. The size of the simulated world was constant and the number of individuals was increased to increase the density. Note that the density values do not have an absolute meaning because the size of the world does not have any unit. The probabilities were estimated from ‘observations’ of simulated movements. The simulation parameters were set to the values p moving
= 0.05, p resting
= 0.2, p change_heading
= 0.05, l = 0.025, and d = 0.1.
d) c) b)
Figure S1 a)
Contact with a particular neighbour
2 4 6 8
Number of consecutive time points
10
Contact with a particular neighbour
2
2
4 6 8
Number of consecutive time points
10
Contact with a particular neighbour
4 6 8
Number of consecutive time points
10
Contact with a particular neighbour
2 4 6 8
Number of consecutive time points
10
12
12
12
12
177
178
179
180
181
182
171
172
173
174
175
176
158
159
160
161
162
163
164
165
166
167
168
169
170
183
184
185
151
152
153
154
155
156
157
142
143
144
145
146
147
148
149
150
Social contact
2 4 6 8
Number of consecutive time points
10 12
Social contact
2 4 6 8
Number of consecutive time points
10 12
Social contact
2 4 6 8
Number of consecutive time points
10 12
Social contact
2 4 6 8
Number of consecutive time points
10 12
Being alone
2 4 6 8
Number of consecutive time points
10 12
Being alone
2 4 6 8
Number of consecutive time points
10 12
Being alone
2 4 6 8
Number of consecutive time points
10 12
Being alone
2 4 6 8
Number of consecutive time points
10 12
Figure S2
6
195
196
197
198
199
200
201
202
203
186
187
188
189
190
191
192
193
194
8 10
Density
12 14