computeSimilarityVar {RMixtCompUtilities} | R Documentation |
Similarity
Description
Compute the similarity between variables (or classes)
Usage
computeSimilarityVar(outMixtComp)
computeSimilarityClass(outMixtComp)
Arguments
outMixtComp |
object of class MixtCompLearn or MixtComp obtained using |
Details
The similarities between variables j and h is defined by Delta(j,h)
Delta(j,h)^2 = 1 - \sqrt{(1/n) * \sum_{i=1}^n \sum_{k=1}^K (P(Z_i=k|x_{ij}) - P(Z_i=k|x_{ih}))^2}
The similarities between classes k and g is defined by 1 - Sigma(k,g)
Sigma(k,g)^2 = (1/n) * \sum_{i=1}^n (P(Z_i=k|x_i) - P(Z_i=g|x_i))^2
Value
a similarity matrix
Author(s)
Quentin Grimonprez
See Also
Examples
if (requireNamespace("RMixtCompIO", quietly = TRUE)) {
dataLearn <- list(
var1 = as.character(c(rnorm(50, -2, 0.8), rnorm(50, 2, 0.8))),
var2 = as.character(c(rnorm(50, 2), rpois(50, 8)))
)
model <- list(
var1 = list(type = "Gaussian", paramStr = ""),
var2 = list(type = "Poisson", paramStr = "")
)
algo <- list(
nClass = 2,
nInd = 100,
nbBurnInIter = 100,
nbIter = 100,
nbGibbsBurnInIter = 100,
nbGibbsIter = 100,
nInitPerClass = 3,
nSemTry = 20,
confidenceLevel = 0.95,
ratioStableCriterion = 0.95,
nStableCriterion = 10,
mode = "learn"
)
resLearn <-RMixtCompIO::rmcMultiRun(algo, dataLearn, model, nRun = 3)
simVar <- computeSimilarityVar(resLearn)
simClass <- computeSimilarityClass(resLearn)
}
[Package RMixtCompUtilities version 4.1.6 Index]