Spatial Regression Analysis ContinuedΒΆ

These are the libraries we will be using

In [78]:
library(pdist)
library(MASS)
library(INLA)
library(reshape2)
library(maptools)
library(ggplot2)

And this is some code that will become handy at some point during the exposition. The files will be uploaded in the course web page.

In [79]:
source("kernels.R")
source("gps.R")

Some initial adjustments to define the plots size, and we are ready to go...

In [80]:
options(repr.plot.width=5, repr.plot.height=3)
#install.packages("Cairo", repos='http://cran.us.r-project.org')

iid and beyondΒΆ

Let yi=β0+β1xi+fi, with fi∼N(0,1).

Say Ξ²0=2 and Ξ²1=1/3. For a random realization of fi's we would have something like this:

In [81]:
num_sims <- 50
beta_0 <- 2
beta_1 <- 1/3
mu = 0
sigma = 1
x <- seq(-10, 10, len = num_sims) # Lets use an evenly spaced set of inputs
f <- rnorm(num_sims, mu, sigma) # random realizations of f
xy <- data.frame(x = x, f = f, y = beta_0  + beta_1 * x + f)

ggplot(xy, aes(x, y)) + geom_point(col = "steelblue") + 
geom_line(aes(x,y-f), col = "maroon")+ ylim(-10,10) + theme_bw()

Now we are going to remove Ξ²0 and Ξ²1βˆ—x and focus only on what is going on with f.

In [82]:
ggplot(xy, aes(x, f)) + 
  geom_line(linetype=2, col = "gray") + 
  geom_point(col = "steelblue") +
  theme_bw()

Not very interesting since all the fi are iid.

We can think of the vector f as being generated by a Multivariate Normal, with mean zero and covariance matrix: Iσ2.

The covariance matrix would look like this:

In [83]:
diag(num_sims)[1:5, 1:5]
Out[83]:
10000
01000
00100
00010
00001

Let's assume that f=f(x). This assumption doesn't change anything so far.

But what would happen if fi were not iid., and their pairwise correlations dependend on the values xi,xj?

Exponentiated Quadrtic KernelΒΆ

Also know as RBF kernel. For any pair of points xi,xj, the covariance is given by the function:

k(xi,xj)=Οƒ2exp(βˆ’(xiβˆ’xj)22β„“2)ΒΆ

In [84]:
# First we need some data to use in the explanation
x1 <- matrix(0, nrow = 1, ncol = 1)
x2 <- matrix(seq(- 10, to = 10, length.out = 100), ncol = 1)
k <- rbf_kern(x1, x2, var = 1, lengthscale = 1)
plot_kernel(x1, x2, k)

The plot above is using Οƒ=1 and β„“=1. What happens with different values of Οƒ?

In [85]:
sigma <- .5
lengthscale <- 1
k <- rbf_kern(x1, x2, var = sigma^2, lengthscale = lengthscale)
plot_kernel(x1, x2, k)

Now different values of β„“.

In [86]:
sigma <- 1
lengthscale <- 3
k <- rbf_kern(x1, x2, var = sigma^2, lengthscale = lengthscale)
plot_kernel(x1, x2, k)

In our initial example, we had these randomly generated errors:

In [87]:
ggplot(xy, aes(x, f)) + 
  geom_line(linetype=2, col = "gray") + 
  geom_point(col = "steelblue") +  
  scale_y_continuous(lim=c(-5,5), name="f") + #In this case we are changing the scale limits
  theme_bw()

Think what would happen if instead of a covariance given by Iσ2, we had a covariance given by the Squared Exponential kernel. How do random realizations of f would look like?

In [88]:
x <- as.matrix(seq(-10, 10, len = num_sims), ncol = 1) # These are the inputs of our initial example

# Define the kernel parameters and plot
sigma <- 1
lengthscale <- 1
funk <- function(w) {rbf_kern(w, w, var = sigma^2, lengthscale = lengthscale)}
plot_simulation(x, funk, num_samples = 10)
Warning message:
In pdist(x1, x2): Y is the same as X, did you mean to use dist instead?

Periodic kernelΒΆ

k(xi,xj)=Οƒ2exp(βˆ’2sin⁑(Ο€|xiβˆ’xj|)2β„“2)ΒΆ

In [89]:
sigma <- 1
lengthscale <- 2
period <- 1
k <- periodic_kern(x1, x2, var = sigma^2, lengthscale = lengthscale, period = period)
plot_kernel(x1, x2, k)

Let's look at some random realizatios of f.

In [90]:
sigma <- 1
lengthscale <- 1
period <- 4
funk <- function(w) {periodic_kern(w, w, var = sigma^2, lengthscale = lengthscale, period = period)}
plot_simulation(x, funk, num_samples = 1)
Warning message:
In pdist(x1, x2): Y is the same as X, did you mean to use dist instead?

Linear kernelΒΆ

k(xi,xj)=b+Οƒ2(xiβˆ’c)(xjβˆ’c)ΒΆ

In [91]:
sigma <- 1
intercept <- .2
slope <- -.1
k <- linear_kern(x1, x2, bias = intercept, var = sigma^2, c = slope)
plot_kernel(x1, x2, k)
Warning message:
: Removed 51 rows containing missing values (geom_path).
In [92]:
sigma <- 1
intercept <- 0
slope <- 0
funk <- function(w) {linear_kern(w, w, bias = intercept, var = sigma^2, c = slope)}
plot_simulation(x, funk, num_samples = 10)
Warning message:
: Removed 108 rows containing missing values (geom_path).

You can find out more about kernels here: http://www.cs.toronto.edu/~duvenaud/cookbook/

Kernel functions in 2DΒΆ

This is a class on spatial statistics, so we need to consider at least 2 dimensions.

The kernels we saw before are defined in the same way. The only changes we need are the following:

  • Instead of differences xiβˆ’xj we use euclidean distances (xi1βˆ’xj1)2+(xi2βˆ’xj2)2
  • Instead of products xixj we use inner products xi1xj1+xi2xj2

Consider a grid of points in 2D.

In [93]:
locs1 <- rep(1:20, 20)
x2d <- cbind(locs1, sort(locs1))
ggplot(data.frame(x1 = x2d[,1], x2 = x2d[,2]), aes(x1, x2)) + 
  geom_point(col = "steelblue") + 
  theme_bw()

A random realization of f(x) under the iid assumption would look like:

In [94]:
sigma <- 1
kern <- iid_kern(x2d, var = sigma^2)
f_rand <- mvrnorm(1, rep(0, nrow(x2d)), kern)
plot_2dsim(x2d, f_rand)

Squared Exponential kernel:

In [95]:
sigma <- 1
lengthscale <- 3
kern <- rbf_kern(x2d, x2d, var = sigma^2, lengthscale = lengthscale)
f_rand <- mvrnorm(1, rep(0, nrow(x2d)), kern)
plot_2dsim(x2d, f_rand)
Warning message:
In pdist(x1, x2): Y is the same as X, did you mean to use dist instead?

Periodic kernel:

In [96]:
sigma <- 1
lengthscale <- 2
period <- 50
kern <- periodic_kern(x2d, x2d, var = sigma^2, lengthscale = lengthscale, period = period)
f_rand <- mvrnorm(1, rep(0, nrow(x2d)), kern)
plot_2dsim(x2d, f_rand)
Warning message:
In pdist(x1, x2): Y is the same as X, did you mean to use dist instead?
In [97]:
sigma <- 1
intercept <- 1
slope <- c(.5, .1)
kern <- linear_kern(x2d, x2d, bias = intercept, var = sigma^2, c = slope)
f_rand <- mvrnorm(1, rep(0, nrow(x2d)), kern)
plot_2dsim(x2d, f_rand)

Depending on the kernel used (and its parameters) f is able to represent different functions across the space.

Gaussian Process RegressionΒΆ

So far we have only spoken about random realizations of multivariate normals given a kernel, but we haven't actually linked it to an inference method.

DefinitionΒΆ

Let f(x) be a function such that any finite collection of its realizations {f1,…,fn} follows a multivariate Gaussian distribution, with mean m and covariance function K. Then f is known as a Gaussian process.

Say we have some a set of observations (xi,yi) and we are interested in knowing which functions f(x) are able to represent our observations. We use the following model:

yi=fi(xi)+Ο΅i, with Ο΅i∼N(0,Οƒ2).

fi are never observed. They are latent variables of our model that we need to learn. For every observation (xi,yi), we need to infer the corresponding fi.

We do this using a Bayesian approach as follows:

p(f|y,x)=p(y|f,x)p(f|x)p(y|x)ΒΆ

As prior p(f|x) we use a multivariate normal with covariance kernel K. The type of kernel depends also on our knowledge or assumptions of the relation between x and y. Let the mean of our prior be zero, as this simplifies the explication.

Then we have that p(f|x)=N(0,K).

Now if f is given, we have that p(y|f,x)=N(f,Iσ2).

And the posterior of f becomes:

p(f|y,x)=N(K(K+IΟƒ2)βˆ’1y,Kβˆ’K(K+IΟƒ2)βˆ’1K)ΒΆ

The proof of this formulation goes beyond the scope of todays discussion, so we will skip it. However you can find out more about the technical details of Gaussian processes here: http://www.gaussianprocess.org/gpml/

The solution of this inference problem is analytically tractable. And this is not only for f(x), but for predictions yβˆ— at new input locations xβˆ— as well. The predictive distribution for yβˆ— is given by:

p(yβˆ—|y,x,xβˆ—)=N(Kβˆ—x(Kxx+IΟƒ2)βˆ’1y,Kβˆ—βˆ—βˆ’Kβˆ—x(Kxx+IΟƒ2)βˆ’1Kxβˆ—)+IΟƒ2ΒΆ

where Kxx=k(x,x) and Kβˆ—x=k(xβˆ—,x).

Now let's see what this means in terms of the inference process. We will us an exponentiated quadratic kernel for this example.

Example: Earthquakes around the worldΒΆ

In [98]:
# This is the dataset we will use
equakes <- read.csv("earthquakes.csv")
equakes
Out[98]:
yearfive_sixsix_seveseven_eighteight_aboveall
120001344 146 14 11505
220011224 121 15 11361
320021201 127 13 01341
420031203 140 14 11358
520041515 141 14 21672
620051693 140 10 11844
720061712 142 9 21865
820072074 178 14 42270
920081768 168 12 01948
1020091896 144 16 12057
1120102209 150 23 12383
1220112276 185 19 12481
1320121401 108 12 21523
1420131453 123 17 21595
1520141574 143 11 11729
1620151419 127 18 11565
1720161550 130 16 01696
In [99]:
ix <- sample(1:17, 6) # We will just use some observations
ggplot(equakes[ix,], aes(year, all)) + 
  geom_line(data = equakes, aes(year, all), col = "seagreen2") +
  geom_point(col = "steelblue") +
  scale_y_continuous(lim=c(800, 2800)) + 
  scale_x_continuous(lim=c(2000, 2017)) +
  theme_bw()
In [100]:
x_ast <- matrix(seq(2000, 2016, length.out = 64), ncol = 1)
x_obs <- matrix(equakes$year[ix], ncol = 1)
y_obs <- matrix(equakes$all[ix], ncol = 1) / 1000

moments <- predictive_rbf(x_obs, y_obs, x_ast, var = 2, lengthscale = 2, noise = .001)

# Generate a number of functions from the process
n_samples <- 100
sims1 <- matrix(rep(0,length(x_ast)*n_samples), ncol = n_samples)
for (i in 1:n_samples) {
  sims1[,i] <- mvrnorm(1, moments$pred_mean, moments$pred_var)
}
sims1 <- cbind(x=x_ast,as.data.frame(sims1))
sims1 <- melt(sims1,id = "x")
colnames(sims1)[2] <- "simulation"

ggplot(sims1,aes(x=x,y=value)) +
  geom_line(aes(group=simulation), col = "gray", linetype = 1, alpha = .2) +
  theme_bw() +
  geom_line(data = equakes, aes(year, all/1000), col = "seagreen2") +
  geom_point(data = equakes[ix,], aes(year, all / 1000), col = "steelblue") +
  scale_y_continuous(lim=c(0.6, 3), name = "thousands of earthquakes") +
  scale_x_continuous(lim=c(2000,2017), name = "year")
Warning message:
In pdist(x1, x2): Y is the same as X, did you mean to use dist instead?Warning message:
In pdist(x1, x2): Y is the same as X, did you mean to use dist instead?Warning message:
: Removed 778 rows containing missing values (geom_path).
In [101]:
ix2 <- sample((1:17)[-ix], 1)

x_ast <- matrix(seq(2000, 2016, length.out = 64), ncol = 1)
x_obs <- matrix(equakes$year[c(ix, ix2)], ncol = 1)
y_obs <- matrix(equakes$all[c(ix, ix2)], ncol = 1) / 1000

moments <- predictive_rbf(x_obs, y_obs, x_ast, var = 10, lengthscale = 2, noise = .001)

# Generate a number of functions from the process
n_samples <- 100
sims2 <- matrix(rep(0,length(x_ast)*n_samples), ncol = n_samples)
for (i in 1:n_samples) {
  sims2[,i] <- mvrnorm(1, moments$pred_mean, moments$pred_var)
}
sims2 <- cbind(x=x_ast,as.data.frame(sims2))
sims2 <- melt(sims2,id="x")
colnames(sims2)[2] <- "simulation"

ggplot(sims1,aes(x=x,y=value)) +
  geom_line(aes(group=simulation), col = "gray", linetype = 1, alpha = .2) +
  geom_line(data = sims2, aes(group=simulation), col = "magenta", linetype = 1, alpha = .2) +
  theme_bw() +
  geom_line(data = equakes, aes(year, all/1000), col = "seagreen2") +
  geom_point(data = equakes[ix,], aes(year, all / 1000), col = "steelblue") +
  geom_point(data = equakes[ix2,], aes(year, all / 1000), col = "black") +
  scale_y_continuous(lim=c(0, 3), name = "thousands of earthquakes") +
  scale_x_continuous(lim=c(2000,2017), name = "year")
Warning message:
In pdist(x1, x2): Y is the same as X, did you mean to use dist instead?Warning message:
In pdist(x1, x2): Y is the same as X, did you mean to use dist instead?Warning message:
: Removed 479 rows containing missing values (geom_path).Warning message:
: Removed 877 rows containing missing values (geom_path).

Things to improve?

  • How to avoid negative values?
  • How to select the kernel parameters (hyperparameters)?

Laplace ApproximationΒΆ

We mentioned before that p(f|y,x) has a Gaussian form. This is the result of it being the product of two Gaussian distributions: p(y|f,x) and p(f|x).

If we assume that y is not Gaussian (e.g. is positive or discrete), the posterior distribution will no longer be Gaussian. Hence to know of

p(f|y,x)=p(y|f,x)p(f|x)p(y|x)ΒΆ

will require calculating the denominator

p(y|x)=∫p(y|f,x)p(f|x)df¢

which might render intractable.

The Laplace Approximation estimates the posterior distribution with a Gaussian distribution that resembles it the closest.

https://en.wikipedia.org/wiki/Laplace%27s_method

http://www.sumsar.net/blog/2013/11/easy-laplace-approximation/

HyperparametersΒΆ

We can define priors over them:

The big n problemΒΆ

Although we have a closed analytical expression for computing predictions, one disadvantage of these methods is the computational cost of the algebraic operations where the covariance function is involved.

Both the predictive mean and the predictive covariance, require the computation of the factor:

(K+IΟƒ2)βˆ’1ΒΆ

This is known to have a computational cost of order O(n3). Which means a cubic increase in the number of operations needed, related to the number of data points modeled.

In particular, for applications in epidemiology, where we it is needed to make inference on large regions at, but with enough detail at local level, this approach can be infeasible.

SPDE approachΒΆ

In previous sessions, the topic of Gaussian Markov Random Fields (GMRF) has been discussed. GMRF are commonly applied for inference on areal data. The neighboring structure leads to sparse precision matrices, and thus allows computational benefits.

Why?

  • Elements in the precision matrix are non-zero only for neighbour areas and diagonal elements.
  • Sparse matrices are easer to invert

A continuous field can be represented using a GMRF indexed across space. The countinuous process f(x) is replaced by a discrete field using a combination of weights w and discrete basis functions ψ(x):

f(x)β†’βˆ‘jwjψj(x)ΒΆ

w is found by solving the stocastic partial differential equation (SPDE):

(ΞΊ2βˆ’Ξ”)Ξ±/2Ο„f(x)=W(x)ΒΆ

where Ξ” is the Laplacian, Ξ± controls the smoothness, ΞΊ is a scale parameter and Ο„ is a variance rescaling parameter.

The solution to this equation is the a spatial process with Matern covariance:

