rbchan / unmarked

R package for hierarchical models in ecological research
https://rbchan.github.io/unmarked/
36 stars 25 forks source link

Default K calculations for distance sampling models are incorrect #275

Closed kenkellner closed 9 months ago

kenkellner commented 10 months ago

Use max count in any bin, not sum of all bins at a site

rbchan commented 10 months ago

Hmm, unlike binomial N-mix models, I think N must be larger than sum(y) not max(y) at each site in multinomial N-mix models. For example, if you had y=c(5, 3, 2) in 3 distance bins, then we know that N is at least 10 so K should be too.

kenkellner commented 10 months ago

Oops yeah in my comment I meant unmarked currently uses max count in any bin, which is incorrect. And yes the multinomial models in general also need to be fixed. I think gdistremoval is correct.

kenkellner commented 10 months ago

OK I think gdistsamp is doing it correctly, but distsampOpen is not

kenkellner commented 9 months ago

The same applies to gmultmix and multmixOpen as well I think.

@rbchan for example this line in gmultmix is technically not correct, regardless of the model type (removal/double), right?

https://github.com/rbchan/unmarked/blob/85603a57b6d5b3721fd8e5fc4dff50f3e666cc70/R/gmultmix.R#L32

rbchan commented 9 months ago

Yeah that's wrong