KevinSee / DABOM

Dam Adult Branch Occupancy Model
https://kevinsee.github.io/DABOM/
Other
1 stars 5 forks source link

Fixing some phi's to 0 #15

Closed KevinSee closed 3 years ago

KevinSee commented 3 years ago

For versions of DABOM with wild and hatchery fish (e.g. Priest Rapids steelhead), the createJAGSinputs_PRA() function sets some of the Dirichlet priors on all the multinomials to 0, if no fish moved along that branch. It allows those priors to be different for hatchery and wild fish, so it can turn a branch "off" for hatchery fish but "on" for wild fish.

However, the fixNoFishNodes() function doesn't do something similar for the phi parameters. If no fish are observed past a node with a phi parameter leading up to it, then it sets that phi parameter to 0. However, if some wild fish but no hatchery fish are observed at that node, the phi parameters for both wild and hatchery fish will be estimated. This is inconsistent with the multinomial nodes described above, and could be corrected for consistency.

KevinSee commented 3 years ago

Note that the priors for the phi parameters are set within loops ( for (i in 1:2) { ) so fixing this in the JAGS file may involve changing how those parameters are introduced or described.

KevinSee commented 3 years ago

using the new writeDABOM function, the phi parameters are initialized a little differently, making it easier to set certain ones to zero. The fixNoFishNodes function now sets them to 0 when appropriate based on the correct indexing (origin: H or W)