fixing parameters with age structure in RMark

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

fixing parameters with age structure in RMark

Postby fredfrick » Thu Feb 05, 2009 12:58 pm

Hi,

I've just made the big switch to RMark for a Robust Design analysis of bat survival & breeding probabilities. So far, fairly good, but I have a few questions that I would greatly appreciate some help with. I've seen posts on similar issues as my question here and I've read the help files and the RMark appendix, but I'm still struggling to get the code just right - so any advice would be greatly appreciated.

My issue is:

I have bats marked as juveniles and marked as adults, and I am interested survival and temporary emigration (breeding prob) for two age stages (young, adults). I've followed the excellent instructions on how to create the binned age groups as such:

mylu.process<-process.data(mylu,begin.time=1993,model="Robust",time.intervals=ti,groups="age",initial.ages=c(1,0))
mylu.ddl<-make.design.data(mylu.process)
mylu.ddl<-add.design.data(mylu.process,mylu.ddl,parameter="S","age",bins=c(0,1,16),right=FALSE,name="ya")
mylu.ddl<-add.design.data(mylu.process,mylu.ddl,parameter="GammaDoublePrime","age",bins=c(0,1,16),right=FALSE,name="ya")
mylu.ddl<-add.design.data(mylu.process,mylu.ddl,parameter="GammaPrime","age",bins=c(0,1,16),right=FALSE,name="ya")

where mylu is my converted .inp file with my encounter histories with two groups 'marked as juveniles, marked as adults') and ti was vector for my capture occassions (16 years, 2 capture occ per year = 32 capture occ):

Now, I want to create models that have a formula=~ya structure for GammaDoublePrime (GDP) parameter, such that juveniles/young GDP is estimated but GDP parameter is fixed at 0 (the biological question being that prob of temp emigration for adults being 0, but juveniles have some prob of leaving the colony/not breeding in their first year). I am using a 'random' temp emigration model here by fixing GammaPrime to GammaDoublePrime using the share=T argument.

The problem I am having is that somehow the syntax for fixing the parameter based on the 'ya' binned variable doesn't work. My guess is that it is because of the binned structure in the ya variable in the ddl. It sounds like from the help files, this should still work, but alas, I'm apparently not that clever...

I tried:
GammaDoublePrime.ya.fixed.random=list(formula=~ya,fixed=list(ya="Adult",value=0),share=T) #but "Adult" isn't used in the ya column of the ddl
GammaDoublePrime.ya.fixed.random=list(formula=~ya,fixed=list(ya=c(1:16),value=0),share=T)

When I then try to run a model using GammaDoublePrime = GammaDoublePrime.ya.fixed.random
But I get an error message saying "unrecognized structure for fixed parameters = Error in cat (list(...), file, sep,fill, labels, append): argument 2 (type 'list') cannot be handled by 'cat'

I have also tried removing the share=T argument and just fixing GammaPrime to 0 separately. But there is still something amiss with the GDP formula statement.

Fixing for some other variable like time works, so my guess is that the problem is due to the binned nature of the ya variable. But I don't think using 'initial.age.class' will work, because I want the 'age' structure on the PIMS where a bat marked as a juvenile/young then moves into the adult stage at the next time step. Using the 'index' feature of the 'fixed' command seems to work, except I haven't quite figured out how to accurately determine my real parameter indices for each model run.
Eventually, I also want to run models that have a year-varying covariate (such as a fall/spring severity index) on both survival and GDP - but have models where the covariate influences either juveniles/young or adults, but not both, so figuring out how to apply a covariate to the ya variable is the next step after determining the fixing parameter problem - this seems like a related issue, in my head at least.

Finally, one last other question - I have fit some of my more simpler models in both RMark and Mark and for models that have the exact same structure (or so I think) there are ever so slightly different parameter values (in the 3rd/4th decimal places) - which I'm figuring is just due to rounding differences, etc. and shouldn't be interpreted as some problem with my model structure. Confirmation on that would be appreciated.

Thanks in advance for your help!
fredfrick
 
Posts: 2
Joined: Mon Sep 22, 2008 5:42 pm

Postby jlaake » Thu Feb 05, 2009 1:33 pm

I appreciate your posting to the list but I think we can take this offlist if you want and we can work out the issues and then repost to the list. It looks like you have all the initial syntax correctly specified.

With regard to fixing parameters, you are not alone. Most people try what you did for the fixed parameters but the code does not allow it. The fixed notation only allows age, time, cohort or index specifications. It will not accept other specifications that you add to the design data like your "ya" variable directly. The index approach is the most flexible and allows any specification. The indices are the same across all models for a given structure of the data (ie groups, model type etc). The section in Appendix C shows examples of R syntax for finding the indices for a given set of of the design data (eg ya=0). That is the approach you'll need to take at present and I can help you with that.

With regards to differences between MARK and RMark, in general if the data are the same and the model specifications are the same, then the results should be exactly the same because they are both using MARK.EXE to fit the model. The only possible differences are differences in the ways models can be set up in MARK (eg link functions, design matrix, PIMS etc). That said, you can get slight differences in some rare cases if the link functions are different and/or the design matrices are specified differently. But I've not seen this often except when parameters are at boundaries. If you want I can help you try to resolve those differences.

--jeff
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest

cron