Skip to content

Commit

Permalink
make prior for x explicit in example
Browse files Browse the repository at this point in the history
  • Loading branch information
danielturek committed Jun 14, 2024
1 parent 61c6c90 commit a19e52f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion joss/paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ Binary-valued latent states $x_{i,t}$ represent the true alive (1) or dead (0)
state of individual $i$ on year $t$. Doing so allows the survival
process to be modelled as $x_{i,t+1}~\sim~\text{Bernoulli}(\phi_{f_t} \cdot
x_{i,t})$ where $f_t$ indicates the flood/non-flood history of year
$t$, and observations are modelled as $y_{i,t}~\sim~\text{Bernoulli}(p \cdot x_{i,t})$.
$t$. The model structure conditions on the first observation of each individual, where $\text{first}_i$ is the first observation period of individual $i$, and $x_{i,\text{first}_i}$ is assigned the value one.
Observations are modelled as $y_{i,t}~\sim~\text{Bernoulli}(p \cdot x_{i,t})$.

```
library(nimbleHMC)
Expand All @@ -133,6 +134,7 @@ code <- nimbleCode({
phi[2] ~ dunif(0, 1)
p ~ dunif(0, 1)
for(i in 1:N) {
x[i,first[i]] <- 1
for(t in (first[i]+1):T) {
x[i,t] ~ dbern(phi[f[t]] * x[i,t-1])
y[i,t] ~ dbern(p * x[i,t])
Expand Down
Binary file modified joss/paper/paper.pdf
Binary file not shown.

0 comments on commit a19e52f

Please sign in to comment.