k(xi,xj)=Οƒ2Ξ“(Ξ»)2Ξ»βˆ’1(ΞΊ(||xiβˆ’xj||)Ξ»KΞ»(ΞΊ||xiβˆ’xj||)ΒΆ

The core ideas of this approach are:

  • Construct a discretized spatial field.
  • Find a GMRF with local neighborhoud and precision matrix Q that represents the Gaussian field.
  • Do the computations using the GMRF representation taking advantage of the sparse matrices.

R-INLAΒΆ

We will dedicate the rest of the session to show some how to use the INLA package in R to implement geostatistical models. We will just cover some basic steps. A detailed tutorial of R-INLA can be found here: http://www.math.ntnu.no/inla/r-inla.org/tutorials/spde/html/

INLA stands for Integrated Nested Laplace Approximation. The implementation of geostatistical models is done by using the SPDE approximation.

The SPDE representation also makes it possible to use the Integrated Nested Laplace Approximation (INLA) to handle the non-linear transformation on the latent variable. This algorithm computes the posterior marginals of the latent field through a step-wise implementation of a simplified Laplace approximation with a cost of O(n^2 log n).

You can also check these publications:

http://www.statslab.cam.ac.uk/~rjs57/RSS/0708/Rue08.pdf

http://www.maths.ed.ac.uk/~flindgre/rinla/isbaspde.pdf

Example: Burkina FasoΒΆ

We will use an example of Malaria prevalence in Burkina Faso. We have data from 109 villages sampled.

In [102]:
obsv_data <- read.table("bf_data/data_bf2_binomial.txt", header = TRUE, sep = ",")
head(obsv_data[,1:4])
Out[102]:
examinedpositiveslongitudelatitude
1998.00000153.00000 -5.45000 10.38333
2459.00000262.00000 -5.35000 10.58333
3595.00000 72.00000 -5.21667 10.81667
4883.00 81.00 -5.10 10.75
5456.0000170.0000 -5.0627 11.5618
6304.00000264.00000 -5.05000 10.18333
In [103]:
ggplot(obsv_data, aes(longitude, latitude)) +
  geom_point(aes(col = positives/examined)) +
  scale_color_distiller(palette = "Spectral") +
  theme_bw()

At each village, the number of positves can be modeled as:

y∼Binomial(p,n)¢

where p is the rate of positives and n is the number of examined people.

Say that p varies across space. We can define a Gaussian process f, that is linked to p through the transformation:

p=11+eβˆ’fΒΆ

Notice that while f∈(βˆ’βˆž,∞), p∈(0,1).

First we need to define a mesh. A "good" mesh:

  • has few very sharp angles
  • has similar sized triangles
  • extends outside the observation area to reduce edge effects
In [104]:
options(repr.plot.width=5, repr.plot.height=5) # This will help a better display

mesh1 <- inla.mesh.2d(loc = obsv_data[, c("longitude", "latitude")], max.edge = .5)
plot(mesh1, col = "gray", lw = .2)
points(obsv_data$longitude, obsv_data$latitude, pch = 16, col = "steelblue")
In [105]:
mesh2 <- inla.mesh.2d(loc = obsv_data[, c("longitude", "latitude")], max.edge = c(8, 10))
plot(mesh2, col = "gray", lw = .2)
points(obsv_data$longitude, obsv_data$latitude, pch = 16, col = "steelblue")
In [106]:
mesh3 <- inla.mesh.2d(loc = obsv_data[, c("longitude", "latitude")], max.edge = c(8, 10), 
                      offset = 1.4)
plot(mesh3, col = "gray", lw = .2)
points(obsv_data$longitude, obsv_data$latitude, pch = 16, col = "steelblue")

We define a matern SPDE model based on our mesh with the following:

In [107]:
spde_model <- inla.spde2.matern(mesh = mesh3, alpha = 2)

spde_model$model
spde_model$BLC
Out[107]:
"matern"
Out[107]:
theta.1010
theta.2001
tau.1010
kappa.1001
variance.nominal.1-2.531024-2.000000-2.000000
range.nominal.1 1.039721 0.000000-1.000000

Now we define an index on our discretized spatial field.

In [108]:
s_index <- inla.spde.make.index(name = "s.field", n.spde = spde_model$n.spde)
names(s_index)
s_index
Out[108]:
  1. "s.field"
  2. "s.field.group"
  3. "s.field.repl"
Out[108]:
$s.field
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
  98. 98
  99. 99
  100. 100
  101. 101
  102. 102
  103. 103
  104. 104
  105. 105
  106. 106
  107. 107
  108. 108
  109. 109
  110. 110
  111. 111
  112. 112
  113. 113
  114. 114
  115. 115
  116. 116
  117. 117
  118. 118
  119. 119
  120. 120
  121. 121
  122. 122
  123. 123
  124. 124
  125. 125
  126. 126
  127. 127
  128. 128
  129. 129
  130. 130
  131. 131
  132. 132
  133. 133
  134. 134
  135. 135
  136. 136
  137. 137
  138. 138
  139. 139
  140. 140
  141. 141
  142. 142
  143. 143
  144. 144
  145. 145
  146. 146
  147. 147
  148. 148
  149. 149
  150. 150
  151. 151
  152. 152
  153. 153
  154. 154
  155. 155
  156. 156
  157. 157
  158. 158
  159. 159
  160. 160
  161. 161
  162. 162
  163. 163
  164. 164
  165. 165
  166. 166
  167. 167
  168. 168
  169. 169
  170. 170
  171. 171
  172. 172
  173. 173
  174. 174
  175. 175
  176. 176
  177. 177
  178. 178
  179. 179
  180. 180
  181. 181
  182. 182
  183. 183
  184. 184
  185. 185
  186. 186
  187. 187
  188. 188
  189. 189
  190. 190
  191. 191
  192. 192
  193. 193
  194. 194
  195. 195
  196. 196
  197. 197
  198. 198
  199. 199
  200. 200
  201. 201
  202. 202
  203. 203
  204. 204
  205. 205
  206. 206
  207. 207
  208. 208
  209. 209
  210. 210
  211. 211
  212. 212
  213. 213
  214. 214
  215. 215
  216. 216
  217. 217
  218. 218
  219. 219
  220. 220
  221. 221
  222. 222
  223. 223
  224. 224
  225. 225
  226. 226
  227. 227
  228. 228
  229. 229
  230. 230
  231. 231
  232. 232
  233. 233
  234. 234
  235. 235
  236. 236
  237. 237
  238. 238
  239. 239
  240. 240
  241. 241
  242. 242
  243. 243
  244. 244
  245. 245
  246. 246
  247. 247
  248. 248
  249. 249
  250. 250
  251. 251
  252. 252
  253. 253
  254. 254
  255. 255
  256. 256
  257. 257
  258. 258
  259. 259
  260. 260
  261. 261
  262. 262
  263. 263
  264. 264
  265. 265
  266. 266
  267. 267
  268. 268
  269. 269
  270. 270
$s.field.group
  1. 1
  2. 1
  3. 1
  4. 1
  5. 1
  6. 1
  7. 1
  8. 1
  9. 1
  10. 1
  11. 1
  12. 1
  13. 1
  14. 1
  15. 1
  16. 1
  17. 1
  18. 1
  19. 1
  20. 1
  21. 1
  22. 1
  23. 1
  24. 1
  25. 1
  26. 1
  27. 1
  28. 1
  29. 1
  30. 1
  31. 1
  32. 1
  33. 1
  34. 1
  35. 1
  36. 1
  37. 1
  38. 1
  39. 1
  40. 1
  41. 1
  42. 1
  43. 1
  44. 1
  45. 1
  46. 1
  47. 1
  48. 1
  49. 1
  50. 1
  51. 1
  52. 1
  53. 1
  54. 1
  55. 1
  56. 1
  57. 1
  58. 1
  59. 1
  60. 1
  61. 1
  62. 1
  63. 1
  64. 1
  65. 1
  66. 1
  67. 1
  68. 1
  69. 1
  70. 1
  71. 1
  72. 1
  73. 1
  74. 1
  75. 1
  76. 1
  77. 1
  78. 1
  79. 1
  80. 1
  81. 1
  82. 1
  83. 1
  84. 1
  85. 1
  86. 1
  87. 1
  88. 1
  89. 1
  90. 1
  91. 1
  92. 1
  93. 1
  94. 1
  95. 1
  96. 1
  97. 1
  98. 1
  99. 1
  100. 1
  101. 1
  102. 1
  103. 1
  104. 1
  105. 1
  106. 1
  107. 1
  108. 1
  109. 1
  110. 1
  111. 1
  112. 1
  113. 1
  114. 1
  115. 1
  116. 1
  117. 1
  118. 1
  119. 1
  120. 1
  121. 1
  122. 1
  123. 1
  124. 1
  125. 1
  126. 1
  127. 1
  128. 1
  129. 1
  130. 1
  131. 1
  132. 1
  133. 1
  134. 1
  135. 1
  136. 1
  137. 1
  138. 1
  139. 1
  140. 1
  141. 1
  142. 1
  143. 1
  144. 1
  145. 1
  146. 1
  147. 1
  148. 1
  149. 1
  150. 1
  151. 1
  152. 1
  153. 1
  154. 1
  155. 1
  156. 1
  157. 1
  158. 1
  159. 1
  160. 1
  161. 1
  162. 1
  163. 1
  164. 1
  165. 1
  166. 1
  167. 1
  168. 1
  169. 1
  170. 1
  171. 1
  172. 1
  173. 1
  174. 1
  175. 1
  176. 1
  177. 1
  178. 1
  179. 1
  180. 1
  181. 1
  182. 1
  183. 1
  184. 1
  185. 1
  186. 1
  187. 1
  188. 1
  189. 1
  190. 1
  191. 1
  192. 1
  193. 1
  194. 1
  195. 1
  196. 1
  197. 1
  198. 1
  199. 1
  200. 1
  201. 1
  202. 1
  203. 1
  204. 1
  205. 1
  206. 1
  207. 1
  208. 1
  209. 1
  210. 1
  211. 1
  212. 1
  213. 1
  214. 1
  215. 1
  216. 1
  217. 1
  218. 1
  219. 1
  220. 1
  221. 1
  222. 1
  223. 1
  224. 1
  225. 1
  226. 1
  227. 1
  228. 1
  229. 1
  230. 1
  231. 1
  232. 1
  233. 1
  234. 1
  235. 1
  236. 1
  237. 1
  238. 1
  239. 1
  240. 1
  241. 1
  242. 1
  243. 1
  244. 1
  245. 1
  246. 1
  247. 1
  248. 1
  249. 1
  250. 1
  251. 1
  252. 1
  253. 1
  254. 1
  255. 1
  256. 1
  257. 1
  258. 1
  259. 1
  260. 1
  261. 1
  262. 1
  263. 1
  264. 1
  265. 1
  266. 1
  267. 1
  268. 1
  269. 1
  270. 1
$s.field.repl
  1. 1
  2. 1
  3. 1
  4. 1
  5. 1
  6. 1
  7. 1
  8. 1
  9. 1
  10. 1
  11. 1
  12. 1
  13. 1
  14. 1
  15. 1
  16. 1
  17. 1
  18. 1
  19. 1
  20. 1
  21. 1
  22. 1
  23. 1
  24. 1
  25. 1
  26. 1
  27. 1
  28. 1
  29. 1
  30. 1
  31. 1
  32. 1
  33. 1
  34. 1
  35. 1
  36. 1
  37. 1
  38. 1
  39. 1
  40. 1
  41. 1
  42. 1
  43. 1
  44. 1
  45. 1
  46. 1
  47. 1
  48. 1
  49. 1
  50. 1
  51. 1
  52. 1
  53. 1
  54. 1
  55. 1
  56. 1
  57. 1
  58. 1
  59. 1
  60. 1
  61. 1
  62. 1
  63. 1
  64. 1
  65. 1
  66. 1
  67. 1
  68. 1
  69. 1
  70. 1
  71. 1
  72. 1
  73. 1
  74. 1
  75. 1
  76. 1
  77. 1
  78. 1
  79. 1
  80. 1
  81. 1
  82. 1
  83. 1
  84. 1
  85. 1
  86. 1
  87. 1
  88. 1
  89. 1
  90. 1
  91. 1
  92. 1
  93. 1
  94. 1
  95. 1
  96. 1
  97. 1
  98. 1
  99. 1
  100. 1
  101. 1
  102. 1
  103. 1
  104. 1
  105. 1
  106. 1
  107. 1
  108. 1
  109. 1
  110. 1
  111. 1
  112. 1
  113. 1
  114. 1
  115. 1
  116. 1
  117. 1
  118. 1
  119. 1
  120. 1
  121. 1
  122. 1
  123. 1
  124. 1
  125. 1
  126. 1
  127. 1
  128. 1
  129. 1
  130. 1
  131. 1
  132. 1
  133. 1
  134. 1
  135. 1
  136. 1
  137. 1
  138. 1
  139. 1
  140. 1
  141. 1
  142. 1
  143. 1
  144. 1
  145. 1
  146. 1
  147. 1
  148. 1
  149. 1
  150. 1
  151. 1
  152. 1
  153. 1
  154. 1
  155. 1
  156. 1
  157. 1
  158. 1
  159. 1
  160. 1
  161. 1
  162. 1
  163. 1
  164. 1
  165. 1
  166. 1
  167. 1
  168. 1
  169. 1
  170. 1
  171. 1
  172. 1
  173. 1
  174. 1
  175. 1
  176. 1
  177. 1
  178. 1
  179. 1
  180. 1
  181. 1
  182. 1
  183. 1
  184. 1
  185. 1
  186. 1
  187. 1
  188. 1
  189. 1
  190. 1
  191. 1
  192. 1
  193. 1
  194. 1
  195. 1
  196. 1
  197. 1
  198. 1
  199. 1
  200. 1
  201. 1
  202. 1
  203. 1
  204. 1
  205. 1
  206. 1
  207. 1
  208. 1
  209. 1
  210. 1
  211. 1
  212. 1
  213. 1
  214. 1
  215. 1
  216. 1
  217. 1
  218. 1
  219. 1
  220. 1
  221. 1
  222. 1
  223. 1
  224. 1
  225. 1
  226. 1
  227. 1
  228. 1
  229. 1
  230. 1
  231. 1
  232. 1
  233. 1
  234. 1
  235. 1
  236. 1
  237. 1
  238. 1
  239. 1
  240. 1
  241. 1
  242. 1
  243. 1
  244. 1
  245. 1
  246. 1
  247. 1
  248. 1
  249. 1
  250. 1
  251. 1
  252. 1
  253. 1
  254. 1
  255. 1
  256. 1
  257. 1
  258. 1
  259. 1
  260. 1
  261. 1
  262. 1
  263. 1
  264. 1
  265. 1
  266. 1
  267. 1
  268. 1
  269. 1
  270. 1

We have 109 observation and 734 nodes in our mesh. To project the process at the mesh nodes we use a matrix A defined as follows:

In [109]:
print(c("number of data points", nrow(obsv_data)))
print(c("number of nodes", mesh3$n))

# Projector matrix
A_obsv <- inla.spde.make.A(mesh3, as.matrix(obsv_data[, c("longitude", "latitude")]))
print(c("Dimensions of A:", dim(A_obsv)))
[1] "number of data points" "109"                  
[1] "number of nodes" "270"            
[1] "Dimensions of A:" "109"              "270"             

INLA provides some functionality ot combine data, effects and projector matrices into a single object. For simple models, this functionality might not be needed, but it becomes handy for more elaborated models.

In [110]:
stack_obsv <- inla.stack(data = list(y = obsv_data$positives),
                         A = list(A_obsv),
                         effects = list(s_index),
                         tag = "obsv")

Our model uses the linear predictor:

logit(y)=fΒΆ

The logit transformation will be used by default, when we tell INLA that the model distribution is Binomial. For the moment it suffice to define our linear predictor as follows:

In [111]:
linear_predictor <- y ~ -1 + f(s.field, model = spde_model)

Finally, the model is fitted with the following code:

In [112]:
inla_model <- inla(linear_predictor, 
                   data = inla.stack.data(stack_obsv),
                   Ntrials = obsv_data$examined,
                   family = "binomial",
                   control.predictor = list(A = inla.stack.A(stack_obsv), compute = TRUE),
                   control.compute = list(dic = TRUE, config = TRUE))
In [113]:
summary(inla_model)
Out[113]:
Call:
c("inla(formula = linear_predictor, family = \"binomial\", data = inla.stack.data(stack_obsv), ",  "    Ntrials = obsv_data$examined, control.compute = list(dic = TRUE, ",  "        config = TRUE), control.predictor = list(A = inla.stack.A(stack_obsv), ",  "        compute = TRUE))")

Time used:
 Pre-processing    Running inla Post-processing           Total 
         1.4294          2.1391          0.3199          3.8884 

The model has no fixed effects

Random effects:
Name	  Model
 s.field   SPDE2 model 

Model hyperparameters:
                     mean     sd 0.025quant 0.5quant 0.975quant   mode
Theta1 for s.field -4.324 0.2101     -4.766   -4.311     -3.945 -4.271
Theta2 for s.field  2.265 0.1518      1.991    2.256      2.585  2.228

Expected number of effective parameters(std dev): 107.81(0.1445)
Number of equivalent replicates : 1.011 

Deviance Information Criterion (DIC) ...: 874.40
Effective number of parameters .........: 107.65

Marginal log-Likelihood:  -673.33 
Posterior marginals for linear predictor and fitted values computed
In [114]:
results_df <- data.frame(observed_rate = obsv_data$positives/obsv_data$examined,
                         fitted_values = inla_model$summary.fitted.values$mean[1:nrow(obsv_data)])

ggplot(results_df, aes(observed_rate, fitted_values)) + 
  geom_point(col = "steelblue") +
  theme_bw()

Our dataset contains some covariates which we can add following the same steps as before.

In [115]:
head(obsv_data)
Out[115]:
examinedpositiveslongitudelatitudealttemprainndvi
1998.00000153.00000 -5.45000 10.38333 0.28830 27.75000 30.00000 0.60660
2459.00000262.00000 -5.35000 10.58333 0.35650 29.01000 32.33333 0.50380
3595.0000000 72.0000000 -5.2166700 10.8166700 0.4613000 27.0766667 33.3333333 0.4474667
4883.0000000 81.0000000 -5.1000000 10.7500000 0.3748000 26.1966667 30.3333333 0.5080667
5456.0000000170.0000000 -5.0627000 11.5618000 0.3049000 31.1166667 36.3333333 0.4921333
6304.0000000264.0000000 -5.0500000 10.1833300 0.2513000 27.0233333 35.3333333 0.6620667

The new linear predictor will be:

logit(y)=Ξ²0+Ξ²1xa+Ξ²2xt+Ξ²3xr+Ξ²4xn+fΒΆ

Hence we have to redefine the following objects:

In [116]:
stack_obsv <- inla.stack(data = list(y = obsv_data$positives),
                         A = list(A_obsv, 1, 1, 1, 1, 1),
                         effects = list(s_index,
                                        list(intercept = rep(1, nrow(obsv_data))),
                                        list(alt = obsv_data$alt),
                                        list(temp = obsv_data$temp),
                                        list(rain = obsv_data$rain),
                                        list(ndvi = obsv_data$ndvi)),
                         tag = "obsv")
In [117]:
linear_predictor <- y ~ -1 + intercept + alt + temp + rain + ndvi + f(s.field, model = spde_model)
In [118]:
inla_model <- inla(linear_predictor, 
                   data = inla.stack.data(stack_obsv),
                   Ntrials = obsv_data$examined,
                   family = "binomial",
                   control.predictor = list(A = inla.stack.A(stack_obsv), compute = TRUE),
                   control.compute = list(dic = TRUE, config = TRUE))
In [119]:
summary(inla_model)
Out[119]:
Call:
c("inla(formula = linear_predictor, family = \"binomial\", data = inla.stack.data(stack_obsv), ",  "    Ntrials = obsv_data$examined, control.compute = list(dic = TRUE, ",  "        config = TRUE), control.predictor = list(A = inla.stack.A(stack_obsv), ",  "        compute = TRUE))")

Time used:
 Pre-processing    Running inla Post-processing           Total 
         1.3395          3.2847          0.4498          5.0739 

Fixed effects:
              mean     sd 0.025quant 0.5quant 0.975quant     mode kld
intercept -11.7055 3.8836   -19.3929 -11.6912    -4.1052 -11.6614   0
alt        -6.7555 2.9433   -12.4773  -6.7805    -0.8982  -6.8319   0
temp        0.3530 0.0867     0.1827   0.3529     0.5238   0.3527   0
rain        0.0171 0.0168    -0.0158   0.0171     0.0504   0.0169   0
ndvi        4.3178 2.0935     0.2130   4.3116     8.4508   4.2992   0

Random effects:
Name	  Model
 s.field   SPDE2 model 

Model hyperparameters:
                     mean     sd 0.025quant 0.5quant 0.975quant   mode
Theta1 for s.field -4.593 0.2645     -5.164   -4.569     -4.138 -4.502
Theta2 for s.field  2.533 0.1786      2.222    2.517      2.920  2.472

Expected number of effective parameters(std dev): 107.67(0.1674)
Number of equivalent replicates : 1.012 

Deviance Information Criterion (DIC) ...: 874.24
Effective number of parameters .........: 107.50

Marginal log-Likelihood:  -684.02 
Posterior marginals for linear predictor and fitted values computed

The usual question here is, "OK, how do I make a map?"

We need to define a grid of points to make predictions. For the points in the grid, we also need the values of the covariates. For this example, we have the needed data stored in another file.

In [120]:
pred_data <- read.table("bf_data//prediction_bf2_binomial.txt", header = TRUE, sep = ",")
head(pred_data)
Out[120]:
x.predy.predtemp.predrain.predndvi.predalt.pred
1-3.4039211.7261130.2766746.00000 0.49460 0.25960
2-3.403919911.816109731.003334046.0000000 0.4684667 0.3860000
3-3.403919911.846110330.563333545.0000000 0.4774333 0.3860000
4-3.3739211.7261129.3966748.00000 0.57040 0.27700
5-3.373920011.756110230.030000748.0000000 0.4505333 0.3032000
6-3.373920011.786109931.250000048.0000000 0.4167333 0.3032000
In [121]:
colnames(pred_data) <- c("longitude", "latitude", "temp", "rain", "ndvi", "alt")
tail(pred_data)
Out[121]:
longitudelatitudetemprainndvialt
25240-3.283920010.106109626.843332333.0000000 0.6266667 0.2913000
25241-3.283920010.136110326.136667334.0000000 0.6218666 0.2913000
25242-3.2839210.1661125.6433334.00000 0.65330 0.27130
25243-3.2839210.1961126.3166734.00000 0.60750 0.27130
25244-3.283920010.226110526.303333332.0000000 0.6528333 0.2612000
25245-3.283920010.286109927.049999232.0000000 0.5633667 0.2656000
In [122]:
ggplot(pred_data, aes(longitude, latitude)) + 
  geom_raster(fill = "steelblue") +
  theme_bw()

Unlike other models, where we can predict new datapoins once our model has been fitted, INLA needs to fit together the observed points and the points to predict.

We will need a new projector matrix for this dataset, because the grid contains different locations from the observed data. We will also need a data stack.

In [123]:
# Just a part of the country to speed up the live example
pred_data2 <- subset(pred_data, latitude >13)

ggplot(pred_data, aes(longitude, latitude)) + 
  geom_raster(fill = "steelblue") +
  geom_raster(data = pred_data2, fill = "seagreen2") +
  theme_bw()
In [124]:
A_pred <- inla.spde.make.A(mesh3, as.matrix(pred_data2[, c("longitude", "latitude")]))

stack_pred <- inla.stack(data = list(y = NA),
                         A = list(A_pred, 1, 1, 1, 1, 1),
                         effects = list(s_index,
                                        list(intercept = rep(1, nrow(pred_data2))),
                                        list(alt = pred_data2$alt),
                                        list(temp = pred_data2$temp),
                                        list(rain = pred_data2$rain),
                                        list(ndvi = pred_data2$ndvi)),
                         tag = "pred")

Here is where the stack utilities become very useful.

In [125]:
stack_both <- inla.stack.join(stack_obsv, stack_pred)
index_obsv <- inla.stack.index(stack_both, tag = "obsv")
index_pred <- inla.stack.index(stack_both, tag = "pred")
In [137]:
inla_model_wp <- inla(linear_predictor,
                   data = inla.stack.data(stack_both),
                   Ntrials = c(obsv_data$examined, rep(1, nrow(pred_data2))),
                   family = "binomial",
                   control.predictor = list(A = inla.stack.A(stack_both), compute = TRUE),#
                   control.fixed = list(expand.factor.strategy="inla"))
summary(inla_model_wp)
Out[137]:
Call:
c("inla(formula = linear_predictor, family = \"binomial\", data = inla.stack.data(stack_both), ",  "    Ntrials = c(obsv_data$examined, rep(1, nrow(pred_data2))), ",  "    control.predictor = list(A = inla.stack.A(stack_both), compute = TRUE), ",  "    control.fixed = list(expand.factor.strategy = \"inla\"))" )

Time used:
 Pre-processing    Running inla Post-processing           Total 
         0.4498        236.8779          1.3494        238.6772 

Fixed effects:
             mean     sd 0.025quant 0.5quant 0.975quant    mode kld
intercept -8.7706 3.8790   -16.3987  -8.7700    -1.1539 -8.7684   0
alt       -3.8290 3.2421   -10.1994  -3.8303     2.5415 -3.8325   0
temp       0.2319 0.0920     0.0511   0.2319     0.4126  0.2319   0
rain       0.0341 0.0199    -0.0050   0.0341     0.0733  0.0341   0
ndvi       1.9760 2.0789    -2.1116   1.9761     6.0586  1.9765   0

Random effects:
Name	  Model
 s.field   IID model 

Model hyperparameters:
                        mean     sd 0.025quant 0.5quant 0.975quant   mode
Precision for s.field 0.4874 0.0695     0.3618   0.4841      0.634 0.4788

Expected number of effective parameters(std dev): 107.66(0.1319)
Number of equivalent replicates : 1.012 

Marginal log-Likelihood:  -685.82 
Posterior marginals for linear predictor and fitted values computed
In [138]:
pred_new <- data.frame(fitted_values = inla_model_wp$summary.fitted.values$mean[index_pred$data])
pred_data2$pred_new <- pred_new

ggplot(pred_data, aes(longitude, latitude)) + 
  geom_raster(fill = "steelblue") +
  geom_raster(data = pred_data2, aes(longitude, latitude, fill = pred_new)) +
  scale_fill_distiller(palette = "Spectral") +
  geom_point(data = obsv_data, aes(col = positives/examined)) +
  scale_color_distiller(palette = "Spectral") +
  theme_bw()

Other thingsΒΆ

In [139]:
# If we have a shapefile of the country
bf_shp <- readShapePoly("BFA_adm_shp/BFA_adm0.shp")
plot(bf_shp)
In [140]:
plot(mesh3, col = "gray", lw = .2)
In [141]:
bf_border <- unionSpatialPolygons(bf_shp, rep(1, nrow(bf_shp)))
bf_segment <- inla.sp2segment(bf_border)
mesh4 <- inla.mesh.2d(loc = obsv_data[, c("longitude", "latitude")], 
                      boundary = bf_segment,
                      max.edge = c(2, 10), cutoff = .3)
plot(mesh4, col = "gray", lw = .2)
points(obsv_data$longitude, obsv_data$latitude, pch = 16, col = "steelblue")
In [142]:
mesh3$n
mesh4$n
Out[142]:
270
Out[142]:
198

Adding timeΒΆ

In [143]:
obsv_data2 <- obsv_data
obsv_data2$time <- rep(1:10, 11)[c(-110)]

ggplot(obsv_data2, aes(longitude, latitude)) +
  geom_point(aes(col = time)) +
  scale_color_distiller(palette = "Spectral") +
  theme_bw()
In [144]:
temporal_mesh <- inla.mesh.1d(min(obsv_data2$time):max(obsv_data2$time))
temporal_mesh
Out[144]:
$n
[1] 10

$m
[1] 10

$loc
 [1]  1  2  3  4  5  6  7  8  9 10

$mid
 [1]  1  2  3  4  5  6  7  8  9 10

$interval
[1]  1 10

$boundary
[1] "neumann" "neumann"

$cyclic
[1] FALSE

$manifold
[1] "R1"

$degree
[1] 1

$free.clamped
[1] FALSE FALSE

$idx
$idx$loc
 [1]  1  2  3  4  5  6  7  8  9 10


attr(,"class")
[1] "inla.mesh.1d"
In [145]:
s_index <- inla.spde.make.index(name = "s.field", n.spde = spde_model$n.spde,
                                n.group = temporal_mesh$n)
s_index$s.field.group
Out[145]:
  1. 1
  2. 1
  3. 1
  4. 1
  5. 1
  6. 1
  7. 1
  8. 1
  9. 1
  10. 1
  11. 1
  12. 1
  13. 1
  14. 1
  15. 1
  16. 1
  17. 1
  18. 1
  19. 1
  20. 1
  21. 1
  22. 1
  23. 1
  24. 1
  25. 1
  26. 1
  27. 1
  28. 1
  29. 1
  30. 1
  31. 1
  32. 1
  33. 1
  34. 1
  35. 1
  36. 1
  37. 1
  38. 1
  39. 1
  40. 1
  41. 1
  42. 1
  43. 1
  44. 1
  45. 1
  46. 1
  47. 1
  48. 1
  49. 1
  50. 1
  51. 1
  52. 1
  53. 1
  54. 1
  55. 1
  56. 1
  57. 1
  58. 1
  59. 1
  60. 1
  61. 1
  62. 1
  63. 1
  64. 1
  65. 1
  66. 1
  67. 1
  68. 1
  69. 1
  70. 1
  71. 1
  72. 1
  73. 1
  74. 1
  75. 1
  76. 1
  77. 1
  78. 1
  79. 1
  80. 1
  81. 1
  82. 1
  83. 1
  84. 1
  85. 1
  86. 1
  87. 1
  88. 1
  89. 1
  90. 1
  91. 1
  92. 1
  93. 1
  94. 1
  95. 1
  96. 1
  97. 1
  98. 1
  99. 1
  100. 1
  101. 1
  102. 1
  103. 1
  104. 1
  105. 1
  106. 1
  107. 1
  108. 1
  109. 1
  110. 1
  111. 1
  112. 1
  113. 1
  114. 1
  115. 1
  116. 1
  117. 1
  118. 1
  119. 1
  120. 1
  121. 1
  122. 1
  123. 1
  124. 1
  125. 1
  126. 1
  127. 1
  128. 1
  129. 1
  130. 1
  131. 1
  132. 1
  133. 1
  134. 1
  135. 1
  136. 1
  137. 1
  138. 1
  139. 1
  140. 1
  141. 1
  142. 1
  143. 1
  144. 1
  145. 1
  146. 1
  147. 1
  148. 1
  149. 1
  150. 1
  151. 1
  152. 1
  153. 1
  154. 1
  155. 1
  156. 1
  157. 1
  158. 1
  159. 1
  160. 1
  161. 1
  162. 1
  163. 1
  164. 1
  165. 1
  166. 1
  167. 1
  168. 1
  169. 1
  170. 1
  171. 1
  172. 1
  173. 1
  174. 1
  175. 1
  176. 1
  177. 1
  178. 1
  179. 1
  180. 1
  181. 1
  182. 1
  183. 1
  184. 1
  185. 1
  186. 1
  187. 1
  188. 1
  189. 1
  190. 1
  191. 1
  192. 1
  193. 1
  194. 1
  195. 1
  196. 1
  197. 1
  198. 1
  199. 1
  200. 1
  201. 1
  202. 1
  203. 1
  204. 1
  205. 1
  206. 1
  207. 1
  208. 1
  209. 1
  210. 1
  211. 1
  212. 1
  213. 1
  214. 1
  215. 1
  216. 1
  217. 1
  218. 1
  219. 1
  220. 1
  221. 1
  222. 1
  223. 1
  224. 1
  225. 1
  226. 1
  227. 1
  228. 1
  229. 1
  230. 1
  231. 1
  232. 1
  233. 1
  234. 1
  235. 1
  236. 1
  237. 1
  238. 1
  239. 1
  240. 1
  241. 1
  242. 1
  243. 1
  244. 1
  245. 1
  246. 1
  247. 1
  248. 1
  249. 1
  250. 1
  251. 1
  252. 1
  253. 1
  254. 1
  255. 1
  256. 1
  257. 1
  258. 1
  259. 1
  260. 1
  261. 1
  262. 1
  263. 1
  264. 1
  265. 1
  266. 1
  267. 1
  268. 1
  269. 1
  270. 1
  271. 2
  272. 2
  273. 2
  274. 2
  275. 2
  276. 2
  277. 2
  278. 2
  279. 2
  280. 2
  281. 2
  282. 2
  283. 2
  284. 2
  285. 2
  286. 2
  287. 2
  288. 2
  289. 2
  290. 2
  291. 2
  292. 2
  293. 2
  294. 2
  295. 2
  296. 2
  297. 2
  298. 2
  299. 2
  300. 2
  301. 2
  302. 2
  303. 2
  304. 2
  305. 2
  306. 2
  307. 2
  308. 2
  309. 2
  310. 2
  311. 2
  312. 2
  313. 2
  314. 2
  315. 2
  316. 2
  317. 2
  318. 2
  319. 2
  320. 2
  321. 2
  322. 2
  323. 2
  324. 2
  325. 2
  326. 2
  327. 2
  328. 2
  329. 2
  330. 2
  331. 2
  332. 2
  333. 2
  334. 2
  335. 2
  336. 2
  337. 2
  338. 2
  339. 2
  340. 2
  341. 2
  342. 2
  343. 2
  344. 2
  345. 2
  346. 2
  347. 2
  348. 2
  349. 2
  350. 2
  351. 2
  352. 2
  353. 2
  354. 2
  355. 2
  356. 2
  357. 2
  358. 2
  359. 2
  360. 2
  361. 2
  362. 2
  363. 2
  364. 2
  365. 2
  366. 2
  367. 2
  368. 2
  369. 2
  370. 2
  371. 2
  372. 2
  373. 2
  374. 2
  375. 2
  376. 2
  377. 2
  378. 2
  379. 2
  380. 2
  381. 2
  382. 2
  383. 2
  384. 2
  385. 2
  386. 2
  387. 2
  388. 2
  389. 2
  390. 2
  391. 2
  392. 2
  393. 2
  394. 2
  395. 2
  396. 2
  397. 2
  398. 2
  399. 2
  400. 2
  401. 2
  402. 2
  403. 2
  404. 2
  405. 2
  406. 2
  407. 2
  408. 2
  409. 2
  410. 2
  411. 2
  412. 2
  413. 2
  414. 2
  415. 2
  416. 2
  417. 2
  418. 2
  419. 2
  420. 2
  421. 2
  422. 2
  423. 2
  424. 2
  425. 2
  426. 2
  427. 2
  428. 2
  429. 2
  430. 2
  431. 2
  432. 2
  433. 2
  434. 2
  435. 2
  436. 2
  437. 2
  438. 2
  439. 2
  440. 2
  441. 2
  442. 2
  443. 2
  444. 2
  445. 2
  446. 2
  447. 2
  448. 2
  449. 2
  450. 2
  451. 2
  452. 2
  453. 2
  454. 2
  455. 2
  456. 2
  457. 2
  458. 2
  459. 2
  460. 2
  461. 2
  462. 2
  463. 2
  464. 2
  465. 2
  466. 2
  467. 2
  468. 2
  469. 2
  470. 2
  471. 2
  472. 2
  473. 2
  474. 2
  475. 2
  476. 2
  477. 2
  478. 2
  479. 2
  480. 2
  481. 2
  482. 2
  483. 2
  484. 2
  485. 2
  486. 2
  487. 2
  488. 2
  489. 2
  490. 2
  491. 2
  492. 2
  493. 2
  494. 2
  495. 2
  496. 2
  497. 2
  498. 2
  499. 2
  500. 2
  501. 2
  502. 2
  503. 2
  504. 2
  505. 2
  506. 2
  507. 2
  508. 2
  509. 2
  510. 2
  511. 2
  512. 2
  513. 2
  514. 2
  515. 2
  516. 2
  517. 2
  518. 2
  519. 2
  520. 2
  521. 2
  522. 2
  523. 2
  524. 2
  525. 2
  526. 2
  527. 2
  528. 2
  529. 2
  530. 2
  531. 2
  532. 2
  533. 2
  534. 2
  535. 2
  536. 2
  537. 2
  538. 2
  539. 2
  540. 2
  541. 3
  542. 3
  543. 3
  544. 3
  545. 3
  546. 3
  547. 3
  548. 3
  549. 3
  550. 3
  551. 3
  552. 3
  553. 3
  554. 3
  555. 3
  556. 3
  557. 3
  558. 3
  559. 3
  560. 3
  561. 3
  562. 3
  563. 3
  564. 3
  565. 3
  566. 3
  567. 3
  568. 3
  569. 3
  570. 3
  571. 3
  572. 3
  573. 3
  574. 3
  575. 3
  576. 3
  577. 3
  578. 3
  579. 3
  580. 3
  581. 3
  582. 3
  583. 3
  584. 3
  585. 3
  586. 3
  587. 3
  588. 3
  589. 3
  590. 3
  591. 3
  592. 3
  593. 3
  594. 3
  595. 3
  596. 3
  597. 3
  598. 3
  599. 3
  600. 3
  601. 3
  602. 3
  603. 3
  604. 3
  605. 3
  606. 3
  607. 3
  608. 3
  609. 3
  610. 3
  611. 3
  612. 3
  613. 3
  614. 3
  615. 3
  616. 3
  617. 3
  618. 3
  619. 3
  620. 3
  621. 3
  622. 3
  623. 3
  624. 3
  625. 3
  626. 3
  627. 3
  628. 3
  629. 3
  630. 3
  631. 3
  632. 3
  633. 3
  634. 3
  635. 3
  636. 3
  637. 3
  638. 3
  639. 3
  640. 3
  641. 3
  642. 3
  643. 3
  644. 3
  645. 3
  646. 3
  647. 3
  648. 3
  649. 3
  650. 3
  651. 3
  652. 3
  653. 3
  654. 3
  655. 3
  656. 3
  657. 3
  658. 3
  659. 3
  660. 3
  661. 3
  662. 3
  663. 3
  664. 3
  665. 3
  666. 3
  667. 3
  668. 3
  669. 3
  670. 3
  671. 3
  672. 3
  673. 3
  674. 3
  675. 3
  676. 3
  677. 3
  678. 3
  679. 3
  680. 3
  681. 3
  682. 3
  683. 3
  684. 3
  685. 3
  686. 3
  687. 3
  688. 3
  689. 3
  690. 3
  691. 3
  692. 3
  693. 3
  694. 3
  695. 3
  696. 3
  697. 3
  698. 3
  699. 3
  700. 3
  701. 3
  702. 3
  703. 3
  704. 3
  705. 3
  706. 3
  707. 3
  708. 3
  709. 3
  710. 3
  711. 3
  712. 3
  713. 3
  714. 3
  715. 3
  716. 3
  717. 3
  718. 3
  719. 3
  720. 3
  721. 3
  722. 3
  723. 3
  724. 3
  725. 3
  726. 3
  727. 3
  728. 3
  729. 3
  730. 3
  731. 3
  732. 3
  733. 3
  734. 3
  735. 3
  736. 3
  737. 3
  738. 3
  739. 3
  740. 3
  741. 3
  742. 3
  743. 3
  744. 3
  745. 3
  746. 3
  747. 3
  748. 3
  749. 3
  750. 3
  751. 3
  752. 3
  753. 3
  754. 3
  755. 3
  756. 3
  757. 3
  758. 3
  759. 3
  760. 3
  761. 3
  762. 3
  763. 3
  764. 3
  765. 3
  766. 3
  767. 3
  768. 3
  769. 3
  770. 3
  771. 3
  772. 3
  773. 3
  774. 3
  775. 3
  776. 3
  777. 3
  778. 3
  779. 3
  780. 3
  781. 3
  782. 3
  783. 3
  784. 3
  785. 3
  786. 3
  787. 3
  788. 3
  789. 3
  790. 3
  791. 3
  792. 3
  793. 3
  794. 3
  795. 3
  796. 3
  797. 3
  798. 3
  799. 3
  800. 3
  801. 3
  802. 3
  803. 3
  804. 3
  805. 3
  806. 3
  807. 3
  808. 3
  809. 3
  810. 3
  811. 4
  812. 4
  813. 4
  814. 4
  815. 4
  816. 4
  817. 4
  818. 4
  819. 4
  820. 4
  821. 4
  822. 4
  823. 4
  824. 4
  825. 4
  826. 4
  827. 4
  828. 4
  829. 4
  830. 4
  831. 4
  832. 4
  833. 4
  834. 4
  835. 4
  836. 4
  837. 4
  838. 4
  839. 4
  840. 4
  841. 4
  842. 4
  843. 4
  844. 4
  845. 4
  846. 4
  847. 4
  848. 4
  849. 4
  850. 4
  851. 4
  852. 4
  853. 4
  854. 4
  855. 4
  856. 4
  857. 4
  858. 4
  859. 4
  860. 4
  861. 4
  862. 4
  863. 4
  864. 4
  865. 4
  866. 4
  867. 4
  868. 4
  869. 4
  870. 4
  871. 4
  872. 4
  873. 4
  874. 4
  875. 4
  876. 4
  877. 4
  878. 4
  879. 4
  880. 4
  881. 4
  882. 4
  883. 4
  884. 4
  885. 4
  886. 4
  887. 4
  888. 4
  889. 4
  890. 4
  891. 4
  892. 4
  893. 4
  894. 4
  895. 4
  896. 4
  897. 4
  898. 4
  899. 4
  900. 4
  901. 4
  902. 4
  903. 4
  904. 4
  905. 4
  906. 4
  907. 4
  908. 4
  909. 4
  910. 4
  911. 4
  912. 4
  913. 4
  914. 4
  915. 4
  916. 4
  917. 4
  918. 4
  919. 4
  920. 4
  921. 4
  922. 4
  923. 4
  924. 4
  925. 4
  926. 4
  927. 4
  928. 4
  929. 4
  930. 4
  931. 4
  932. 4
  933. 4
  934. 4
  935. 4
  936. 4
  937. 4
  938. 4
  939. 4
  940. 4
  941. 4
  942. 4
  943. 4
  944. 4
  945. 4
  946. 4
  947. 4
  948. 4
  949. 4
  950. 4
  951. 4
  952. 4
  953. 4
  954. 4
  955. 4
  956. 4
  957. 4
  958. 4
  959. 4
  960. 4
  961. 4
  962. 4
  963. 4
  964. 4
  965. 4
  966. 4
  967. 4
  968. 4
  969. 4
  970. 4
  971. 4
  972. 4
  973. 4
  974. 4
  975. 4
  976. 4
  977. 4
  978. 4
  979. 4
  980. 4
  981. 4
  982. 4
  983. 4
  984. 4
  985. 4
  986. 4
  987. 4
  988. 4
  989. 4
  990. 4
  991. 4
  992. 4
  993. 4
  994. 4
  995. 4
  996. 4
  997. 4
  998. 4
  999. 4
  1000. 4
  1001. 4
  1002. 4
  1003. 4
  1004. 4
  1005. 4
  1006. 4
  1007. 4
  1008. 4
  1009. 4
  1010. 4
  1011. 4
  1012. 4
  1013. 4
  1014. 4
  1015. 4
  1016. 4
  1017. 4
  1018. 4
  1019. 4
  1020. 4
  1021. 4
  1022. 4
  1023. 4
  1024. 4
  1025. 4
  1026. 4
  1027. 4
  1028. 4
  1029. 4
  1030. 4
  1031. 4
  1032. 4
  1033. 4
  1034. 4
  1035. 4
  1036. 4
  1037. 4
  1038. 4
  1039. 4
  1040. 4
  1041. 4
  1042. 4
  1043. 4
  1044. 4
  1045. 4
  1046. 4
  1047. 4
  1048. 4
  1049. 4
  1050. 4
  1051. 4
  1052. 4
  1053. 4
  1054. 4
  1055. 4
  1056. 4
  1057. 4
  1058. 4
  1059. 4
  1060. 4
  1061. 4
  1062. 4
  1063. 4
  1064. 4
  1065. 4
  1066. 4
  1067. 4
  1068. 4
  1069. 4
  1070. 4
  1071. 4
  1072. 4
  1073. 4
  1074. 4
  1075. 4
  1076. 4
  1077. 4
  1078. 4
  1079. 4
  1080. 4
  1081. 5
  1082. 5
  1083. 5
  1084. 5
  1085. 5
  1086. 5
  1087. 5
  1088. 5
  1089. 5
  1090. 5
  1091. 5
  1092. 5
  1093. 5
  1094. 5
  1095. 5
  1096. 5
  1097. 5
  1098. 5
  1099. 5
  1100. 5
  1101. 5
  1102. 5
  1103. 5
  1104. 5
  1105. 5
  1106. 5
  1107. 5
  1108. 5
  1109. 5
  1110. 5
  1111. 5
  1112. 5
  1113. 5
  1114. 5
  1115. 5
  1116. 5
  1117. 5
  1118. 5
  1119. 5
  1120. 5
  1121. 5
  1122. 5
  1123. 5
  1124. 5
  1125. 5
  1126. 5
  1127. 5
  1128. 5
  1129. 5
  1130. 5
  1131. 5
  1132. 5
  1133. 5
  1134. 5
  1135. 5
  1136. 5
  1137. 5
  1138. 5
  1139. 5
  1140. 5
  1141. 5
  1142. 5
  1143. 5
  1144. 5
  1145. 5
  1146. 5
  1147. 5
  1148. 5
  1149. 5
  1150. 5
  1151. 5
  1152. 5
  1153. 5
  1154. 5
  1155. 5
  1156. 5
  1157. 5
  1158. 5
  1159. 5
  1160. 5
  1161. 5
  1162. 5
  1163. 5
  1164. 5
  1165. 5
  1166. 5
  1167. 5
  1168. 5
  1169. 5
  1170. 5
  1171. 5
  1172. 5
  1173. 5
  1174. 5
  1175. 5
  1176. 5
  1177. 5
  1178. 5
  1179. 5
  1180. 5
  1181. 5
  1182. 5
  1183. 5
  1184. 5
  1185. 5
  1186. 5
  1187. 5
  1188. 5
  1189. 5
  1190. 5
  1191. 5
  1192. 5
  1193. 5
  1194. 5
  1195. 5
  1196. 5
  1197. 5
  1198. 5
  1199. 5
  1200. 5
  1201. 5
  1202. 5
  1203. 5
  1204. 5
  1205. 5
  1206. 5
  1207. 5
  1208. 5
  1209. 5
  1210. 5
  1211. 5
  1212. 5
  1213. 5
  1214. 5
  1215. 5
  1216. 5
  1217. 5
  1218. 5
  1219. 5
  1220. 5
  1221. 5
  1222. 5
  1223. 5
  1224. 5
  1225. 5
  1226. 5
  1227. 5
  1228. 5
  1229. 5
  1230. 5
  1231. 5
  1232. 5
  1233. 5
  1234. 5
  1235. 5
  1236. 5
  1237. 5
  1238. 5
  1239. 5
  1240. 5
  1241. 5
  1242. 5
  1243. 5
  1244. 5
  1245. 5
  1246. 5
  1247. 5
  1248. 5
  1249. 5
  1250. 5
  1251. 5
  1252. 5
  1253. 5
  1254. 5
  1255. 5
  1256. 5
  1257. 5
  1258. 5
  1259. 5
  1260. 5
  1261. 5
  1262. 5
  1263. 5
  1264. 5
  1265. 5
  1266. 5
  1267. 5
  1268. 5
  1269. 5
  1270. 5
  1271. 5
  1272. 5
  1273. 5
  1274. 5
  1275. 5
  1276. 5
  1277. 5
  1278. 5
  1279. 5
  1280. 5
  1281. 5
  1282. 5
  1283. 5
  1284. 5
  1285. 5
  1286. 5
  1287. 5
  1288. 5
  1289. 5
  1290. 5
  1291. 5
  1292. 5
  1293. 5
  1294. 5
  1295. 5
  1296. 5
  1297. 5
  1298. 5
  1299. 5
  1300. 5
  1301. 5
  1302. 5
  1303. 5
  1304. 5
  1305. 5
  1306. 5
  1307. 5
  1308. 5
  1309. 5
  1310. 5
  1311. 5
  1312. 5
  1313. 5
  1314. 5
  1315. 5
  1316. 5
  1317. 5
  1318. 5
  1319. 5
  1320. 5
  1321. 5
  1322. 5
  1323. 5
  1324. 5
  1325. 5
  1326. 5
  1327. 5
  1328. 5
  1329. 5
  1330. 5
  1331. 5
  1332. 5
  1333. 5
  1334. 5
  1335. 5
  1336. 5
  1337. 5
  1338. 5
  1339. 5
  1340. 5
  1341. 5
  1342. 5
  1343. 5
  1344. 5
  1345. 5
  1346. 5
  1347. 5
  1348. 5
  1349. 5
  1350. 5
  1351. 6
  1352. 6
  1353. 6
  1354. 6
  1355. 6
  1356. 6
  1357. 6
  1358. 6
  1359. 6
  1360. 6
  1361. 6
  1362. 6
  1363. 6
  1364. 6
  1365. 6
  1366. 6
  1367. 6
  1368. 6
  1369. 6
  1370. 6
  1371. 6
  1372. 6
  1373. 6
  1374. 6
  1375. 6
  1376. 6
  1377. 6
  1378. 6
  1379. 6
  1380. 6
  1381. 6
  1382. 6
  1383. 6
  1384. 6
  1385. 6
  1386. 6
  1387. 6
  1388. 6
  1389. 6
  1390. 6
  1391. 6
  1392. 6
  1393. 6
  1394. 6
  1395. 6
  1396. 6
  1397. 6
  1398. 6
  1399. 6
  1400. 6
  1401. 6
  1402. 6
  1403. 6
  1404. 6
  1405. 6
  1406. 6
  1407. 6
  1408. 6
  1409. 6
  1410. 6
  1411. 6
  1412. 6
  1413. 6
  1414. 6
  1415. 6
  1416. 6
  1417. 6
  1418. 6
  1419. 6
  1420. 6
  1421. 6
  1422. 6
  1423. 6
  1424. 6
  1425. 6
  1426. 6
  1427. 6
  1428. 6
  1429. 6
  1430. 6
  1431. 6
  1432. 6
  1433. 6
  1434. 6
  1435. 6
  1436. 6
  1437. 6
  1438. 6
  1439. 6
  1440. 6
  1441. 6
  1442. 6
  1443. 6
  1444. 6
  1445. 6
  1446. 6
  1447. 6
  1448. 6
  1449. 6
  1450. 6
  1451. 6
  1452. 6
  1453. 6
  1454. 6
  1455. 6
  1456. 6
  1457. 6
  1458. 6
  1459. 6
  1460. 6
  1461. 6
  1462. 6
  1463. 6
  1464. 6
  1465. 6
  1466. 6
  1467. 6
  1468. 6
  1469. 6
  1470. 6
  1471. 6
  1472. 6
  1473. 6
  1474. 6
  1475. 6
  1476. 6
  1477. 6
  1478. 6
  1479. 6
  1480. 6
  1481. 6
  1482. 6
  1483. 6
  1484. 6
  1485. 6
  1486. 6
  1487. 6
  1488. 6
  1489. 6
  1490. 6
  1491. 6
  1492. 6
  1493. 6
  1494. 6
  1495. 6
  1496. 6
  1497. 6
  1498. 6
  1499. 6
  1500. 6
  1501. 6
  1502. 6
  1503. 6
  1504. 6
  1505. 6
  1506. 6
  1507. 6
  1508. 6
  1509. 6
  1510. 6
  1511. 6
  1512. 6
  1513. 6
  1514. 6
  1515. 6
  1516. 6
  1517. 6
  1518. 6
  1519. 6
  1520. 6
  1521. 6
  1522. 6
  1523. 6
  1524. 6
  1525. 6
  1526. 6
  1527. 6
  1528. 6
  1529. 6
  1530. 6
  1531. 6
  1532. 6
  1533. 6
  1534. 6
  1535. 6
  1536. 6
  1537. 6
  1538. 6
  1539. 6
  1540. 6
  1541. 6
  1542. 6
  1543. 6
  1544. 6
  1545. 6
  1546. 6
  1547. 6
  1548. 6
  1549. 6
  1550. 6
  1551. 6
  1552. 6
  1553. 6
  1554. 6
  1555. 6
  1556. 6
  1557. 6
  1558. 6
  1559. 6
  1560. 6
  1561. 6
  1562. 6
  1563. 6
  1564. 6
  1565. 6
  1566. 6
  1567. 6
  1568. 6
  1569. 6
  1570. 6
  1571. 6
  1572. 6
  1573. 6
  1574. 6
  1575. 6
  1576. 6
  1577. 6
  1578. 6
  1579. 6
  1580. 6
  1581. 6
  1582. 6
  1583. 6
  1584. 6
  1585. 6
  1586. 6
  1587. 6
  1588. 6
  1589. 6
  1590. 6
  1591. 6
  1592. 6
  1593. 6
  1594. 6
  1595. 6
  1596. 6
  1597. 6
  1598. 6
  1599. 6
  1600. 6
  1601. 6
  1602. 6
  1603. 6
  1604. 6
  1605. 6
  1606. 6
  1607. 6
  1608. 6
  1609. 6
  1610. 6
  1611. 6
  1612. 6
  1613. 6
  1614. 6
  1615. 6
  1616. 6
  1617. 6
  1618. 6
  1619. 6
  1620. 6
  1621. 7
  1622. 7
  1623. 7
  1624. 7
  1625. 7
  1626. 7
  1627. 7
  1628. 7
  1629. 7
  1630. 7
  1631. 7
  1632. 7
  1633. 7
  1634. 7
  1635. 7
  1636. 7
  1637. 7
  1638. 7
  1639. 7
  1640. 7
  1641. 7
  1642. 7
  1643. 7
  1644. 7
  1645. 7
  1646. 7
  1647. 7
  1648. 7
  1649. 7
  1650. 7
  1651. 7
  1652. 7
  1653. 7
  1654. 7
  1655. 7
  1656. 7
  1657. 7
  1658. 7
  1659. 7
  1660. 7
  1661. 7
  1662. 7
  1663. 7
  1664. 7
  1665. 7
  1666. 7
  1667. 7
  1668. 7
  1669. 7
  1670. 7
  1671. 7
  1672. 7
  1673. 7
  1674. 7
  1675. 7
  1676. 7
  1677. 7
  1678. 7
  1679. 7
  1680. 7
  1681. 7
  1682. 7
  1683. 7
  1684. 7
  1685. 7
  1686. 7
  1687. 7
  1688. 7
  1689. 7
  1690. 7
  1691. 7
  1692. 7
  1693. 7
  1694. 7
  1695. 7
  1696. 7
  1697. 7
  1698. 7
  1699. 7
  1700. 7
  1701. 7
  1702. 7
  1703. 7
  1704. 7
  1705. 7
  1706. 7
  1707. 7
  1708. 7
  1709. 7
  1710. 7
  1711. 7
  1712. 7
  1713. 7
  1714. 7
  1715. 7
  1716. 7
  1717. 7
  1718. 7
  1719. 7
  1720. 7
  1721. 7
  1722. 7
  1723. 7
  1724. 7
  1725. 7
  1726. 7
  1727. 7
  1728. 7
  1729. 7
  1730. 7
  1731. 7
  1732. 7
  1733. 7
  1734. 7
  1735. 7
  1736. 7
  1737. 7
  1738. 7
  1739. 7
  1740. 7
  1741. 7
  1742. 7
  1743. 7
  1744. 7
  1745. 7
  1746. 7
  1747. 7
  1748. 7
  1749. 7
  1750. 7
  1751. 7
  1752. 7
  1753. 7
  1754. 7
  1755. 7
  1756. 7
  1757. 7
  1758. 7
  1759. 7
  1760. 7
  1761. 7
  1762. 7
  1763. 7
  1764. 7
  1765. 7
  1766. 7
  1767. 7
  1768. 7
  1769. 7
  1770. 7
  1771. 7
  1772. 7
  1773. 7
  1774. 7
  1775. 7
  1776. 7
  1777. 7
  1778. 7
  1779. 7
  1780. 7
  1781. 7
  1782. 7
  1783. 7
  1784. 7
  1785. 7
  1786. 7
  1787. 7
  1788. 7
  1789. 7
  1790. 7
  1791. 7
  1792. 7
  1793. 7
  1794. 7
  1795. 7
  1796. 7
  1797. 7
  1798. 7
  1799. 7
  1800. 7
  1801. 7
  1802. 7
  1803. 7
  1804. 7
  1805. 7
  1806. 7
  1807. 7
  1808. 7
  1809. 7
  1810. 7
  1811. 7
  1812. 7
  1813. 7
  1814. 7
  1815. 7
  1816. 7
  1817. 7
  1818. 7
  1819. 7
  1820. 7
  1821. 7
  1822. 7
  1823. 7
  1824. 7
  1825. 7
  1826. 7
  1827. 7
  1828. 7
  1829. 7
  1830. 7
  1831. 7
  1832. 7
  1833. 7
  1834. 7
  1835. 7
  1836. 7
  1837. 7
  1838. 7
  1839. 7
  1840. 7
  1841. 7
  1842. 7
  1843. 7
  1844. 7
  1845. 7
  1846. 7
  1847. 7
  1848. 7
  1849. 7
  1850. 7
  1851. 7
  1852. 7
  1853. 7
  1854. 7
  1855. 7
  1856. 7
  1857. 7
  1858. 7
  1859. 7
  1860. 7
  1861. 7
  1862. 7
  1863. 7
  1864. 7
  1865. 7
  1866. 7
  1867. 7
  1868. 7
  1869. 7
  1870. 7
  1871. 7
  1872. 7
  1873. 7
  1874. 7
  1875. 7
  1876. 7
  1877. 7
  1878. 7
  1879. 7
  1880. 7
  1881. 7
  1882. 7
  1883. 7
  1884. 7
  1885. 7
  1886. 7
  1887. 7
  1888. 7
  1889. 7
  1890. 7
  1891. 8
  1892. 8
  1893. 8
  1894. 8
  1895. 8
  1896. 8
  1897. 8
  1898. 8
  1899. 8
  1900. 8
  1901. 8
  1902. 8
  1903. 8
  1904. 8
  1905. 8
  1906. 8
  1907. 8
  1908. 8
  1909. 8
  1910. 8
  1911. 8
  1912. 8
  1913. 8
  1914. 8
  1915. 8
  1916. 8
  1917. 8
  1918. 8
  1919. 8
  1920. 8
  1921. 8
  1922. 8
  1923. 8
  1924. 8
  1925. 8
  1926. 8
  1927. 8
  1928. 8
  1929. 8
  1930. 8
  1931. 8
  1932. 8
  1933. 8
  1934. 8
  1935. 8
  1936. 8
  1937. 8
  1938. 8
  1939. 8
  1940. 8
  1941. 8
  1942. 8
  1943. 8
  1944. 8
  1945. 8
  1946. 8
  1947. 8
  1948. 8
  1949. 8
  1950. 8
  1951. 8
  1952. 8
  1953. 8
  1954. 8
  1955. 8
  1956. 8
  1957. 8
  1958. 8
  1959. 8
  1960. 8
  1961. 8
  1962. 8
  1963. 8
  1964. 8
  1965. 8
  1966. 8
  1967. 8
  1968. 8
  1969. 8
  1970. 8
  1971. 8
  1972. 8
  1973. 8
  1974. 8
  1975. 8
  1976. 8
  1977. 8
  1978. 8
  1979. 8
  1980. 8
  1981. 8
  1982. 8
  1983. 8
  1984. 8
  1985. 8
  1986. 8
  1987. 8
  1988. 8
  1989. 8
  1990. 8
  1991. 8
  1992. 8
  1993. 8
  1994. 8
  1995. 8
  1996. 8
  1997. 8
  1998. 8
  1999. 8
  2000. 8
  2001. 8
  2002. 8
  2003. 8
  2004. 8
  2005. 8
  2006. 8
  2007. 8
  2008. 8
  2009. 8
  2010. 8
  2011. 8
  2012. 8
  2013. 8
  2014. 8
  2015. 8
  2016. 8
  2017. 8
  2018. 8
  2019. 8
  2020. 8
  2021. 8
  2022. 8
  2023. 8
  2024. 8
  2025. 8
  2026. 8
  2027. 8
  2028. 8
  2029. 8
  2030. 8
  2031. 8
  2032. 8
  2033. 8
  2034. 8
  2035. 8
  2036. 8
  2037. 8
  2038. 8
  2039. 8
  2040. 8
  2041. 8
  2042. 8
  2043. 8
  2044. 8
  2045. 8
  2046. 8
  2047. 8
  2048. 8
  2049. 8
  2050. 8
  2051. 8
  2052. 8
  2053. 8
  2054. 8
  2055. 8
  2056. 8
  2057. 8
  2058. 8
  2059. 8
  2060. 8
  2061. 8
  2062. 8
  2063. 8
  2064. 8
  2065. 8
  2066. 8
  2067. 8
  2068. 8
  2069. 8
  2070. 8
  2071. 8
  2072. 8
  2073. 8
  2074. 8
  2075. 8
  2076. 8
  2077. 8
  2078. 8
  2079. 8
  2080. 8
  2081. 8
  2082. 8
  2083. 8
  2084. 8
  2085. 8
  2086. 8
  2087. 8
  2088. 8
  2089. 8
  2090. 8
  2091. 8
  2092. 8
  2093. 8
  2094. 8
  2095. 8
  2096. 8
  2097. 8
  2098. 8
  2099. 8
  2100. 8
  2101. 8
  2102. 8
  2103. 8
  2104. 8
  2105. 8
  2106. 8
  2107. 8
  2108. 8
  2109. 8
  2110. 8
  2111. 8
  2112. 8
  2113. 8
  2114. 8
  2115. 8
  2116. 8
  2117. 8
  2118. 8
  2119. 8
  2120. 8
  2121. 8
  2122. 8
  2123. 8
  2124. 8
  2125. 8
  2126. 8
  2127. 8
  2128. 8
  2129. 8
  2130. 8
  2131. 8
  2132. 8
  2133. 8
  2134. 8
  2135. 8
  2136. 8
  2137. 8
  2138. 8
  2139. 8
  2140. 8
  2141. 8
  2142. 8
  2143. 8
  2144. 8
  2145. 8
  2146. 8
  2147. 8
  2148. 8
  2149. 8
  2150. 8
  2151. 8
  2152. 8
  2153. 8
  2154. 8
  2155. 8
  2156. 8
  2157. 8
  2158. 8
  2159. 8
  2160. 8
  2161. 9
  2162. 9
  2163. 9
  2164. 9
  2165. 9
  2166. 9
  2167. 9
  2168. 9
  2169. 9
  2170. 9
  2171. 9
  2172. 9
  2173. 9
  2174. 9
  2175. 9
  2176. 9
  2177. 9
  2178. 9
  2179. 9
  2180. 9
  2181. 9
  2182. 9
  2183. 9
  2184. 9
  2185. 9
  2186. 9
  2187. 9
  2188. 9
  2189. 9
  2190. 9
  2191. 9
  2192. 9
  2193. 9
  2194. 9
  2195. 9
  2196. 9
  2197. 9
  2198. 9
  2199. 9
  2200. 9
  2201. 9
  2202. 9
  2203. 9
  2204. 9
  2205. 9
  2206. 9
  2207. 9
  2208. 9
  2209. 9
  2210. 9
  2211. 9
  2212. 9
  2213. 9
  2214. 9
  2215. 9
  2216. 9
  2217. 9
  2218. 9
  2219. 9
  2220. 9
  2221. 9
  2222. 9
  2223. 9
  2224. 9
  2225. 9
  2226. 9
  2227. 9
  2228. 9
  2229. 9
  2230. 9
  2231. 9
  2232. 9
  2233. 9
  2234. 9
  2235. 9
  2236. 9
  2237. 9
  2238. 9
  2239. 9
  2240. 9
  2241. 9
  2242. 9
  2243. 9
  2244. 9
  2245. 9
  2246. 9
  2247. 9
  2248. 9
  2249. 9
  2250. 9
  2251. 9
  2252. 9
  2253. 9
  2254. 9
  2255. 9
  2256. 9
  2257. 9
  2258. 9
  2259. 9
  2260. 9
  2261. 9
  2262. 9
  2263. 9
  2264. 9
  2265. 9
  2266. 9
  2267. 9
  2268. 9
  2269. 9
  2270. 9
  2271. 9
  2272. 9
  2273. 9
  2274. 9
  2275. 9
  2276. 9
  2277. 9
  2278. 9
  2279. 9
  2280. 9
  2281. 9
  2282. 9
  2283. 9
  2284. 9
  2285. 9
  2286. 9
  2287. 9
  2288. 9
  2289. 9
  2290. 9
  2291. 9
  2292. 9
  2293. 9
  2294. 9
  2295. 9
  2296. 9
  2297. 9
  2298. 9
  2299. 9
  2300. 9
  2301. 9
  2302. 9
  2303. 9
  2304. 9
  2305. 9
  2306. 9
  2307. 9
  2308. 9
  2309. 9
  2310. 9
  2311. 9
  2312. 9
  2313. 9
  2314. 9
  2315. 9
  2316. 9
  2317. 9
  2318. 9
  2319. 9
  2320. 9
  2321. 9
  2322. 9
  2323. 9
  2324. 9
  2325. 9
  2326. 9
  2327. 9
  2328. 9
  2329. 9
  2330. 9
  2331. 9
  2332. 9
  2333. 9
  2334. 9
  2335. 9
  2336. 9
  2337. 9
  2338. 9
  2339. 9
  2340. 9
  2341. 9
  2342. 9
  2343. 9
  2344. 9
  2345. 9
  2346. 9
  2347. 9
  2348. 9
  2349. 9
  2350. 9
  2351. 9
  2352. 9
  2353. 9
  2354. 9
  2355. 9
  2356. 9
  2357. 9
  2358. 9
  2359. 9
  2360. 9
  2361. 9
  2362. 9
  2363. 9
  2364. 9
  2365. 9
  2366. 9
  2367. 9
  2368. 9
  2369. 9
  2370. 9
  2371. 9
  2372. 9
  2373. 9
  2374. 9
  2375. 9
  2376. 9
  2377. 9
  2378. 9
  2379. 9
  2380. 9
  2381. 9
  2382. 9
  2383. 9
  2384. 9
  2385. 9
  2386. 9
  2387. 9
  2388. 9
  2389. 9
  2390. 9
  2391. 9
  2392. 9
  2393. 9
  2394. 9
  2395. 9
  2396. 9
  2397. 9
  2398. 9
  2399. 9
  2400. 9
  2401. 9
  2402. 9
  2403. 9
  2404. 9
  2405. 9
  2406. 9
  2407. 9
  2408. 9
  2409. 9
  2410. 9
  2411. 9
  2412. 9
  2413. 9
  2414. 9
  2415. 9
  2416. 9
  2417. 9
  2418. 9
  2419. 9
  2420. 9
  2421. 9
  2422. 9
  2423. 9
  2424. 9
  2425. 9
  2426. 9
  2427. 9
  2428. 9
  2429. 9
  2430. 9
  2431. 10
  2432. 10
  2433. 10
  2434. 10
  2435. 10
  2436. 10
  2437. 10
  2438. 10
  2439. 10
  2440. 10
  2441. 10
  2442. 10
  2443. 10
  2444. 10
  2445. 10
  2446. 10
  2447. 10
  2448. 10
  2449. 10
  2450. 10
  2451. 10
  2452. 10
  2453. 10
  2454. 10
  2455. 10
  2456. 10
  2457. 10
  2458. 10
  2459. 10
  2460. 10
  2461. 10
  2462. 10
  2463. 10
  2464. 10
  2465. 10
  2466. 10
  2467. 10
  2468. 10
  2469. 10
  2470. 10
  2471. 10
  2472. 10
  2473. 10
  2474. 10
  2475. 10
  2476. 10
  2477. 10
  2478. 10
  2479. 10
  2480. 10
  2481. 10
  2482. 10
  2483. 10
  2484. 10
  2485. 10
  2486. 10
  2487. 10
  2488. 10
  2489. 10
  2490. 10
  2491. 10
  2492. 10
  2493. 10
  2494. 10
  2495. 10
  2496. 10
  2497. 10
  2498. 10
  2499. 10
  2500. 10
  2501. 10
  2502. 10
  2503. 10
  2504. 10
  2505. 10
  2506. 10
  2507. 10
  2508. 10
  2509. 10
  2510. 10
  2511. 10
  2512. 10
  2513. 10
  2514. 10
  2515. 10
  2516. 10
  2517. 10
  2518. 10
  2519. 10
  2520. 10
  2521. 10
  2522. 10
  2523. 10
  2524. 10
  2525. 10
  2526. 10
  2527. 10
  2528. 10
  2529. 10
  2530. 10
  2531. 10
  2532. 10
  2533. 10
  2534. 10
  2535. 10
  2536. 10
  2537. 10
  2538. 10
  2539. 10
  2540. 10
  2541. 10
  2542. 10
  2543. 10
  2544. 10
  2545. 10
  2546. 10
  2547. 10
  2548. 10
  2549. 10
  2550. 10
  2551. 10
  2552. 10
  2553. 10
  2554. 10
  2555. 10
  2556. 10
  2557. 10
  2558. 10
  2559. 10
  2560. 10
  2561. 10
  2562. 10
  2563. 10
  2564. 10
  2565. 10
  2566. 10
  2567. 10
  2568. 10
  2569. 10
  2570. 10
  2571. 10
  2572. 10
  2573. 10
  2574. 10
  2575. 10
  2576. 10
  2577. 10
  2578. 10
  2579. 10
  2580. 10
  2581. 10
  2582. 10
  2583. 10
  2584. 10
  2585. 10
  2586. 10
  2587. 10
  2588. 10
  2589. 10
  2590. 10
  2591. 10
  2592. 10
  2593. 10
  2594. 10
  2595. 10
  2596. 10
  2597. 10
  2598. 10
  2599. 10
  2600. 10
  2601. 10
  2602. 10
  2603. 10
  2604. 10
  2605. 10
  2606. 10
  2607. 10
  2608. 10
  2609. 10
  2610. 10
  2611. 10
  2612. 10
  2613. 10
  2614. 10
  2615. 10
  2616. 10
  2617. 10
  2618. 10
  2619. 10
  2620. 10
  2621. 10
  2622. 10
  2623. 10
  2624. 10
  2625. 10
  2626. 10
  2627. 10
  2628. 10
  2629. 10
  2630. 10
  2631. 10
  2632. 10
  2633. 10
  2634. 10
  2635. 10
  2636. 10
  2637. 10
  2638. 10
  2639. 10
  2640. 10
  2641. 10
  2642. 10
  2643. 10
  2644. 10
  2645. 10
  2646. 10
  2647. 10
  2648. 10
  2649. 10
  2650. 10
  2651. 10
  2652. 10
  2653. 10
  2654. 10
  2655. 10
  2656. 10
  2657. 10
  2658. 10
  2659. 10
  2660. 10
  2661. 10
  2662. 10
  2663. 10
  2664. 10
  2665. 10
  2666. 10
  2667. 10
  2668. 10
  2669. 10
  2670. 10
  2671. 10
  2672. 10
  2673. 10
  2674. 10
  2675. 10
  2676. 10
  2677. 10
  2678. 10
  2679. 10
  2680. 10
  2681. 10
  2682. 10
  2683. 10
  2684. 10
  2685. 10
  2686. 10
  2687. 10
  2688. 10
  2689. 10
  2690. 10
  2691. 10
  2692. 10
  2693. 10
  2694. 10
  2695. 10
  2696. 10
  2697. 10
  2698. 10
  2699. 10
  2700. 10
In [148]:
linear_predictor <- y ~ -1 + intercept + alt + temp + rain + ndvi + 
  f(s.field, model = spde_model, group = s.field.group, control.group = list(model = "ar1"))

A_obsv <- inla.spde.make.A(mesh3, 
                           loc = as.matrix(obsv_data2[, c("longitude", "latitude")]),
                           group = obsv_data2$time,
                           n.group = temporal_mesh$n)

stack_obsv <- inla.stack(data = list(y = obsv_data2$positives),
                         A = list(A_obsv, 1, 1, 1, 1, 1),
                         effects = list(s_index,
                                        list(intercept = rep(1, nrow(obsv_data2))),
                                        list(alt = obsv_data2$alt),
                                        list(temp = obsv_data2$temp),
                                        list(rain = obsv_data2$rain),
                                        list(ndvi = obsv_data2$ndvi)),
                         tag = "obsv")

inla_model_ar <- inla(linear_predictor, 
                   data = inla.stack.data(stack_obsv),
                   Ntrials = obsv_data$examined,
                   family = "binomial",
                   control.predictor = list(A = inla.stack.A(stack_obsv), compute = TRUE),
                   control.compute = list(dic = TRUE, config = TRUE))
In [149]:
summary(inla_model_ar)
Out[149]:
Call:
c("inla(formula = linear_predictor, family = \"binomial\", data = inla.stack.data(stack_obsv), ",  "    Ntrials = obsv_data$examined, control.compute = list(dic = TRUE, ",  "        config = TRUE), control.predictor = list(A = inla.stack.A(stack_obsv), ",  "        compute = TRUE))")

Time used:
 Pre-processing    Running inla Post-processing           Total 
          1.200         275.105           0.763         277.068 

Fixed effects:
             mean     sd 0.025quant 0.5quant 0.975quant    mode kld
intercept -7.9600 3.8313   -15.4755  -7.9677    -0.4126 -7.9840   0
alt       -5.0606 3.1186   -11.1899  -5.0633     1.0747 -5.0703   0
temp       0.2395 0.0901     0.0618   0.2397     0.4158  0.2403   0
rain       0.0236 0.0193    -0.0146   0.0237     0.0614  0.0238   0
ndvi       1.6035 2.1037    -2.5558   1.6111     5.7167  1.6271   0

Random effects:
Name	  Model
 s.field   SPDE2 model 

Model hyperparameters:
                        mean     sd 0.025quant 0.5quant 0.975quant    mode
Theta1 for s.field   -2.9291 0.2729    -3.5214  -2.9058    -2.4507 -2.8429
Theta2 for s.field    1.3038 0.2659     0.8410   1.2805     1.8774  1.2199
GroupRho for s.field  0.0802 0.1778    -0.2707   0.0818     0.4208  0.0845

Expected number of effective parameters(std dev): 107.56(0.1772)
Number of equivalent replicates : 1.013 

Deviance Information Criterion (DIC) ...: 874.69
Effective number of parameters .........: 107.41

Marginal log-Likelihood:  -678.95 
Posterior marginals for linear predictor and fitted values computed

Validation statisticsΒΆ

  • Mean absolute error (MAE): Mean of (predicted-actual)
  • Mean percentage error (MPE): Mean of (predicted-actual/actual)
  • Mean absolute percentage error (MAPE): Mean of (abs(predicted-actual)/actual))
  • Root mean square error (RMSE): Square root of mean of squared (predicted-actual)