kma.similarity {briKmeans} | R Documentation |
Similarity/dissimilarity index between two functions
Description
kma.similarity computes a similarity/dissimilarity measure between two functions f
and g
. Users can choose among different types of measures.
Usage
kma.similarity(x.f = NULL, y0.f = NULL, y1.f = NULL,
x.g = NULL, y0.g = NULL, y1.g = NULL, similarity.method, unif.grid = TRUE)
Arguments
x.f |
vector length.f: abscissa grid where function |
y0.f |
vector length.f or matrix length.f X d: evaluations of function |
y1.f |
vector length.f or matrix length.f X d: evaluations of |
x.g |
vector length.g: abscissa grid where function |
y0.g |
vector length.g or matrix length.g X d: evaluations of function |
y1.g |
vector length.g or matrix length.g X d: evaluations of |
similarity.method |
character: similarity/dissimilarity between |
unif.grid |
boolean: if equal to |
Details
We report the list of the currently available similarities/dissimilarities. Note that all norms and inner products are computed over D
, that is the intersection of the domains of f
and g
. \overline{f}
and \overline{g}
denote the mean value, respectively, of functions f
and g
.
1. 'd0.pearson'
: this similarity measure is the cosine of the angle between the two functions f
and g
.
\frac{<f,g>_{L^2}}{\|{f}\|_{L^2} \|{g}\|_{L^2}}
2. 'd1.pearson'
: this similarity measure is the cosine of the angle between the two function derivatives f'
and g'
.
\frac{<f',g'>_{L^2}}{\|{f'}\|_{L^2} \|{g'}\|_{L^2}}
3. 'd0.L2'
: this dissimilarity measure is the L2 distance of the two functions f
and g
normalized by the length of the common domain D
.
\frac{\|{f-g}\|_{L^2}}{|D|}
4. 'd1.L2'
: this dissimilarity measure is the L2 distance of the two function first derivatives f'
and g'
normalized by the length of the common domain D
.
\frac{\|{f'-g'}\|_{L^2}}{|D|}
5. 'd0.L2.centered'
: this dissimilarity measure is the L2 distance of f-\overline{f}
and g-\overline{g}
normalized by the length of the common domain D
.
\frac{\|{(f-\overline{f})-(g-\overline{g})}\|_{L^2}}{|D|}
6. 'd1.L2.centered'
: this dissimilarity measure is the L2 distance of f'-\overline{f'}
and g'-\overline{g'}
normalized by the length of the common domain D
.
\frac{\|{(f'-\overline{f'})-(g'-\overline{g'})}\|_{L^2}}{|D|}
For multidimensional functions, if similarity.method='d0.pearson'
or 'd1.pearson'
the similarity/dissimilarity measure is computed via the average of the indexes in all directions.
The coherence properties specified in Sangalli et al. (2010) implies that if similarity.method
is set to 'd0.L2'
, 'd1.L2'
, 'd0.L2.centered'
or 'd1.L2.centered'
, value of warping.method
must be 'shift'
or 'NOalignment'
. If similarity.method
is set to 'd0.pearson'
or 'd1.pearson'
all values for warping.method
are allowed.
Value
scalar: similarity/dissimilarity measure between the two functions f
and g
computed via the similarity/dissimilarity measure specified.
Author(s)
Alice Parodi, Mirco Patriarca, Laura Sangalli, Piercesare Secchi, Simone Vantini, Valeria Vitelli.
References
Sangalli, L.M., Secchi, P., Vantini, S., Vitelli, V., 2010. "K-mean alignment for curve clustering". Computational Statistics and Data Analysis, 54, 1219-1233.
Sangalli, L.M., Secchi, P., Vantini, S., 2014. "Analysis of AneuRisk65 data: K-mean Alignment". Electronic Journal of Statistics, Special Section on "Statistics of Time Warpings and Phase Variations", Vol. 8, No. 2, 1891-1904.