Misclassification ratio in functional discriminant analysis of probability densities.
Misclassification ratio in functional discriminant analysis of probability densities.
Computes the one-leave-out misclassification ratio of the rule assigning T groups of individuals, one group after another, to the class of groups (among K classes of groups) which achieves the minimum of the distances or divergences between the density function associated to the group to assign and the K density functions associated to the K classes.
The first one has at least two columns. One column contains the names of the T groups (all the names must be different). An other column is a factor with K levels partitionning the T groups into K classes.
The second one has (p+1) columns. The first p columns are numeric (otherwise, there is an error). The last column is a factor with T levels defining T groups. Each group, say t, consists of nt individuals.
class.var: string. The name of the class variable.
distance: The distance or dissimilarity used to compute the distance matrix between the densities. It can be:
"jeffreys" (default) the Jeffreys measure (symmetrised Kullback-Leibler divergence),
"hellinger" the Hellinger (Matusita) distance,
"wasserstein" the Wasserstein distance,
"l2" the L2 distance,
"l2norm" (only available when crit = 1) the densities are normed and the L2 distance between these normed densities is used;
If gaussiand = FALSE, the densities are estimated by the Gaussian kernel method and the distance is "l2" or "l2norm".
crit: 1, 2 or 3. In order to select the densities associated to the classes. See Details.
If distance is "hellinger", "jeffreys" or "wasserstein", crit is necessarily 1 (see Details).
gaussiand: logical. If TRUE (default), the probability densities are supposed Gaussian. If FALSE, densities are estimated using the Gaussian kernel method.
If distance is "hellinger", "jeffreys" or "wasserstein", gaussiand is necessarily TRUE.
windowh: strictly positive numeric value. If windowh = NULL (default), the bandwidths are computed using the bandwidth.parameter function.
Omitted when distance is "hellinger", "jeffreys" or "wasserstein" (see Details).
Details
The T probability densities ft corresponding to the T groups of individuals are either parametrically estimated (gaussiand = TRUE) or estimated using the Gaussian kernel method (gaussiand = FALSE). In the latter case, the windowh argument provides the list of the bandwidths to be used. Notice that in the multivariate case (p>1), the bandwidths are positive-definite matrices.
The argument windowh is a numerical value, the matrix bandwidth is of the form hS, where S is either the square root of the covariance matrix (p>1) or the standard deviation of the estimated density.
If windowh = NULL (default), h in the above formula is computed using the bandwidth.parameter function.
To the class k consisting of Tk groups is associated the density denoted gk. The crit argument selects the estimation method of the K densities gk.
The density gk is estimated using the whole data of this class, that is the rows of x corresponding to the Tk groups of the class k.
The estimation of the densities gk uses the same method as the estimation of the ft.
The Tk densities ft are estimated using the corresponding data from x. Then they are averaged to obtain an estimation of the density gk, that is gk=(1/Tk)∑(ft).
Each previous density ft is weighted by nt (the number of rows of x corresponding to ft). Then they are averaged, that is gk=(1/∑nt)∑ntft.
The last two methods are only available for the L2-distance. If the divergences between densities are computed using the Hellinger or Wasserstein distance or Jeffreys measure, only the first of these methods is available.
The distance or dissimilarity between the estimated densities is either the L2 distance, the Hellinger distance, Jeffreys measure (symmetrised Kullback-Leibler divergence) or the Wasserstein distance.
If it is the L^2 distance (distance="l2" or distance="l2norm"), the densities can be either parametrically estimated or estimated using the Gaussian kernel.
If it is the Hellinger distance (distance="hellinger"), Jeffreys measure (distance="jeffreys") or the Wasserstein distance (distance="wasserstein"), the densities are considered Gaussian and necessarily parametrically estimated.
Returns
Returns an object of class fdiscd.misclass, that is a list including: - classification: data frame with 4 columns:
* factor giving the group name. The column name is the same as that of the column ($p+1$) of `x`,
* the prior class of the group if it is available, or NA if not,
* `alloc`: the class allocation computed by the discriminant analysis method,
* `misclassed`: boolean. `TRUE` if the group is misclassed, `FALSE` if it is well-classed, `NA` if the prior class of the group is unknown.
confusion.mat: confusion matrix,
misalloc.per.class: the misclassification ratio per class,
misclassed: the misclassification ratio,
distances: matrix with T rows and K columns, of the distances (dtk): dtk is the distance between the group t and the class k, computed with the measure given by argument distance (L2-distance, Hellinger distance or Jeffreys measure),
proximities: matrix of the proximity indices (in percents) between the groups and the classes. The proximity of the group t to the class k is computed as so: (1/dtk)/∑l=1l=K(1/dtl).
References
Boumaza, R. (2004). Discriminant analysis with independently repeated multivariate measurements: an L2 approach. Computational Statistics & Data Analysis, 47, 823-843.
Rudrauf, J.M., Boumaza, R. (2001). Contribution à l'étude de l'architecture médiévale: les caractéristiques des pierres à bossage des châteaux forts alsaciens. Centre de Recherches Archéologiques Médiévales de Saverne, 5, 5-38.
Author(s)
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard