Changing default shared parameters

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

Changing default shared parameters

Postby bam59 » Mon Aug 15, 2016 12:29 pm

I was recently using 2-species occupancy models in RMark, and wanted to build additive covariate models where parameters share columns of the design matrix. The parameters that I wanted to share were not the default shareable parameters. With help from Jeff, I was able to change which parameters are shared and I wanted to outline the steps that I took here.

In the RMark library folder, open parameters.txt as a tab delimited file in Excel (save the original somewhere safe in case you screw up!). Scroll to the model of interest, where you should see one row listed per parameter type. The “formula”, “share”, and “pair” columns are the ones that need to be edited when you want to change which parameters can share columns of the design matrix. In each parameter pair, one parameter must be considered primary. The primary parameter serves as the reference, or intercept in the simplest additive model. For a primary parameter listed, edit the "pair" column to contain the name of the secondary (shared) parameter. The "share" column for the primary parameter must read “FALSE”, and the formula must read “~1”. When the secondary parameter is listed under parname, the primary parameter name should be listed in “pair”, but “share” and “formula” should be blank. If there are parameters that you do not wish to share, "formula" should read ~1 but “pair” and “share” should be blank.

It’s important to note that RMark creates pooled design data when parameters are shared. In the pooled design data, an additional column is added that serves as an indicator variable (coded as 0 for the primary parameter in the pair and 1 for the secondary parameter). Thus, parameters may only be shared if they have identical design data. If you edit the design data for one parameter in a pair, you must make similar changes for the other parameter.

A short example:
I wanted to build additive models between GammaA (primary) and GammaAB (secondary) in the 2-species dynamic occupancy model (GammaA and EpsilonA were the default shared parameters). pB (a detection parameter) is not shared. Here is what these lines in parameters.txt look like after editing:
Code: Select all
model           parname        …        formula    share      pair
RD2SpGEConOcc   GammaA         …          ~1       FALSE     GammaAB
RD2SpGEConOcc   GammaAB        …                             GammaA
RD2SpGEConOcc     pB           …          ~1


When fitting a model using RMark, “share=TRUE” is added to the parameter specification for the primary parameter. For example:
Code: Select all
GammaA = list(formula=~1+GammaAB+elev, share=TRUE)


would yield a design matrix where GammaA and GammaAB share a common intercept and there is an additive covariate (elevation) effect.
Code: Select all
                     GammaA:(Intercept)    GammaA:AB        GammaA:elev
GammaA g1 a0 t1            1                   0                elev
GammaAB g1 a0 t1           1                   1                elev


I hope that others find this useful!
bam59
 
Posts: 14
Joined: Wed Jul 03, 2013 6:24 pm
Location: University of Vermont

Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest

cron