Documentation for SLiM function sampleImprovedNearbyPoint, which is a method of the SLiM class SpatialMap. Note that the R function is a stub, it does not do anything in R (except bring up this documentation). It will only do anything useful when used inside a slim_block function further nested in a slim_script function call, where it will be translated into valid SLiM code as part of a full SLiM script.

sampleImprovedNearbyPoint(point, maxDistance, functionType, ...)

Arguments

point

An object of type float. See details for description.

maxDistance

An object of type float. Must be of length 1 (a singleton). See details for description.

functionType

An object of type string. Must be of length 1 (a singleton). See details for description.

...

An object of type NA. NA See details for description.

Value

An object of type float.

Details

Documentation for this function can be found in the official SLiM manual: page 716.

This variant of sampleNearbyPoint() samples a Metropolis-Hastings move on the spatial map. See sampleNearbyPoint() for discussion of the basic idea. This method proposes a nearby point drawn from the given kernel. If the drawn point has a larger map value than the original point, the new point is returned. If the drawn point has a smaller map value than the original point, it is returned with a probability equal to the ratio between its map value and the original map value, otherwise the original point is returned. The distribution of individuals that move (or not) to new locations governed by this method will converge upon the map itself, in a similar manner to how MCMC converges upon the posterior distribution (assuming no other forces, such as birth or death, influence the distribution of individuals). Movement governed by this method is "improved" in the sense that individuals will tend to remain where they are unless the new sampled point is an improvement for them - a higher map value. Note that unlike sampleNearbyPoint(), this method requires that all map values are non-negative.

Author

Benjamin C Haller (bhaller@benhaller.com) and Philipp W Messer (messer@cornell.edu)