-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_gamma.txt
35 lines (27 loc) · 976 Bytes
/
model_gamma.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
33
34
model{
# priors:
alpha[1] <- 0 #area baseline
for (a in 2:A){alpha[a] ~ dnorm(0, 0.0001)}
for (a in 1:A){beta[1,a] <- 0 } #fleet baseline
beta[2, 1] <- 0 ; #area baseline
for (a in 2:A){ beta[2,a] ~ dnorm(0, 0.0001)}
# gamma[1] <- 0 #area baseline
# for (a in 2:A){gamma[a] ~ dnorm(0, 0.0001)}
epsilon[1] <- 0 #area baseline
for (a in 2:A){epsilon[a] ~ dnorm(0, 0.0001)}
for (a in 1:A){gamma[1,a] <- 0 } #fleet baseline
gamma[2,1] <- 0 ; #area baseline
for (a in 2:A){ gamma[2,a] ~ dnorm(0, 0.0001)}
tau ~ dgamma(0.001, 0.001) # prior for mixed effect precision
sd <- sqrt(1/tau)
for(f in 1:2){ #loop around fleet
for(y in 1:Y){ # loop around years
count[y,f,1:A] ~ dmulti(q[y,f,1:A], M[y,f])
for(a in 1:A){
re[y,f,a] ~ dnorm(0, tau)
q[y,f,a] <- phi[y,f,a]/sum(phi[y,f,])
log(phi[y,f,a]) <- alpha[a] + beta[f,a] + epsilon[a]*yearc[y] + gamma[f,a]*yearc[y] + re[y,f,a]
}
}
}
}