MATERIAL 5-Discriminant PDF
MATERIAL 5-Discriminant PDF
BIBLIOGRAPHY (I)
VOTING INTENTION
𝑛1 1𝑖𝐲 𝑛2 2𝑖 𝐲
Where 𝐲̅1 = ∑𝑖=1 and 𝐲̅2 = ∑𝑖=1
𝑛 1 𝑛 2
We then looked for a new variable and a linear combination of the observed
variables, 𝑧 = 𝐚′ 𝒚, which shows the greatest differences between the
means of the two groups in such a way as to allow us to classify one of them
with the maximum possible resolution.
The means of the values of the new variable for each group are:
z̅1 = 𝐚′ 𝐲̅1 z̅2 = 𝐚′ 𝐲̅2
The difference between means is, then:
z̅1 − z̅2 = 𝐚′ 𝐲̅1 − 𝐚′ 𝐲̅2 = 𝐚′ (𝐲̅1 − 𝐲̅2 )
It is therefore a question of maximizing the expression:
| 𝐚′ (𝐲̅1 − 𝐲̅2 )|
Or equivalently, maximize the standardized distance:
(z̅1 − z̅2 )2 (z̅1 − z̅2 )2
=
𝑠𝑧2 𝒂′ 𝐒𝐩𝐥 𝒂
( 𝐚′ 𝐲̅1 − 𝐚′ 𝐲̅2 )2 [ 𝐚′ (𝐲̅1 − 𝐲̅2 )]𝟐
= =
𝒂′ 𝐒𝐩𝐥 𝒂 𝒂′ 𝐒𝐩𝐥 𝒂
Subject to the restriction: 𝒂′ 𝐒𝐩𝐥 𝒂 =1, because you want the variability
within the groups in the new variable to be one. This maximization problem
is solved using the Lagrange Multipliers Method, and the solution is given
by:
(z̅1 − z̅2 )2
2
= (𝐲̅1 − 𝐲̅2 )′ 𝐒𝐩𝐥 −𝟏 (𝐲̅1 − 𝐲̅2 )
𝑠𝑧
‖𝐲 − 𝛍𝑖 ‖ < ‖𝐲 − 𝛍𝑗 ‖ ∀ 𝑗 ≠ 𝑖
Case k=2:
‖𝐲 − 𝛍1 ‖ < ‖𝐲 − 𝛍2 ‖
⟺ ‖𝐲 − 𝛍1 ‖2 < ‖𝐲 − 𝛍2 ‖2
⟺ (𝐲 − 𝛍1 )′ (𝐲 − 𝛍1 ) < (𝐲 − 𝛍2 )′ (𝐲 − 𝛍2 )
⟺ (𝐲 ′ − 𝛍1′ ) (𝐲 − 𝛍1 ) < (𝐲 ′ − 𝛍′𝟐 )(𝐲 − 𝛍2 )
⟺ 𝐲 ′ 𝐲 − 2𝛍1′ 𝐲 + 𝛍1′ 𝛍1 < 𝐲 ′ 𝐲 − 2𝛍′2 𝐲 + 𝛍′2 𝛍2 (∗)
⟺ 2 (𝛍2 − 𝛍1 )′ 𝐲 < 𝛍′2 𝛍2 − 𝛍1′ 𝛍1
1
⟺ (𝛍2 − 𝛍1 )′ 𝐲 < (𝛍 − 𝛍1 )′ (𝛍2 + 𝛍1 )
2 2
1
⟺ (𝛍2 − 𝛍1 )′ [𝐲 − (𝛍 + 𝛍2 )] < 0
2 1
1
⟺ (𝛍1 − 𝛍2 )′ [𝐲 − (𝛍 + 𝛍2 )] > 0
2 1
1
(𝛍1 − 𝛍2 )′ [𝐲 − (𝛍 + 𝛍2 )] = 0
2 1
Note 2: This boundary passes through the midpoint of the group means,
1
(𝛍1 + 𝛍2 ).
2
′ 1
(𝛍𝑖 − 𝛍𝑗 ) [𝐲 − (𝛍 + 𝛍𝑗 )] > 0, ∀ j ≠ i
2 𝑖
Then, the region Ri will be an intersection of half-spaces, and hence a
convex polytope.
Example: We will illustrate the basic idea using an example with k = 2 and
p = 2. Suppose that the group means are 𝛍1 = (2,1)′ and 𝛍2 = (−1,2)′ .
⟹ 3𝑦1 > 𝑦2
The closest group mean classifier is a simple and natural way to discriminate
between groups. However, it ignores the covariance structure in the data,
including the fact that some variables are more variable than others. The
more variable (and more highly correlated) variables are likely to dominate
the Euclidean distance, and hence will have a disproportionate effect on the
classification rule. We could correct for this by first applying a
standardization transformation to the data and the group means, and then
carry out closest group mean classification, or we can directly adapt our rule
to take covariance structure into account.
When there are two populations, we can use a classification procedure due
to Fisher (1936). The principal assumption for Fisher’s procedure is that the
two populations have the same covariance matrix (𝚺𝟏 = 𝚺2 ). Normality is
not required. We obtain a sample from each of the two population and
compute 𝐲̅1, 𝐲̅2 and 𝐒𝑝𝑙 . A procedure for classification can be based on the
discriminant function,
𝑧 = (𝐲̅1 − 𝐲̅2 )′ 𝐒𝐩𝐥 −𝟏 𝐲 (*)
1 1
The midpoint between 𝑧̅1 and 𝑧̅2 is (𝑧̅1 + 𝑧̅2 ). So, if 𝑧 > (𝑧̅1 + 𝑧̅2 )
2 2
implies that z is closer to 𝑧̅1 .
But, z̅1 = 𝐚′ 𝐲̅1 y z̅2 = 𝐚′ 𝐲̅2
⟹ z̅1 + z̅2 = (𝐲̅1 − 𝐲̅2 )′ 𝐒𝐩𝐥 −𝟏 𝐲̅1 + (𝐲̅1 − 𝐲̅2 )′ 𝐒𝐩𝐥 −𝟏 𝐲̅2
1
(𝐲̅1 − 𝐲̅2 )′ 𝐒𝐩𝐥 −𝟏 𝐲 > 2 (𝐲̅1 − 𝐲̅2 )′ 𝐒𝐩𝐥 −𝟏 (𝐲̅1 + 𝐲̅2 )
And assign y to G2 if
1
𝑧 = 𝐚′ 𝐲 = (𝐲̅1 − 𝐲̅2 )′ 𝐒𝐩𝐥 −𝟏 𝐲 < 2 (𝐲̅1 − 𝐲̅2 )′ 𝐒𝐩𝐥 −𝟏 (𝐲̅1 + 𝐲̅2 ) (***)
⟹ 𝑧
̅
1 > 𝑧̅2
DISCRIMINATION FUNCTIONS
There are many different approaches that can be taken to classification,
each leading to a different rule. Some of the rules can be described in within
a common framework by introducing the concept of a discriminant
function. For each class i = 1; 2; . . . ; k, we define a corresponding function:
𝑄𝑖 (⋅): ℝ𝑝 ⟶ ℝ
Note the use of a > inequality rather than a < inequality, so instead of a
measure of distance or dissimilarity, the discriminant functions represent
the likelihood or propensity of an observation to belong to a particular
group. This turns out to be more natural and convenient, especially in the
context of model-based methods for classification.
Given a particular set of discriminant functions, we can study the properties
of the resulting classifier, such as misclassification rates, either empirically,
or theoretically, to try and establish whether the method is good or bad.
𝑓𝑖 (⋅) = ℝ𝑝 ⟶ ℝ; 𝑖 = 1, 2, . . . , 𝑘
𝑄𝑖 (𝐲) = 𝑓𝑖 (𝐲); 𝑖 = 1, 2, . . . , 𝑘
𝑝 1 1
𝑄𝑖 (𝐲) = 𝑓𝑖 (𝐲) = (2𝜋)−2 |𝚺|−2 𝑒𝑥𝑝 {− (𝐲 − 𝛍𝑖 )′ 𝚺−1 (𝐲 − 𝛍𝑖 )}
2
After simplifying we can see that, in the case of equal variance matrices, the
maximum likelihood discriminant rule corresponds exactly to Fisher’s linear
discriminant.
QUADRATIC DISCRIMINANT ANALYSIS
It is natural to next consider how the maximum likelihood discriminant rule
changes when we allow the variance matrices associated with each group
to be unequal. That is, we assume that observations from group i are iid
N(𝛍i , 𝚺𝑖 ). In this case we have:
𝑝 1 1
𝑄𝑖 (𝐲) = 𝑓𝑖 (𝐲) = (2𝜋)−2 |𝚺𝑖 |−2 𝑒𝑥𝑝 {− (𝐲 − 𝛍𝑖 )′ 𝚺𝑖 −1 (𝐲 − 𝛍𝑖 )}
2
We can simplify this a little by noting that:
𝑄𝑖 (𝐲) > 𝑄𝑗 (𝐲)
𝑝 1 1
⟺ (2𝜋)−2 |𝚺𝑖 |−2 𝑒𝑥𝑝 {− (𝐲 − 𝛍𝑖 )′ 𝚺𝑖 −1 (𝐲 − 𝛍𝑖 )} >
2
𝑝 1 1
−2 − ′
(2𝜋) |𝚺𝑗 | 2 𝑒𝑥𝑝 {− (𝐲 − 𝛍𝑗 ) 𝚺𝑗 −1 (𝐲 − 𝛍𝑗 )}
2
1 1
⟺ |𝚺𝑖 |−2 𝑒𝑥𝑝 {− (𝐲 − 𝛍𝑖 )′ 𝚺𝑖 −1 (𝐲 − 𝛍𝑖 )} >
2
1 1
−2 ′
|𝚺𝑗 | 𝑒𝑥𝑝 {− (𝐲 − 𝛍𝑗 ) 𝚺𝑗 −1 (𝐲 − 𝛍𝑗 )}
2
⟺ −𝐿𝑜𝑔|𝚺𝑖 | − (𝐲 − 𝛍𝑖 )′ 𝚺𝑖 −1 (𝐲 − 𝛍𝑖 ) >
′
−𝐿𝑜𝑔|𝚺𝑗 | − (𝐲 − 𝛍𝑗 ) 𝚺𝑗 −1 (𝐲 − 𝛍𝑗 )
Example: In the k = 2 case, we assign to group 1 if Q (x) > Q (x), that is:
1 2
−𝐿𝑜𝑔|𝚺1 | − (𝐲 − 𝛍1 )′ 𝚺1 −1 (𝐲 − 𝛍1 )
> −𝐿𝑜𝑔|𝚺2 | − (𝐲 − 𝛍2 )′ 𝚺2 −1 (𝐲 − 𝛍2 )
⟺ 𝐿𝑜𝑔 |𝚺1 | − (𝐲 − 𝛍1 )′ 𝚺1 −1 (𝐲 − 𝛍1 )
< 𝐿𝑜𝑔|𝚺2 | − (𝐲 − 𝛍2 )′ 𝚺2 −1 (𝐲 − 𝛍2 )
Then:
𝐲 ′ (𝚺1 −1 − 𝚺2 −1 )𝐲 + 2 ( 𝛍′2 𝚺2 −1 − 𝛍1′ 𝚺1 −1 )𝐲 + 𝛍1′ 𝚺1 −1 𝛍1 − 𝛍′2 𝚺2 −1 𝛍2
|𝚺1 |
+ 𝑙𝑜𝑔 <0
|𝚺2 |
Here we can see explicitly that the quadratic term does not cancel out, and
that the boundary between the two classes corresponds to the contour of
a quadratic form.
MISCLASSIFICATION
Obviously, whatever discriminant functions we use, we will not characterize
the group of interest perfectly, and so some future observations will be
classified incorrectly. An obvious way to characterize a classification
scheme is by some measure of the degree of misclassification associated
with the scheme.
The left plot shows some data from three classes, with linear decision
boundaries found by linear discriminant analysis. The right plot shows
quadratic decision boundaries. (Hastie; T, R. Tibshirani, J. Friedman)
1
𝑊𝑖𝑗 = (𝐲̅𝑖 − 𝐲̅𝑗 )′ 𝑺𝒑𝒍 −𝟏 𝐲 − (𝐲̅𝑖 − 𝐲̅𝑗 )′ 𝑺𝒑𝒍 −𝟏 (𝐲̅𝑖 + 𝐲̅𝑗 )
2
For example, with three groups, we have three possible rules:
Classify y as:
Population 1 if W12 >0 and W13 >0
Example: The objects in the data matrix are 50 irises of species Iris setosa,
Iris versicolour and Iris Virginia. The variables are are:
Y1 = sepal length; Y2 = sepal width
Y3 = petal lenght; Y4 = petal width.
Salida de InfoStat:
Funciones discriminantes - datos estandarizados con las varianzas
comunes
1 2
SepalLen -0,43 0,01
SepalWid -0,52 0,74
PetalLen 0,95 -0,40
PetalWid 0,58 0,58
Versicolor
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
0,07
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil-1,38
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión-2,84
Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
Versión Estudiantil -10,06 Estudiantil
Versión -5,18Estudiantil
Versión -0,31
Versión Estudiantil 4,56
Versión Estudiantil 9,44
Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Eje Canónico
Versión Estudiantil 1 Estudiantil
Versión Versión Estudiantil Versión Estudiantil
Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil Versión Estudiantil
PROBLEMS
1.-Rencher: 8.8; 8.9; 8.10; 9.6(a,b); 9.7(a,b).
2.- a)Let M1 and M2 be two populations from 𝑁𝑝 (𝛍𝟏 , 𝚺) and 𝑁𝑝 (𝛍𝟐 , 𝚺)
respectively. Fisher's linear discriminator is defined as:
′
1
𝐿(𝐲) = (𝐲 − (𝛍1 + 𝛍2 )) 𝚺 −1 (𝛍1 − 𝛍2 )
2
Express 𝐿(𝐲) as the difference between the squares of the Mahalanobis
distances from y to 𝛍1 and from y to 𝛍2 .
b) The Maximum likelihood discriminant function is defined as:
𝑉 (𝐲) = ln 𝑓1 (𝐲) − ln 𝑓2 (𝐲)
Where 𝑓𝑖 (𝐲), i=1, 2, is the density function.
Prove that the Maximum likelihood discriminant function is the same than
the Fisher’s linear discriminator.
Group X1 X2
1 2 2
1 1 2
1 3 2
1 2 1
1 2 3
2 4 2
2 4 3
2 5 1
2 5 2
2 5 3
3 2 6
3 3 6
3 4 6
3 5 6
3 5 7