Skip to content

Goodness of fit for complex MRDS model #96

@erex

Description

@erex

Email from user indicated following error when using ddf.gof()

Mark-recapture component: 
Capture History 10 
[0,50] (50,100] (100,200] (200,300] Total 
Observed 131 118 160 81 490 
Expected 132 109 178 70 489 
Chisquare 0 1 2 2 4 
Capture History 01 
[0,50] (50,100] (100,200] (200,300] Total 
Observed 136 112 179 54 481 
Expected 134 112 178 58 482 
Chisquare 0 0 0 0 0 
Capture History 11 
[0,50] (50,100] (100,200] (200,300] Total 
Observed 126 78 128 21 353 
Expected 127 87 112 28 353 
Chisquare 0 1 2 2 5 
Total chi-square = 17.214 P = NaN with -32 degrees of freedom 
Warning message: In pchisq(chisq.1 + chisq.2, 3 * nc - length(model$par) - 1) : NaNs produced

As shown, data were binned with 4 intervals, fitted mrmodel had 29 estimated parameters:

> summary(MRDS.6ii7)
Summary for io.fi object
Number of observations : 1324
Number seen by primary : 843
Number seen by secondary : 834
Number seen by both : 353
AIC : 2705.31
Conditional detection function parameters:
                 estimate         se
(Intercept)        -1.0796625270 0.277260949
obsnameBP           1.1046744569 0.361828611
obsnameBW           0.5433139316 0.394464395
obsnameCF           1.1961084816 0.382167121
obsnameCS           1.1934733554 0.396189048
obsnameDH           0.7954464197 0.343565299
obsnameEC           1.1975425396 0.395574213
obsnameMG           0.5859840295 0.362524121
obsnameMH           2.1259248539 0.409690893
obsnamePL           1.5807107511 0.425884100
obsnamePOB          0.5848155343 0.401523354
obsnameRL           2.5931041668 0.495230694
obsnameRT           1.7839252838 0.421544945
obsnameSD           1.4995302978 0.439472284
distance           -0.0036643313 0.002600023
obsnameBP:distance -0.0099988195 0.003096288
obsnameBW:distance  0.0078620272 0.003474921
obsnameCF:distance -0.0067997640 0.003229027
obsnameCS:distance -0.0007569504 0.003252560
obsnameDH:distance -0.0017379043 0.002718869
obsnameEC:distance -0.0030372291 0.003149064
obsnameMG:distance  0.0046375639 0.003172420
obsnameMH:distance -0.0114362985 0.003412340
obsnamePL:distance -0.0102762333 0.003554344
obsnamePOB:distance 0.0068440041 0.003242920
obsnameRL:distance -0.0089213506 0.003706149
obsnameRT:distance -0.0079749867 0.003662896
obsnameSD:distance  0.0011171377 0.004304027
distance:size       0.0008886445 0.000333803

Solution should be to have ddf.gof test the number of parameters against the number of bins and not attempt a test if there are insufficient remaining degrees of freedom.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions