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

STAT 3690 Homework 4

1. We have information on n = 138 samples of Canadian hard red spring wheat and the our made from these samples.  The 5-dimensional vector x contains standardized wheat measurements on:  (X1 ) kernel texture, (X2 ) test weight, (X3 ) famaged kernels, (X4 ) foreign material and (X5 ) crude protein in the wheat. The 4-dimensional vector Y contains standardized flour measurements:  (Y1 ) wheat per barrel of flour, (Y2 ) ash in flour, (Y3 ) crude protein in flour, and (Y4 ) gluten quality index. We are only given the sample correlation matrices:

   一(一)   一(一) 

RX  =  .(.)                          1.000      0.323     0.444 .(.) ,

                                        1.000     0.334

     一(一)   0

RY  =  .(.)                          1.000      0. 163  .(.) ,

                                                   

一(一)   一(一)     一(一)

RXY  =  .(.)   0.737      0.361     0.546     0.172   .(.) .

   0.527      0.461     0.393    0.019

a.  Use sequential tests (with the Holm-Bonferroni procedure) to determine the number of significant canonical correlations at level α = .05.

b.  Compute sample canonical directions corresponding to the significant canonical correlations.

2.  Consider the situation where you have two normal populations N (µ1 , σ 1(2)) and N (µ2 , σ2(2)). We observe independent samples X1 , 1 , . . . , X1,n1   ~ N (µ1 , σ1(2)) and X2 , 1 , . . . , X2,n2   ~ N (µ2 , σ2(2)) with means 1  and 2 , respectively. We plan to use the following rule

R : Classify a new X as coming from population 2 if X > (1 + 2 )/2 and population 1 otherwise.

Assuming priors Pr(X ~ N (µ1 , σ 1(2))) = Pr(X ~ N (µ2 , σ2(2))) = 1/2, please express the misclassification rate of rule R, i.e.,

err(X) = Pr(X > (1 + 2 )/2 and X ~ N (µ1 , σ 1(2))) + Pr(X ≤ (1 + 2 )/2 and X ~ N (µ2 , σ2(2))), in terms of n1 , n2 , µ 1 , µ2 , σ 1 , σ2  and the standard normal cumulative distribution function Φ(.).

3.  Suppose there is a binary classification task: one would like to predict labels of n subjects, say Y1 , . . . , Yn ,

according to their independent p-dimensional observations x1 , . . . , xn .  The two potential populations

are assumed to be  MVNp (u1 , 五) and  MVNp (u2 , 五) ,  i.e.,  xi   ~ Yi  = yi  ~  MVNp (uyi , 五) , yi  =  1 , 2 .

Meanwhile, let Pr(Yi  = k) = πk   for all k = 1 , 2 and i = 1, . . . , n .

a.  Applying the linear discriminant analysis (LDA) to this problem, write down the mathematical expression of error rate in terms of u1 ,  u2 ,  五,  π 1 ,  π2   and the standard normal cumulative distribution function Φ(.).

b.  There is a banknote authentication dataset (see below for the data import), where n = 1, 372 data points consisted of features extracted (via the wavelet transformation) from images that were taken from genuine and forged banknotes. Specifically, the features are “variance” (the variance of wavelet-transformed image), “skewness” (the skewness of wavelet-transformed image), “curtosis” (the curtosis of wavelet-transformed image), and “entropy” (the entropy of image), all continuous. The authentication of banknote is indicated by “class” (0 for authentic and 1 for inauthentic). Figure out a parametric estimate for error rate of LDA by plugging estimates of u1 , u2 , 五, π 1  and π2  into the expression obtained in Q3a.

c.  Apply LDA to the dataset in Q3b and utilize 5 × 8-fold cross validation to estimate the resulting error rate. Report this error rate.

d.  Make a comment with one single sentence after comparing estimates given by Q3b and Q3c.

bn_df  =  read.table(

"https://archive.ics.uci.edu/ml/machine-learning-databases/00267/data_banknote_authentication.txt " , sep  =  ","

)

names (bn_df)  =  c ("variance" ,  "skewness" ,  "curtosis" ,  "entropy" ,  "class")