
corDiss(Xr, X2 = NULL, ws = NULL,
center = TRUE, scaled = TRUE)
matrix
(or data.frame
) containing the (reference) data.matrix
(or data.frame
) containing data of a second set of observations (samples).ws = NULL
, then the window size will be equal to the number of variables (columns), i.e. instead moving correlation, the normal correlation will beXr
(and X2
if specified) must be centered. If X2
is specified the data is scaled on the basis of $Xr \cup X2$.Xr
(and X2
if specified) must be scaled. If X2
is specified the data is scaled on the basis of $Xr \cup X2$.matrix
of the computed dissimilarities.ws = NULL
.
On the other hand (when ws != NULL
) the moving correlation dissimilarity $mcd$ between two obsvervations $x_i$ and $x_j$ is computed as follows:
require(prospectr)
data(NIRsoil)
Xu <- NIRsoil$spc[!as.logical(NIRsoil$train),]
Xr <- NIRsoil$spc[as.logical(NIRsoil$train),]
corDiss(Xr = Xr)
corDiss(Xr = Xr, X2 = Xu)
corDiss(Xr = Xr, ws = 41)
corDiss(Xr = Xr, X2 = Xu, ws = 41)
Run the code above in your browser using DataLab