
#1




Hw5
Proof for Problem 1 is attached. Code for Problem 2.
Code:
data = load('hw5_data.txt','ASCII'); [N,M] = size(data); % mu and sigma mu = mean(data); sigma = cov(data); %chisquare and pvalue chi2 = zeros(N,1); p = zeros(N,1); for i = 1:N chi2(i) = (data(i,:)mu)*inv(sigma)*(data(i,:)mu)'; p(i) = 1chi2cdf(chi2(i),5); end %FDR [rank, index] = sort(p); alpha = 0.1; rej = []; j = 1; for i = 1:N if p(index(i)) < i*alpha/N rej(j) = index(i); j = j+1; end end 
Thread Tools  
Display Modes  

