Description Usage Arguments Details Value Author(s) References Examples
View source: R/fdiscd.predict.R
Assigns several 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.
1 2 3  fdiscd.predict(xf, class.var, gaussiand = TRUE,
distance = c("jeffreys", "hellinger", "wasserstein", "l2", "l2norm"),
crit = 1, windowh = NULL, misclass.ratio = FALSE)

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 
To the group t is associated the density denoted f_t. To the class k consisting of T_k groups is associated the density denoted g_k. The crit
argument selects the estimation method of the K densities g_k.
The density g_k is estimated using the whole data of this class, that is the rows of x
corresponding to the T_k groups of the class k.
The T_k densities f_t are estimated using the corresponding data from x
. Then they are averaged to obtain an estimation of the density g_k, that is g_k = (1/T_k)∑{f_t}.
Each previous density f_t is weighted by n_t (the number of rows of x corresponding to f_t). Then they are averaged, that is g_k = (1/∑ n_t) ∑ n_t f_t.
The last two methods are available only for the L^2distance. If the divergences between densities are computed using the Hellinger or Wasserstein distance or Jeffreys measure, only the first of these methods is available.
Returns an object of class fdiscd.predict
, that is a list including:
prediction 
data frame with 3 columns:

distances 
matrix with T rows and K columns, of the distances (d_{tk}): d_{tk} is the distance between the group t and the class k, computed with the measure given by argument 
proximities 
matrix of the proximities (in percents). The proximity of a group t to the class k is computed as so: (1/d_{tk})/∑_{l=1}^{l=K}(1/d_{tl}). 
confusion.mat 
the confusion matrix (if 
misclassed 
the misclassification ratio (if 
Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine DemotesMainard
Boumaza, R. (2004). Discriminant analysis with independently repeated multivariate measurements: an L^2 approach. Computational Statistics & Data Analysis, 47, 823843.
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, 538.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  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^2distance
#  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)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.