re: New to Species Distribution Models in R-INLA

834 views
Skip to first unread message

Marina FP

unread,
Jan 8, 2018, 2:57:55 PM1/8/18
to R-inla discussion group
Could someone direct me to some simple examples of species distribution models in INLA? I need some that uses point data and not areal and models built with presence-only data. I am just starting to learn INLA and Bayesian analysis so something that breaks down data formatting and R code is necessary. Also is it possible to use R-INLA for presence-absence modeling with data that represent repeat visits such that detection probability is estimated?

Bob O'Hara

unread,
Jan 8, 2018, 3:35:27 PM1/8/18
to Marina FP, R-inla discussion group
You could have a look at this package that I've been working on:
<https://github.com/oharar/PointedSDMs>
It does presence only data (as a point process), and also
presence/absence models with repeated visits. Note that this isn't the
same as an occupancy model, as it doesn't estimate whether the species
is actually present at a site, only the intensity. A proper occupancy
model would be impossible in INLA, I think, without combining it with
some horrible simulation. But I'm not sure that's a big problem in
practice.

Feel free to ask if you run into any problems: this is very much still
in development.

Bob
> --
> You received this message because you are subscribed to the Google Groups
> "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to r-inla-discussion...@googlegroups.com.
> To post to this group, send email to
> r-inla-disc...@googlegroups.com.
> Visit this group at https://groups.google.com/group/r-inla-discussion-group.
> For more options, visit https://groups.google.com/d/optout.



--
Bob O'Hara
NOTE NEW ADDRESS!!!
Institutt for matematiske fag
NTNU
7491 Trondheim
Norway

Mobile: +49 1515 888 5440
Journal of Negative Results - EEB: www.jnr-eeb.org

Marina FP

unread,
Jan 8, 2018, 4:23:48 PM1/8/18
to R-inla discussion group
Cool, thank you I will peruse the GitHub

Finn Lindgren

unread,
Jan 8, 2018, 4:50:06 PM1/8/18
to Marina FP, R-inla discussion group
Hi,
I don’t we’ve tried presence only models in the new inlabru package (See inlabru.org, the stable version is also on CRAN), but it was developed for point data for species distribution, so it just might work. It’s a wrapper around inla that simplifies spatial models (the user doesn’t need to see any “stacks”), and also allows some nonlinearities in the predictor (which we used for the detection probability model in distance sampling).

Bob, perhaps that method might also be applicable to some of the not-quite-inla-able problems you mentioned?

Finn

On 8 Jan 2018, at 19:57, Marina FP <mlf...@gmail.com> wrote:

Could someone direct me to some simple examples of species distribution models in INLA? I need some that uses point data and not areal and models built with presence-only data. I am just starting to learn INLA and Bayesian analysis so something that breaks down data formatting and R code is necessary. Also is it possible to use R-INLA for presence-absence modeling with data that represent repeat visits such that detection probability is estimated?

--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.

Marina FP

unread,
Jan 8, 2018, 5:06:05 PM1/8/18
to R-inla discussion group
Hi Finn, 

Great, thanks. I will look at that R package website. 


On Monday, January 8, 2018 at 2:50:06 PM UTC-7, Finn Lindgren wrote:
Hi,
I don’t we’ve tried presence only models in the new inlabru package (See inlabru.org, the stable version is also on CRAN), but it was developed for point data for species distribution, so it just might work. It’s a wrapper around inla that simplifies spatial models (the user doesn’t need to see any “stacks”), and also allows some nonlinearities in the predictor (which we used for the detection probability model in distance sampling).

Bob, perhaps that method might also be applicable to some of the not-quite-inla-able problems you mentioned?

Finn

On 8 Jan 2018, at 19:57, Marina FP <mlf...@gmail.com> wrote:

