CS395T/CAM383M Computational Statistics > HW 5 HW5 solutions
 Register FAQ Calendar Search Today's Posts Mark Forums Read

#1
03-06-2011, 12:49 PM
 meiyen.chen Member Join Date: Jan 2011 Posts: 33
HW5 solutions

Attached Images
 ChenMY_hw5.pdf (85.1 KB, 373 views)
Attached Files
 hw5Problem2.txt (3.4 KB, 445 views) hw5_code.txt (1.2 KB, 390 views)
#2
03-06-2011, 08:09 PM
 ilevy Member Join Date: Jan 2011 Posts: 43

Meiyen,

* corr(data) produces a correlation matrix. Instead, you want cov(data). Apparently there are a couple uses of inv(corr(data)) [1], but it's not what you want.
* A more elegant decision loop might be:
Code:
for j = 1:nData
if(pV(j) >= (j/nData)*alpha)
break
end
end
rejected = pI(1:j-1);
This is because after we hit an index that exceeds the threshold we should stop, even if there are points later along that go back below the threshold.

By the way, fprintf without a file identifier prints to screen. Personally, I like it more than using sprintf.

Last edited by ilevy; 03-06-2011 at 08:28 PM.
#3
03-07-2011, 12:09 PM
 xwang Member Join Date: Jan 2011 Posts: 30

Meiyen, could you explain why you mentioned "moment generation function" in your proof? How did you get them? Are they useful for proving the result? since I think the proof is good even without it... Thanks
#4
03-07-2011, 02:35 PM
 meiyen.chen Member Join Date: Jan 2011 Posts: 33
Correction of my code

Thanks for pointing out the bug in my code. I have corrected it and re-submit the corrected version of answer. In addition, I've done the Bonferroni correction and it detected these 6 data points that may be impostered:

495
1002
1003
1004
1005
1007
Attached Images
 ChenMY_hw5.pdf (85.6 KB, 395 views)
Attached Files
 hw5_code.txt (1.2 KB, 406 views) hw5Problem2.txt (69 Bytes, 406 views)
#5
03-07-2011, 02:41 PM
 meiyen.chen Member Join Date: Jan 2011 Posts: 33

I was thinking to use the moment generation function to prove that the sum of y^2 is a chi-square distribution with N degree of freedom since the function is unique for every distribution.... That's why I included it.

Quote:
 Originally Posted by xwang Meiyen, could you explain why you mentioned "moment generation function" in your proof? How did you get them? Are they useful for proving the result? since I think the proof is good even without it... Thanks
#6
03-07-2011, 04:25 PM
 xwang Member Join Date: Jan 2011 Posts: 30

Oh, I see what you tried to say is slide 8 and 9 in lecture 10, proof for the "statistic" chi-square is distributed as Chisquare. Thanks for reminding me this...

But there is a mistake in stating that "squared normal random variable is distributed as Chisquare". I mean, the "statistic" chi-square is the sum of squares of n independent t-values, instead of the random variables. i.e. here y_i should be seen as t-value of y_i since it's from N(0,1).

Quote:
 Originally Posted by meiyen.chen I was thinking to use the moment generation function to prove that the sum of y^2 is a chi-square distribution with N degree of freedom since the function is unique for every distribution.... That's why I included it.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home CS395T/CAM383M (Spring 2011) Course Administration     Announcements (click here and read!)     Basic Course Information     Supplementary Materials CS395T/CAM383M (Spring 2011) Lectures and Student Participation     Lecture Slides     Other Topics and Student Contributions     Homework Assignments and Student Postings         HW 1         HW 2         HW 3         HW 4         HW 5         HW 6     Student Term Projects Previous year: Spring, 2010     Announcements     Basic Course Information     Supplementary Materials     Lecture Slides     Other Topics and Student Contributions     Homework Assignments and Student Postings         HW 1         HW 2         HW 3         HW 4         HW 5         HW 6     Student Term Projects Previous year: Spring, 2009     Basic Course Information     Supplementary Materials     Lecture Slides     Student Term Projects

All times are GMT -6. The time now is 06:45 AM.

 www.wpressutexas.net - Archive - Top