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 |
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
Contents of d [1,] 3.2074 0.5154