Learn R Programming

shallot (version 0.4.1)

decay: Decay

Description

These functions specify the decay to map distances to attractions.

Usage

decay.reciprocal(temperature, distance)
decay.exponential(temperature, distance)
decay.subtraction(temperature, distance, multiplier = 1.01)
# S3 method for shallot.decay
print(x, ...)

Arguments

temperature

An object of class shallot.temperature.

distance

An object of class dist.

multiplier

An scalar greater than 1.0 to ensure that attractions from decay.subtraction are finite.

x

An object of class shallot.decay.

...

Currently ignored.

Details

There are currently three choices for decay functions: reciprocal, exponential, and subtraction.

The reciprocal decay maps a distance d to an attraction a as follows: a = 1/d^t, where t is the temperature.

The exponential decay maps a distance d to an attraction a as follows: a = exp(-t*d), where t is the temperature.

The subtract decay maps a distance d to an attraction a as follows: a = (m-d)^t, where t is the temperature and m is the maximum distance in distance multiplied by the supplied multiplier.

References

Dahl, D. B., Day, R., and Tsai, J. (2017), Random Partition Distribution Indexed by Pairwise Information, Journal of the American Statistical Association, accepted. <DOI:10.1080/01621459.2016.1165103>

See Also

dist, temperature, attraction

Examples

Run this code
# NOT RUN {
temp <- temperature(1.0)
distance <- dist(scale(USArrests))
decay1 <- decay.reciprocal(temp,distance)
decay2 <- decay.exponential(temp,distance)
decay3 <- decay.subtraction(temp,distance)
# }

Run the code above in your browser using DataLab