Q on multispecies models in spOccupancy/spAbundance

42 views
Skip to first unread message

Marc Kery

unread,
Jun 4, 2024, 1:19:14 PMJun 4
to hmec...@googlegroups.com
Dear all,

in the multispecies occupancy and abundance models in Jeff Doser's new packages, species-level parameters are estimated as random effects, that is, subject to the distributional assumption that they are (on some link scale) drawn from a normal distribution with parameters that describe the community. Treating species-level parameters as random effects will often be a useful choice, and it is the standard in such models, but sometimes one may want to estimate the parameters of each species completely 'separately', i.e., as fixed effects.

In the specific function we're using for some multispecies abundance modeling, msNmix(), it does not seem possible to treat a set of species-level parameters as fixed effects; do I see this right ? Would that be possible in some way ? For instance, fixed-effects parameters are like random effects parameters when the variance hyperparameter is infinity. So, if it was possible to fix that parameter at some high value, such as 10^3 or more, then one might obtain a good approximation to fixed-effects parameter estimates.

Thanks and best regards  – Marc



Jeff Doser

unread,
Jun 4, 2024, 2:04:16 PMJun 4
to Marc Kery, hmec...@googlegroups.com
Hi Marc,

Allowing for the species-level parameters to be estimated separately is something I'm currently working on incorporating into all multi-species models in the packages. The way to go about doing it is to specify the following two tags in the prior list

      priors <- list(independent.betas = TRUE, independent.alphas = TRUE)

where the "betas" is for abundance/occupancy and "alphas" is for detection. This will result in each of the species-level parameters as having an independent normal prior, and the mean and variance of those priors is controlled by specifying the initial values for the community-level parameters in the "inits" argument of the model-fitting function.

This functionality is not currently supported for all models, but I should hopefully have that done over the next few months. The updates to the CRAN version of the package can be tracked via the changelogs on the package websites (spAbundance and spOccupancy). I just added the functionality for msNMix() in the development version of the package on GitHub, which you can install via devtools::install_github("doserjef/spAbundance"). I've attached an example of how to do this for a multi-species N-mixture model with msNMix() and a simulated data set.  

Kind regards,

Jeff

--
*** Three hierarchical modeling email lists ***
(1) unmarked: for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology (this list): for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
---
You received this message because you are subscribed to the Google Groups "hmecology: Hierarchical Modeling in Ecology" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hmecology+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hmecology/ZR0P278MB0869506C868A842D61B3E2E8EBF82%40ZR0P278MB0869.CHEP278.PROD.OUTLOOK.COM.
msNMix-fixed-species-effects.R

Marc Kery

unread,
Jun 5, 2024, 4:08:58 AMJun 5
to Jeff Doser, hmec...@googlegroups.com
Dear Jeff,

wow, what a quick and helpful answer; thank you ! And such a serendipity that you had just added this functionality in the very function we are using.

One more question: If we have several covariates and only want to model the coefficients of one of them as fixed effects, but the covariates of the others as random effects as in the standard model, would that be possible ?

Thanks and best regards  – Marc



From: Jeff Doser <jdos...@gmail.com>
Sent: Tuesday, June 4, 2024 20:04
To: Marc Kery <marc...@vogelwarte.ch>
Cc: hmec...@googlegroups.com <hmec...@googlegroups.com>
Subject: Re: Q on multispecies models in spOccupancy/spAbundance
 

Jeff Doser

unread,
Jun 5, 2024, 5:33:36 AMJun 5
to Marc Kery, hmec...@googlegroups.com
Hi Marc,

Glad that was helpful! No, unfortunately the approach will only allow you to specify all the species-level effects as fixed effects or all of them as random following the standard model.

Jeff

Marc Kery

unread,
Jun 5, 2024, 5:35:28 AMJun 5
to Jeff Doser, hmec...@googlegroups.com
Dear Jeff,

thanks for the additional explanation.

Best regards  --- Marc


From: Jeff Doser <jdos...@gmail.com>
Sent: Wednesday, June 5, 2024 11:33
Reply all
Reply to author
Forward
0 new messages