Closed petrelharp closed 1 year ago
I think this is already supported? Just pass "none" as the boundary condition for pointDeviated()
and it should allow points to be wherever? Or is there a problem with that?
So if I wanted to use absorbing boundary condition, should I use "none" for pointDeviated
and then use pointInBounds
on the returned vector? I guess that works, but it could be a duplicated work if pointDeviated
checks for boundaries already?
In the general case of drawing from different kernels, yes. In the specific case of drawing deviations from a Gaussian kernel, I'd probably just do it the old way – use rnorm() to draw the deviations, and + to add then in, and pointInBounds() to decide the fate of the offspring. Either way really.
Resolved? Seems like? Closing.
Hah, excellent. Thanks!
As discussed in #395, I'll bet people will want to be able to return out-of-bounds points from
pointDeviated
, to model e.g. seeds that get thrown outside the area. (So, use case is to generate migrants and then discard those who are out of bounds.)On the one hand, it'd be straightforward in the code to allow for this (just don't do the rejection sampling); but on the other hand, this is already easy to do by just drawing the displacements yourself. So maybe we should either (a) add this option (named
inBounds
, perhaps), or (b) make a note in the documentation saying that if you want poitns that can be out of bounds, just add the displacements yourself.