Discrepancy between MARK and RMark

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

Discrepancy between MARK and RMark

Postby ckampichler » Tue Jun 15, 2010 10:45 am

Hello,
RMark does not fit models to data, but builds models that are fitted to the data by MARK. So how does one explain different results when applying identical data to MARK and RMark? I ran some simple CJS-models (time dependent, group x time interactions, linear trend etc.) and the estimates of the real parameters differ up to 0.07. :? Also colleagues of mine have noticed this behaviour...
Thanks for an explanation!
ckampichler
 
Posts: 2
Joined: Tue Jun 15, 2010 9:20 am

Re: Discrepancy between MARK and RMark

Postby jlaake » Tue Jun 15, 2010 11:47 am

I see one or more of these types of emails every year. RMark simply creates an input file for MARK.exe and then extracts the results from the MARK.exe output file. When you create a model with MARK you are using its graphical user interface to create an input file which is passed to MARK.exe. The ONLY ways for differences to occur are differences in the data or differences in the model that was constructed. The latter includes the way the design matrix is constructed and the link functions that were used. By default, the link functions in RMark are logit for CJS parameters. If you used PIM constructed models in MARK then it uses the sin link. With some data this can make a difference. Also, in constructing DMs, RMark uses the first time (or other factor) as the intercept and MARK uses the last time (or other factor) as the intercept. Theoretically the models are the same but like with the link function this can affect the optimization code with some data sets. In summary, make sure your data are the same and the model specifications are the same. If you do that you'll find the results will be the same because they are using the same MARK.exe to fit the model.

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

Re: Discrepancy between MARK and RMark

Postby ckampichler » Fri Jun 18, 2010 6:09 am

jlaake wrote:I see one or more of these types of emails every year. RMark simply creates an input file for MARK.exe and then extracts the results from the MARK.exe output file. When you create a model with MARK you are using its graphical user interface to create an input file which is passed to MARK.exe. The ONLY ways for differences to occur are differences in the data or differences in the model that was constructed.

Jeff, I know that! That's precisely why I'm puzzled about different results when using IDENTICAL DATA and applying the SAME LINK FUNCTION.
jlaake wrote:Also, in constructing DMs, RMark uses the first time (or other factor) as the intercept and MARK uses the last time (or other factor) as the intercept. Theoretically the models are the same but like with the link function this can affect the optimization code with some data sets.

Okay, this seems to be interesting. I checked the design matrix in the RMark output and typed it to the MARK design specification window (first time used as intercept). When I run the model (simple time dependence {Phi(t)p(t)}, same data as used with RMark, same design matrix as used with RMark, same link function as used with RMark) it comes quite close to the RMark results now - - but the results still are not identical! Please see the table with the Phi and p estimates (MARK left, RMark right column):
Phi 0,0000008 0,0000029
Phi 0,2000030 0,2000000
Phi 0,3333339 0,3333334
Phi 0,7407710 0,7407412
Phi 0,3729916 0,3729947
Phi 0,5711705 0,5711539
Phi 0,2025665 0,2025700
Phi 0,6076725 0,6076388
Phi 0,4337565 0,4337662
Phi 0,5459531 0,5459463
Phi 0,4017036 0,4017045
Phi 0,3911487 0,3911486
Phi 0,5386397 0,5386335
Phi 0,3484836 0,3484848
Phi 0,1567232 0,1577664
p 0,6091755 0,5957711
p 1,0000000 1,0000000
p 1,0000000 1,0000000
p 0,1499969 0,1499998
p 0,3548371 0,3548385
p 0,2222155 0,2222222
p 0,5223972 0,5223878
p 0,1999947 0,2000000
p 0,3353329 0,3353294
p 0,2079212 0,2079206
p 0,2772283 0,2772275
p 0,3922416 0,3922413
p 0,4053994 0,4054056
p 0,4347854 0,4347830
p 0,9817204 0,9751518
Now, I'm not worried about the differences--they appear to be negligibly small--, but I still wonder how it's possible...
ckampichler
 
Posts: 2
Joined: Tue Jun 15, 2010 9:20 am

Re: Discrepancy between MARK and RMark

Postby dhewitt » Fri Jun 18, 2010 6:11 pm

Since I'm annoyingly anal about checking such things, Jeff and I chased the same kinds of tiny differences (5th or 6th decimal place or smaller) some time ago for CJS models. One possibility for the differences is the factor level order that Jeff noted. Another, it turned out, was that simply the order of the columns in the design matrix could change the results. So depending on how you set up your PIMS/DM in MARK, you could have a different DM than model.matrix creates in RMark before passing it to MARK. I was bewildered that this could affect the optimization routine. I just checked my email archive and I don't think we ever got any explanation from Gary about why this happens. But, this was for a rather sparse data set (not many recaptures) and it had some boundary estimates in it as well. As you note, the differences are completely trivial and probably don't happen for decent data sets anyway. It is nonetheless odd.

Dave
dhewitt
 
Posts: 150
Joined: Tue Nov 06, 2007 12:35 pm
Location: Fairhope, AL 36532


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest

cron