Learn R Programming

wccsom (version 1.2.11)

wcc: Agreement between patterns including peak shifts

Description

Weighted cross correlation and autocorrelation, as described in De Gelder et al. (2001), for assessing similarities in spectra-like data containing peak shifts. Euclidean distances are useless in this situation.

Usage

wcc(pattern1, pattern2, trwdth, wghts, acors) wac(pattern1, trwdth, wghts) wacmat(patterns, trwdth, wghts, do.transpose = TRUE)

Arguments

pattern1
Pattern.
pattern2
Another pattern.
patterns
Pattern matrix: rows correspond with patterns.
trwdth
Triangle width, given in the number of data points.
wghts
Optional weights vector, will be calculated from triangle width if necessary. Sometimes it is more efficient to pre-calculate it and give it as an argument.
acors
Autocorrelation, also optional to speed up calculations.
do.transpose
Internally, columns should correspond with patterns, so normally one should leave this value to its default: TRUE. If a matrix is already in the correct format, one can avoid unnecessary double transpose operations.

Value

Function wcc returns the WCC value, a similarity value between 0 and 1. Functions wac and wacmat return weighted autocorrelations for one pattern and a matrix of patterns, respectively.

References

R. de Gelder, R. Wehrens, and J.A. Hageman. A generalized expression for the similarity spectra: application to powder diffraction pattern classification. J. Comput. Chem., 22(3), 273-289, 2001.

See Also

wccsom, wccxyf

Examples

Run this code
data(cepha)
wac(cepha$patterns[1,], 20)
wacmat(t(cepha$patterns), 20)
wcc(cepha$patterns[1,], cepha$patterns[2,], 20)

Run the code above in your browser using DataLab