distance | R Documentation |
This function calculates the θ-distance between any two nonempty compact real intervals.
## S4 method for signature 'IntervalData,IntervalData' distance(e1, e2, theta = 1)
e1 |
A single interval stored as an |
e2 |
A single interval stored as an |
theta |
A single positive real number stored as a unique |
The θ-distance between any two given nonempty compact real intervals, A and B, was defined by Gil et al. (2002) as the non-negative real number calculated as follows,
d_{θ}(A,B) = √{(\mathrm{mid}~A - \mathrm{mid}~B)^2 + θ\cdot(\mathrm{spr}~A -\mathrm{spr}~B)^2},
where θ is a positive real number.
This function returns the calculated θ-distance between the
two given intervals, which is defined as a single real number. Therefore,
the output of this function is a single numeric
value.
José García-García garciagarjose@uniovi.es
Gil, M.Á.; Lubiano, M.A.; Montenegro, M.; López, M.T. (2002). Least squares fitting of an affine function and strength of association for interval-valued data. Metrika, 56:97-111. doi: 10.1007/s001840100160.
## Some distance() examples i1 <- IntervalData(0, 1) i2 <- IntervalData(3, 7) distance(i1, i2) ## rho2 distance distance(i1, i2, 1/3) ## Bertoluzza's distance with Lebesgue measure
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.