discdd.predict {dad} | R Documentation |
Predicting the class of a group of individuals with discriminant analysis of probability distributions.
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 probability distribution associated to the group to assign and the
probability distributions associated to the
classes.
Usage
discdd.predict(xf, class.var, distance = c("l1", "l2", "chisqsym", "hellinger",
"jeffreys", "jensen", "lp"), crit = 1, misclass.ratio = FALSE, p)
Arguments
xf |
object of class
|
class.var |
string (if
|
distance |
The distance or dissimilarity used to compute the distance matrix between the densities. It can be:
|
crit |
1 or 2. In order to select the densities associated to the classes. See Details. |
misclass.ratio |
logical (default |
p |
integer. Optional. When |
Details
If
xf
is an object of class"folderh"
containing the data:The
probability distributions
corresponding to the
groups of individuals are estimated by frequency distributions within each group.
To the class
consisting of
groups is associated the probability distribution
. The
crit
argument selects the estimation method of the's.
crit=1
The probability distributionis estimated using the whole data of this class, that is the rows of
x
corresponding to thegroups of the class
.
The estimation of the
's uses the same method as the estimation of the
's.
crit=2
Theprobability distributions
are estimated using the corresponding data from
xf
. Then they are averaged to obtain an estimation of the density, that is
.
If
xf
is a list of arrays (or list of tables):The
array is the joint frequency distribution of the
group. The frequencies can be absolute or relative.
To the class
consisting of
groups is associated the probability distribution
. The
crit
argument selects the estimation method of the's.
crit=1
, where
is the total of
xf[[t]]
.Notice that when
xf[[t]]
contains relative frequencies, its total is 1. That is equivalent tocrit=2
.crit=2
.
Value
Returns an object of class discdd.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
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)
stones <- rbind(castles.dated$stones, castles.nondated$stones)
periods <- rbind(castles.dated$periods, castles.nondated$periods)
stones$height <- cut(stones$height, breaks = c(19, 27, 40, 71), include.lowest = TRUE)
stones$width <- cut(stones$width, breaks = c(24, 45, 62, 144), include.lowest = TRUE)
stones$edging <- cut(stones$edging, breaks = c(0, 3, 4, 8), include.lowest = TRUE)
stones$boss <- cut(stones$boss, breaks = c(0, 6, 9, 20), include.lowest = TRUE )
castlesfh <- folderh(periods, "castle", stones)
# Default: dist="l1", crit=1
discdd.predict(castlesfh, "period")
# With the calculation of the confusion matrix and misclassification ratio
discdd.predict(castlesfh, "period", misclass.ratio = TRUE)
# Hellinger distance
discdd.predict(castlesfh, "period", distance = "hellinger")
# crit=2
discdd.predict(castlesfh, "period", crit = 2)