fdiscd.predict {dad} | R Documentation |
Predicting the class of a group of individuals with discriminant analysis of probability densities.
Description
Assigns several groups of individuals, one group after another, to the class of groups (among classes of groups) which achieves the minimum of the distances or divergences between the density function associated to the group to assign and the
density functions associated to the
classes.
Usage
fdiscd.predict(xf, class.var, gaussiand = TRUE,
distance = c("jeffreys", "hellinger", "wasserstein", "l2", "l2norm"),
crit = 1, windowh = NULL, misclass.ratio = FALSE)
Arguments
xf |
object of class
Notice that for the versions earlier than 2.0, fdiscd.predict applied to two data frames. |
class.var |
string. The name of the class variable. |
distance |
The distance or divergence used to compute the distance matrix between the densities. It can be:
If |
crit |
1, 2 or 3. In order to select the densities associated to the classes. See Details. If |
gaussiand |
logical. If If |
windowh |
strictly positive number. If Omitted when |
misclass.ratio |
logical (default |
Details
To the group is associated the density denoted
. To the class
consisting of
groups is associated the density denoted
. The
crit
argument selects the estimation method of the densities
.
-
The density
is estimated using the whole data of this class, that is the rows of
x
corresponding to thegroups of the class
.
-
The
densities
are estimated using the corresponding data from
x
. Then they are averaged to obtain an estimation of the density, that is
.
-
Each previous density
is weighted by
(the number of rows of
corresponding to
). Then they are averaged, that is
.
The last two methods are available only for the -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.
Value
Returns an object of class fdiscd.predict
, that is a list including:
prediction |
data frame with 3 columns:
|
distances |
matrix with |
proximities |
matrix of the proximities (in percents). The proximity of a group |
confusion.mat |
the confusion matrix (if |
misclassed |
the misclassification ratio (if |
Author(s)
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard
References
Boumaza, R. (2004). Discriminant analysis with independently repeated multivariate measurements: an 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.
Examples
data(castles.dated)
data(castles.nondated)
castles.stones <- rbind(castles.dated$stones, castles.nondated$stones)
castles.periods <- rbind(castles.dated$periods, castles.nondated$periods)
castlesfh <- folderh(castles.periods, "castle", castles.stones)
# With the L^2-distance
# - crit=1
resultl2.1 <- fdiscd.predict(castlesfh, "period", distance="l2", crit=1)
print(resultl2.1)
# - crit=2
## Not run:
resultl2.2 <- fdiscd.predict(castlesfh, "period", distance="l2", crit=2)
print(resultl2.2)
## End(Not run)
# - crit=3
resultl2.3 <- fdiscd.predict(castlesfh, "period", distance="l2", crit=3)
print(resultl2.3)
# With the Hellinger distance
resulthelling <- fdiscd.predict(castlesfh, "period", distance="hellinger")
print(resulthelling)
# With jeffreys measure
resultjeff <- fdiscd.predict(castlesfh, "period", distance="jeffreys")
print(resultjeff)