-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjagam_cartae.txt
32 lines (32 loc) · 1.32 KB
/
jagam_cartae.txt
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
model {
eta <- X %*% b ## linear predictor
for (i in 1:n) { mu[i] <- exp(eta[i]) } ## expected response
for (i in 1:n) { y[i] ~ dpois(mu[i]) } ## response
## Parametric effect priors CHECK tau=1/29^2 is appropriate!
for (i in 1:2) { b[i] ~ dnorm(0,0.0012) }
## prior for s(DOY)...
K1 <- S1[1:3,1:3] * lambda[1]
b[3:5] ~ dmnorm(zero[3:5],K1)
## prior for te(DOY,precip_2weeks)...
K2 <- S2[1:22,1:22] * lambda[2] + S2[1:22,23:44] * lambda[3] + S2[1:22,45:66] * lambda[4]
b[6:27] ~ dmnorm(zero[6:27],K2)
## prior for te(plot17aspect,plot17slope)...
K3 <- S3[1:24,1:24] * lambda[5] + S3[1:24,25:48] * lambda[6] + S3[1:24,49:72] * lambda[7]
b[28:51] ~ dmnorm(zero[28:51],K3)
## prior for te(LAI_1718avg,trap_CHM)...
K4 <- S4[1:24,1:24] * lambda[8] + S4[1:24,25:48] * lambda[9] + S4[1:24,49:72] * lambda[10]
b[52:75] ~ dmnorm(zero[52:75],K4)
## prior for s(collectDate)...
for (i in 76:99) { b[i] ~ dnorm(0, lambda[11]) }
## prior for s(col_year_fac)...
for (i in 100:103) { b[i] ~ dnorm(0, lambda[12]) }
## prior for s(plot_trap)...
for (i in 104:143) { b[i] ~ dnorm(0, lambda[13]) }
## prior for s(plotID)...
for (i in 144:153) { b[i] ~ dnorm(0, lambda[14]) }
## smoothing parameter priors CHECK...
for (i in 1:14) {
lambda[i] ~ dgamma(.05,.005)
rho[i] <- log(lambda[i])
}
}