closed robust design mulitstrata - Psi definition question

My closed robust design multistrata model has 5 strata, including "U", the unobserved stratum. I'd like one of my models to have transitions to and from "U" be constant, while having another set of transitions (ones that make no sense biologically) fixed at zero, and have all remaining transitions be estimated. I can't think of a way to have these three different definitions of Psi in the same model.
Here's where I am so far:
I have been trying to create grouping indices for the U transitions (object name: PsiU), and for the nonsensical transitions (object name: Psi0), below is the code i've been trying to use to create Psi0:
the code is taken from someone else's script (see https://github.com/jlaake/RMark/blob/master/RMark/R/RMark-package.R and scroll down to the part about mulitistrata models) and they only used it to index a single transition. when i add more transitions, the code still runs but it only actually includes the first transition listed in the grouping index. So if you have a fix for that, i'd love to see it. I suppose i could create a set of indices and just list them in the parameter definition statement below, but there must be a simpler way.
I am able to define Psi so that the Psi0 transitions (or at least the one of them that is actually included in Psi0) are set to zero while estimating all other transitions as follows:
It seems like it shouldn't be possible to add in the PsiU transitions held constant, but I am hoping I'm wrong and someone else knows how to do this.
Thanks for any help you can give!
Here's where I am so far:
I have been trying to create grouping indices for the U transitions (object name: PsiU), and for the nonsensical transitions (object name: Psi0), below is the code i've been trying to use to create Psi0:
- Code: Select all
Psi0=as.numeric(row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="A"&crdms2.ddl$Psi$tostratum=="H",]), row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="A"&crdms2.ddl$Psi$tostratum=="J",]), row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="A"&crdms2.ddl$Psi$tostratum=="S",]), row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="H"&crdms2.ddl$Psi$tostratum=="A",]), row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="H"&crdms2.ddl$Psi$tostratum=="S",]), row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="J"&crdms2.ddl$Psi$tostratum=="A",]), row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="J"&crdms2.ddl$Psi$tostratum=="H",]), row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="S"&crdms2.ddl$Psi$tostratum=="H",]), row.names(crdms2.ddl$Psi[crdms2.ddl$Psi$stratum=="S"&crdms2.ddl$Psi$tostratum=="J",]))
the code is taken from someone else's script (see https://github.com/jlaake/RMark/blob/master/RMark/R/RMark-package.R and scroll down to the part about mulitistrata models) and they only used it to index a single transition. when i add more transitions, the code still runs but it only actually includes the first transition listed in the grouping index. So if you have a fix for that, i'd love to see it. I suppose i could create a set of indices and just list them in the parameter definition statement below, but there must be a simpler way.
I am able to define Psi so that the Psi0 transitions (or at least the one of them that is actually included in Psi0) are set to zero while estimating all other transitions as follows:
- Code: Select all
Psistos.specfix=list(formula=~1+stratum:tostratum,fixed=list(index=Psi0,value=0))
It seems like it shouldn't be possible to add in the PsiU transitions held constant, but I am hoping I'm wrong and someone else knows how to do this.
Thanks for any help you can give!