Last chance! 50% off unlimited learning
Sale ends in
These functions specify the decay to map distances to attractions.
decay.reciprocal(temperature, distance)decay.exponential(temperature, distance)
decay.subtraction(temperature, distance, multiplier = 1.01)
# S3 method for shallot.decay
print(x, ...)
An object of class shallot.temperature
.
An object of class dist
.
An scalar greater than 1.0
to ensure that
attractions from decay.subtraction
are finite.
An object of class shallot.decay
.
Currently ignored.
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.
# 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