inlabru-org / inlabru

inlabru
https://inlabru-org.github.io/inlabru/
88 stars 21 forks source link

Detection function integration range #21

Closed dill closed 7 years ago

dill commented 7 years ago

A little unclear what the integration range is that's used in the following model (no spatial process specified, just fitting detection function):

library(inlabru)
init.tutorial()
data(mrsea)
mdl = distance ~ beta.df(map=distance^2, model="linear") + Intercept
r = lgcp(mrsea$points, model = mdl)
pr = predict(r, distance ~ exp(beta.df * distance^2))
plot(pr)

Note that adding 100 to all the distances does something to increase the max distance? But maybe also does something in terms of left truncation too:

mrsea$points$distance <- mrsea$points$distance+100
r = lgcp(mrsea$points, model = mdl)
pr = predict(r, distance ~ exp(beta.df * distance^2))
plot(pr)

Plots for these (note x and y axis limits):

screen shot 2017-03-22 at 13 46 50

(Note the left truncation stuff isn't trivial and there are a couple of ways of dealing with it.)

finnlindgren commented 7 years ago

When no domain is specified it infers it from the data range. Since it doesn't know you're trying to model a detection function it doesn't fix the left boundary point to zero; it's like any other 1D point process on an arbitrary interval. The solution needs to be to explicitly specify the domain for the distances.

fbachl commented 7 years ago

I added a "domain=" parameter to the lgcp function. We have to adjust the practicals accordingly!