geotrait.md 3.92 KB
Newer Older
Victor's avatar
Victor committed
1
2
3
# The geotrait
> This note has been taken from `2Y/articles/geotrait/mathematical_notes.md`

Victor's avatar
Victor committed
4
5
6
!!! note "'note' admonition"
    In Landscape Ecology, it is of particular interest to study the geographical position of the lineage through time. This is because richness patterns are thought to arise through allopatric speciation, where populations get separated in space and time. This is the topic of the following section.

Victor's avatar
Victor committed
7
8
9
10
11
## Julia accessors
An agents of type `Agent{Ancestors{true}}` stores the values of its ancestors traits. From it, one can thus study the history of the lineage.

## Projection of the geographic history

Victor's avatar
Victor committed
12
Consider a set of individuals which lineage geographical history has been stored in a vector ``x^{(i)}(t)``. If individual ``i`` was born at time ``t^*`` then ``x^{(i)}(t>t^*)`` represents its geographical position, while ``x^{(i)}(t<t^*)`` represents its ancestors geographical position.
Victor's avatar
Victor committed
13
14
15
16
17

### Isolation in time
We want to account for the isolation in time and possibly in space of the lineage of a given individual. That is, for how long and how distant stay lineages appart?

#### Setting
Victor's avatar
Victor committed
18
Consider a discrete setting, where ``N(t)`` individuals (or populations) evolve over a set of ``M`` demes disposed in a linear fashion, such that ``x^i(t) \in \{1,2,...,M\}``. The population is characterised by the counting measure
Victor's avatar
Victor committed
19
20
21
22
23
```math
\nu = \sum_i^{N(t)} \delta_{x^i(t)}
```


Victor's avatar
Victor committed
24
We define the geographical history hamming distance ``\mathfrak{g}`` as
Victor's avatar
Victor committed
25
26
27
28
```math
\mathfrak{h}\big(x^{(i)}(t),x^{(j)}(t)\big) = \int_0^t \text{ceil}(\frac{|x^{(i)} - x^{(j)}|(s)}{M-1})ds
```

Victor's avatar
Victor committed
29
We extend this definition with the measure ``\mathfrak{h}^*`` which takes into account geographic distance
Victor's avatar
Victor committed
30
31
32
33
```math
\mathfrak{h}^*\big(x^{(i)}(t),x^{(j)}(t)\big) = \int_0^t \Big[x^{(i)} - x^{(j)} \Big]^2(s)\, ds
```

Victor's avatar
Victor committed
34
Finally, we introduce the geotrait distance ``\mathfrak{g}`` as
Victor's avatar
Victor committed
35
36
37
38
39
40
41
42
43
```math
\mathfrak{g}\big(x^{(i)}(t),x^{(j)}(t)\big) = \Big[\int_0^t (  x^{(i)} - x^{(j)} )(s) \, ds\Big]^2
```

Note that by the triangle inequality we have that

```math
\mathfrak{g}\big(x^{(i)}(t),x^{(j)}(t)\big) \leq \mathfrak{h}^*\big(x^{(i)}(t),x^{(j)}(t)\big)
```
Victor's avatar
Victor committed
44
Equality should arises if ``x^{(i)}, x^{(j)}`` are positively linearly dependent (which should not be the case).
Victor's avatar
Victor committed
45

Victor's avatar
Victor committed
46
However, what we are eventually interested is a population measure. This measure should be related to the average pairwise distance across the population. Hence we define ``\mathcal{D_d}(\nu,t)`` such that
Victor's avatar
Victor committed
47
48
49
50
51

```math
\mathcal{D_d}(\nu,t) = \frac{1}{2N^2}\sum_i^N  \sum_j^N d(x^{(i)},x^{(j)},t)
```

Victor's avatar
Victor committed
52
Let ``g^{(i)}(t) = \int_0^t x^{i}(t) dt`` and ``G(t) = \{g^{(i)}(t), i \in \{1,2,\dots,N(t)\}\}``. By observing the following
Victor's avatar
Victor committed
53
54
55
56
57
58
59

```math
\frac{1}{2N^2}\sum_{i,j}^N (y_i-y_j)^2 \\=
 \frac{1}{2N^2}\sum_{i,j}^N ((y_i-\bar{y}) -(y_j-\bar{y}))^2 \\
 = \frac{1}{2N^2} 2N \sum_i^N(y_i-\bar{y})^2 = \text{Var}(Y)
```

Victor's avatar
Victor committed
60
Thus we have ``\mathfrak{g}\big(x^{(i)}(t),x^{(j)}(t)\big) = [g^{(i)}(t) - g^{(j)}(t)]^2``  and hence
Victor's avatar
Victor committed
61
62
63
64
```math
    \mathcal{D_\mathfrak{g}}(\nu,t) = \text{Var}(G).
```

Victor's avatar
Victor committed
65
Also  remark that
Victor's avatar
Victor committed
66
67
68
69
70
71
72
73
74

```math
\mathcal{D_{h^*}}(\nu,t) = \frac{1}{2N^2}\sum_i^N  \sum_j^N h^*(x^{(i)},x^{(j)},t) \\
= \frac{1}{2N^2}\sum_i^N  \sum_j^N  \int_0^t \Big[x^{(i)} - x^{(j)} \Big]^2(s)\, ds \\
= \int_0^t  \frac{1}{2N^2}\sum_i^N  \sum_j^N  \Big[x^{(i)} - x^{(j)} \Big]^2(s)\, ds \\
= \int_0^t \text{Var}(X)(s)ds

```

Victor's avatar
Victor committed
75
One could also imagine a value ``h^{(i)}(t) = \frac{1}{2N}\sum_j^{N(t)}\mathfrak{h}^*\big(x^{(i)}(t),x^{(j)}(t)\big)`` and in this case we would have
Victor's avatar
Victor committed
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
```math
    \mathcal{D_\mathfrak{h}}(\nu,t) = \frac{1}{N}\sum_i^{N(t)} h^{(i)}(t)
```

### Mobility
How much do lineages move?

Here is a time average of the speed
```math
    \frac{1}{N} \sum_i < \partial_t x^{(i)}(t) >_t \\
    =  \frac{1}{N} \sum_i \int_0^t \partial_s x^{(i)}(s) ds \\
    = \frac{1}{N} \sum_i [x^{(i)}(t) - x^{(i)}(0))]
```

But one could also have a moving average, that is, averaging
```math
    \frac{1}{N} \sum_i \sum_j \int_{j\tau}^{j(\tau+1)} \frac{1}{\tau} \partial_s x^{(i)}(s) ds
Victor's avatar
Victor committed
93
```