release.gof error with POPAN

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

release.gof error with POPAN

Postby kern.ra » Tue Mar 31, 2015 11:16 am

Hi users -

I'm calculating population size (N) from mark-recapture data and running into an error I can't figure out. I have four years of data, but I would like to estimate N using just two years of data (two capture occasions). The mark POPAN model runs just fine, but I encounter an error when trying to test goodness-of-fit.

> data.sals=import.chdata("SALS capture history JS 2012-13.txt", header=T)
> summary(data.sals)
ch Site
Length:431 AT:171
Class :character MW:175
Mode :character OC: 85
> proc.data.sals1=process.data(data=data.sals, model="POPAN", groups="Site")
> release.gof(proc.data.sals1)
RELEASE NORMAL TERMINATION
Error in (x3 + 4):length(out) : argument of length 0

When I use all four years of data, however, release.gof works just fine.

> data.sals=import.chdata("SALS capture history JS 2011-14.txt", header=T)
> summary(data.sals)
ch Site
Length:768 AT:318
Class :character MW:299
Mode :character OC:151
> proc.data.sals=process.data(data=data.sals,model="POPAN", begin.time=2011,groups="Site")
> release.gof(proc.data.sals)
RELEASE NORMAL TERMINATION
Chi.square df P
TEST2 1.5746 3 0.6652
TEST3 1.1538 8 0.9971
Total 2.7284 11 0.9939

Can anyone clarify why this is happening and how I could run the GOF test on the two year subset of data? Many thanks!
kern.ra
 
Posts: 4
Joined: Sat Oct 04, 2014 6:28 pm

Re: release.gof error with POPAN

Postby jlaake » Tue Mar 31, 2015 11:18 am

You need at least 3 occasions for an open population model, so I'm not sure what you have done to get POPAN to work with 2 occasions.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: release.gof error with POPAN

Postby kern.ra » Tue Mar 31, 2015 11:25 am

Ah, that explains it! Thank you for the prompt reply. My POPAN code is below...I'm not sure why it runs without an error since there are only 2 occasions.

> data.sals=import.chdata("SALS capture history JS 2012-13.txt", header=T)
> proc.data.sals=process.data(data=data.sals,model="POPAN", begin.time=2012,groups="Site")
> ddl.sals=make.design.data(proc.data.sals)
> mark.model.sals=mark(proc.data.sals, ddl=ddl.sals, model="POPAN", begin.time=2012, groups="Site")
STOP NORMAL EXIT

Note: only 2 parameters counted of 4 specified parameters

AICc and parameter count have been adjusted upward


Output summary for POPAN model
Name : Phi(~1)p(~1)pent(~1)N(~1)

Npar : 4 (unadjusted=2)
-2lnL: 205.7197
AICc : 213.8074 (unadjusted=209.74585)

Beta
estimate se lcl ucl
Phi:(Intercept) -2.0626346 0.1938314 -2.4425442 -1.6827250
p:(Intercept) 22.7699390 2581.6502000 -5037.2645000 5082.8043000
pent:(Intercept) -0.4775508 0.0990959 -0.6717788 -0.2833228
N:(Intercept) -20.2796930 1991.8318000 -3924.2702000 3883.7108000


Real Parameter Phi
2012
Group:SiteAT 0.1127819
Group:SiteMW 0.1127819
Group:SiteOC 0.1127819


Real Parameter p
2012 2013
Group:SiteAT 1 1
Group:SiteMW 1 1
Group:SiteOC 1 1


Real Parameter pent
2013
Group:SiteAT 0.3828306
Group:SiteMW 0.3828306
Group:SiteOC 0.3828306


Real Parameter N
2012
Group:SiteAT 171
Group:SiteMW 171
Group:SiteOC 171
> popan.derived.sals=popan.derived(proc.data.sals,mark.model.sals,N=T)
> popan.derived.sals
$N
Site Occasion N se LCL UCL
1 AT 1 105.53596 4.003714 97.68868 113.38324
2 AT 2 77.36659 4.099713 69.33115 85.40203
3 MW 1 108.00464 4.097368 99.97380 116.03548
4 MW 2 79.17633 4.195613 70.95293 87.39973
5 OC 1 52.45940 1.990150 48.55870 56.36009
6 OC 2 38.45708 2.037869 34.46285 42.45130

$N.vcv
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 16.029724 -14.221860 16.404688 -14.554535 7.967991 -7.069346
[2,] -14.221860 16.807649 -14.554535 17.200810 -7.069346 8.354679
[3,] 16.404688 -14.554535 16.788424 -14.894992 8.154377 -7.234711
[4,] -14.554535 17.200810 -14.894992 17.603168 -7.234711 8.550110
[5,] 7.967991 -7.069346 8.154377 -7.234711 3.960697 -3.514002
[6,] -7.069346 8.354679 -7.234711 8.550110 -3.514002 4.152911

$Nbyocc
Occasion N se LCL UCL
1 1 266 10.09123 246.2212 285.7788
2 2 195 10.33320 174.7469 215.2531

$Nbyocc.vcv
[,1] [,2]
[1,] 101.83296 -90.34804
[2,] -90.34804 106.77493

$NGross
[1] 266.5585 272.7938 132.4998

$NGross.vcv
[,1] [,2] [,3]
[1,] 118.22452 120.99000 58.76657
[2,] 120.99000 123.82018 60.14123
[3,] 58.76657 60.14123 29.21145

$BiGross
Site occasion estimate se
1 AT 1 105.5360 4.003714
1.1 AT 2 266.5585 10.873110
2 MW 1 108.0046 4.097368
2.1 MW 2 272.7938 11.127451
3 OC 1 52.4594 1.990150
3.1 OC 2 132.4998 5.404762

$BiGross.vcv
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 16.029724 -23.39875 16.404688 -23.94609 7.967991 -11.63096
[2,] -23.398748 118.22452 -23.946087 120.99000 -11.630957 58.76657
[3,] 16.404688 -23.94609 16.788424 -24.50623 8.154377 -11.90303
[4,] -23.946087 120.99000 -24.506230 123.82018 -11.903026 60.14123
[5,] 7.967991 -11.63096 8.154377 -11.90303 3.960697 -5.78147
[6,] -11.630957 58.76657 -11.903026 60.14123 -5.781470 29.21145
kern.ra
 
Posts: 4
Joined: Sat Oct 04, 2014 6:28 pm

Re: release.gof error with POPAN

Postby jlaake » Tue Mar 31, 2015 11:27 am

Notice that it fixed p to 1. You can't estimate all of the parameters.
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: release.gof error with POPAN

Postby kern.ra » Tue Mar 31, 2015 11:39 am

Yes, I see now. Thank you!
kern.ra
 
Posts: 4
Joined: Sat Oct 04, 2014 6:28 pm


Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest