Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: xclust
See also: aerlb lpdist distance

Quantlet: discrim
Description: computes the discrimination function for an observation x given the samples x1 and x2

Usage: d = discrim(x1, x2, x)
Input:
x1 n1 x p matrix, observations of sample 1
x2 n2 x p matrix, observations of sample 2
x p x 1 vector, the observations to be classified
Output:
d 1 x 2 vector, the distance to the two samples

Note:

Example:
library("xplore")
library("xclust")
randomize(101)
x1 = normal(100, 2)
x2 = normal(100, 2) + 0.8
x  = normal(2) + 0.6
d  = discrim(x1, x2, x)
d

Result:
Contents of d
[1,]   3.2074   0.5154



Author: W. Haerdle, 20010912 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006