Hi Adam,
My first thought would be to set this up directly rather than using HMM-specific tools. I think the model code would be something like this:
N_0_cont ~ dunif(0, 1000) # prior for N_0, over whatever range seems relevant
N_0 <- round(N_0_cont)
r ~ dunif(0, 1) # prior for r
n[1]~ Binomial(N_0, r) # indexing starts at 1, not 0, so this is your n_0
for(i in 2:C_max) {
n_new[i] ~ dbinom(n[i-1], E)
n[i] <- n[i-1] + n_new[i]
f[i] ~ dnorm(alpha * n[i], sd = sigma_f)
}
sigma_f ~ dunif(0, 10) # flat prior over whatever range seems relevant
E ~ dunif(0, 1) # flat prior
alpha ~ dunif(0, 100) # or alpha ~ T(dnorm(0, sd = 100), 0, Inf) to get a half-normal
If you want to see more about direct (and discrete) HMM support, take a look at the
vignette for nimbleEcology . The HMMs there are quite general. But if the N_0 and n_c values are large, you'd need to set up large transition and observation matrices, which you'd have to populate with values of interest, and you'd have to discretize f[c]. But if the above code makes sense, maybe try that first.
Perry