Could someone direct me to some simple examples of species distribution models in INLA? I need some that uses point data and not areal and models built with presence-only data. I am just starting to learn INLA and Bayesian analysis so something that breaks down data formatting and R code is necessary. Also is it possible to use R-INLA for presence-absence modeling with data that represent repeat visits such that detection probability is estimated?

--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsub...@googlegroups.com.

Bob O'Hara

unread,
Jan 9, 2018, 3:46:17 AM1/9/18
to Finn Lindgren, Marina FP, R-inla discussion group
Hi!

I think INLAbru is doing some similar things to what I'm trying to do,
but I'm also interested in providing a tool which can combine
different types of data, as that's what we often have.

Bob

Haakon Bakka

unread,
Jan 9, 2018, 4:01:49 AM1/9/18
to Marina FP, R-inla discussion group
Hi Marina,

## Example
On the original question, you can find one code example here
with discussion here
(Yes, the paper is about a new model, but you can ignore that part and read the application)

## Exposure
Estimating the exposure coefficient can be done by just adding log exposure as a covariate. Or, if there is no covariate information, use an iid effect (but this may not be identifiable).


## Resources
There is a book by Cameletti, that I have read, one by Zuur, who I know. Both of these are quite good for an ecologist / for SDM I think!
There is also a third book, but I do not know anything about this one unfortunately.


Kind regards,
Haakon Bakka





> To post to this group, send email to

> Visit this group at https://groups.google.com/group/r-inla-discussion-group.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> To post to this group, send email to
--
Bob O'Hara
NOTE NEW ADDRESS!!!
Institutt for matematiske fag
NTNU
7491 Trondheim
Norway

Mobile: +49 1515 888 5440
Journal of Negative Results - EEB: www.jnr-eeb.org

--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsub...@googlegroups.com.
To post to this group, send an email to r-inla-discussion-group@googlegroups.com.

Finn Lindgren

unread,
Jan 9, 2018, 4:23:39 AM1/9/18
to Bob O'Hara, R-inla discussion group

> On 9 Jan 2018, at 08:46, Bob O'Hara <rni...@gmail.com> wrote:
> I think INLAbru is doing some similar things to what I'm trying to do,
> but I'm also interested in providing a tool which can combine
> different types of data, as that's what we often have.

If the models are Latent Gaussian Models with multiple observation likelihood’s, that’s fine, and easier with inlabru than inla. What matters is how nonlinear the links between the latent Gaussian variables and the likelihood’s are. Or do you mean something else by “different types of data”?

Finn

Bob O'Hara

unread,
Jan 9, 2018, 4:28:14 AM1/9/18
to Finn Lindgren, R-inla discussion group
I meant latent Gaussian models with multiple likelihoods. It's not too
difficult to see what the model looks like, but a hassle to format the
data and get the model correct (this is true whatever software you're
using).

Bob

Finn Lindgren

unread,
Jan 9, 2018, 4:46:13 AM1/9/18
to Bob O'Hara, R-inla discussion group
Indeed. In inlabru one specifies the collection of components in the model separately, and then provide one separate formula for each likelihood. It removes a lot of the hassle! We also provide a predict() method for fairly arbitrary expressions, which calls inla.posterior.sample() internally.

We’re likely to implement a further extension for multivariate likelihood’s (like Dirichlet for compositional data; that’s a current research project).

Finn

Marina FP

unread,
Jan 9, 2018, 2:48:54 PM1/9/18
to R-inla discussion group
Hi Haakon, 

This is very helpful. Thank you for directing me to the code example. 

Best-Marina

> Visit this group at https://groups.google.com/group/r-inla-discussion-group.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to r-inla-discussion-group+unsub...@googlegroups.com.
> To post to this group, send email to
--
Bob O'Hara
NOTE NEW ADDRESS!!!
Institutt for matematiske fag
NTNU
7491 Trondheim
Norway

Mobile: +49 1515 888 5440
Journal of Negative Results - EEB: www.jnr-eeb.org

--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsub...@googlegroups.com.
To post to this group, send an email to r-inla-disc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages