Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MATH 3333 3.0 - Winter 2022

Assignment 3


Question 1:   Given the following data, please apply the Fisher linear discriminant method. There are two classes, C1  and C2 . The class C1  has five observations:

2 3

3 7

4 8

5 12

6 10



The class C2  has six observations:

2 1

3 2

4 2

5 3

6 4

7 6


a) Comute the mean of the first class µ1 , and the mean of the second class µ2 .

b) Compute the within class variation Sw  = S1 + S2 , where S1  and S2  are the variations within C1  and C2 , respectively.

d) Find the optimum projection v which can lead to the maximum seperation of the pro- jected observations.

e)Find the cutoff point vTµ1 + vTµ2 .

g) Given a new observation (5, 3), which class does it belong to?

 

Question 2:   In the forensic glass example, we classify the type of the glass shard into six categories based on three predictors. The categories are: WinF, WinNF, Veh, Con Tabl and Head.  The three predictors are the mineral concentrations of Na, Mg, and Al.  Attached is the R output of the multinomial logistic regression.  The R function vglm considers the last group as the baseline category.  The estimates of the five intercepts and the estimates of the 15 slopes are provided in the output.  The model contains 20 parameters, which are estimated on 214 cases.

a) Let pij  denote the probability that the ith observation belongs to class j. Formulate the logistic model for the five log odds: log  , log  , log  , log  , log  .

 

b) The ith piece of glass shard is obtained and the Na, Mg, Al concentrations are: 0.20, 0.06, and 0.11, respectively. Calculate the probabilities pi1, pi2,pi3, pi4, pi5 , and pi6 . Based on the predicted class probability, which type of glass does this piece of glass belong to?


Question 3:

a.   In this question, we consider the discrimant analysis method for multivariate normal data.  Given C1, C2, ..., CK  classes, we assign the prior probabilities to each class P(Cj), j = 1,...,K. Given that X belongs to class Cj, the conditional distribution of X is a multivariate normal with the mean µj , and the covariance matrix Σj . Then

based on the Bayes formula,

p(Cj)P(X|Cj)      

p(Cj|X) =

Then we can use P(Cj|X) as the discriminant function.  We assign X to class j if P(Cj|X) > P(Cj′ |X), for any other classes.  As the denominator is a constant which does not depend on j, we can use P(Cj)P(X|Cj) as the discriminant function.  Or equivalently we can use log P(X|Cj)+log P(Cj). The discriminant function is denoted

by gj (X).

gj(X) =logP(X|Cj) + log P(Cj)

= − 2 (X − µj)TΣ1 (X − µj) − 2 log |Σj | + log p(Cj)

Consider the case that Σj  = σ2I. In this case, all the predictors are independent with different means and equal variances σ2 . Please simplify gj(X) and show that it is a linear function of X.

 

❼ b) In this example, we have three classes, each is a 2-dim Gaussian distribution, with µ1  = (2, − 1)T , µ2  = (4, 3)T , µ3  = (2, 3)T  and Σ1  = Σ2  = Σ3  = 2I2 , where I2  is an identity matrix of dimension 2 × 2. We assume the priors p(C1) = p(C2) = 1/4, and p(C3) = 1/2. Let X = (0.5, 0.4)T . Calculate g1 (X),g2 (X) and g3 (X). Classify the ob- servation X to one of the classes.


Question 4:     Analyze the student math performance test.   Apply the linear discrimi- nant analysis and quadratic discriminant analysis on the dataset.  The reponse variable is ”schoolsup” and the three predictors are ”G1”, ”G2” and ”G3”. Please randomly select 300 observations as the training set and use your two models to predict the default status of the remaining students.  Repeat this cross-validation five times and calculate the average misclassification errors of the two models. Which method performs better for this data set, the linear discriminant analysis or the quadratic discriminant analysis?

 

Question 5:

Suppose we have 2-classes observations with p-dimensional predictors. We have samples x1, ..., xn , with n1  samples from Class 1 and n2  samples from Class 2.  Let v be a unit vector. The projection of sample xi  onto a line in direction v is given by the inner product of yi  = vTxi . Let µ1  and µ2  be the means of class 1 and class 2.  Let 1  and 2  be the mean of the projections of class 1 and class 2. Denote the variance of the projected samples of class 1 is  = Pxi∈C1(yi  − 1)2  and the variance of the projected samples of class 2 is   = Pxi∈C2(yi  − 1)2 . The Fisher linear discriminant is to project to a direction v which maximizes:

 + 

Let the variance of the original samples of class 1 be S = Pxi∈C1(xi − µ1)((xi − µ1)T . and the variance of the original samples of class 2 be S = Pxi∈C2(xi − µ2)((xi − µ2)T .  Define the within class variation:

Sw  = S1 + S2 .

Define the between the class variation: Sb  = (µ1 − µ2)(µ1 − µ2)T . Prove the objective function can be simplified as:

vTSbv

J(v) =