-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathebase_model.txt
More file actions
59 lines (43 loc) · 1.37 KB
/
Copy pathebase_model.txt
File metadata and controls
59 lines (43 loc) · 1.37 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
## JAGS model
model{
# -------
# PRIORS
# set priors
# amean <- 0.2 / nstepd
# bmean <- 0.251 / (100 * 3600 / interval)
# a ~ dunif(arng[1] * amean, 2 * arng[2])
# r ~ dnorm(0, 1 / rvar)T(0,)
# b ~ dunif(brng[1] * bmean, brng[2] * bmean) # note that Wanninkhof reports uncertainty of this parameter at +/- 20%
# set priors
amean <- 0.2 / nstepd
asd <- 0.01 * amean
atau <- 1 / (asd * asd)
rmean <- 20 / nstepd
rsd <- 1.341 * rmean
rtau <- 1 / (rsd * rsd)
bmean <- 0.251 / 400
bsd <- 1.341 * bmean
btau <- 1 / (0.02)
a ~ dnorm(amean, atau)T(0,)
r ~ dnorm(rmean, rtau)T(0,)
b ~ dnorm(bmean, btau)T(0,)
tau ~ dgamma(1,0.001)
#--------
# model
# DO modelled
zz ~ dnorm(0,1000000)
DO_mod[1] <- DO_obs[1] + zz # make monitorable
for (i in 1:(num.measurements-1)){
DO_obs[i+1] ~ dnorm(DO_mod[i+1], tau)
DO_mod[i+1] <- DO_mod[i]
+ a * PAR[i]
- r
- (1 / H[i]) * (-b * pow(U10[i], 2) * pow(sc[i] / 600, -0.5) * (DO_sat[i] - DO_mod[i]))
# posterior predictive assessment nodes #
ats[i] <- a
bts[i] <- b
gppts[i] <- a * PAR[i]
erts[i] <- r
gets[i] <- (1 / H[i]) * (b * pow(U10[i], 2) * pow(sc[i] / 600, -0.5) * (DO_sat[i] - DO_mod[i]))
}
}