probability and statistics
play

Probability and Statistics for Computer Science How - PowerPoint PPT Presentation

Probability and Statistics for Computer Science How are these connected? X ( N ) = 1 N ( X 1 + X 2 + ... + X N ) 2 exp ( ( x ) 2 1 p ( x ) = ) 2 2


  1. Probability ¡and ¡Statistics ¡ ì ¡ for ¡Computer ¡Science ¡ ¡ How ¡are ¡these ¡connected? ¡ X ( N ) = 1 N ( X 1 + X 2 + ... + X N ) μ 2 π exp ( − ( x − µ ) 2 1 p ( x ) = ) √ σ ¡ σ ¡ 2 σ 2 σ Credit: ¡wikipedia ¡ Hongye ¡Liu, ¡Teaching ¡Assistant ¡Prof, ¡CS361, ¡UIUC, ¡10.15.2019 ¡

  2. Last ¡Lecture ¡ ✺ Review ¡of ¡sample ¡mean ¡and ¡ confidence ¡interval ¡ ✺ Bootstrap ¡simulaNon ¡of ¡other ¡ sample ¡staNsNc ¡ ✺ Hypothesis ¡test ¡

  3. Quantile ¡ ✺ QuanNles ¡give ¡ Probability ¡density ¡ a ¡measure ¡of ¡ locaNon, ¡the ¡ median ¡is ¡the ¡ 0.5 ¡quanNle ¡ CumulaNve ¡Probability ¡ ¡ ¡(CDF) ¡ ¡ Credit: ¡ ¡ J. ¡Orloff ¡et ¡al ¡ ¡ ¡ ¡

  4. Quantile ¡ ✺ QuanNles ¡are ¡corresponding ¡to ¡ percenNles ¡using ¡percentage ¡in ¡the ¡ case ¡of ¡data ¡set. ¡ ✺ Median ¡is ¡0.5 ¡quanNle ¡and ¡50 ¡ percenNle ¡

  5. Q. ¡ ¡ ✺ Given ¡the ¡histogram ¡of ¡ Histogram of sample_median the ¡bootstrap ¡samples’ ¡ 3000 staNsNc, ¡we ¡want ¡to ¡get ¡ its ¡95% ¡confidence ¡ 2500 interval. ¡Where ¡is ¡the ¡ 2000 le^ ¡side ¡threshold? ¡ Frequency 1500 ¡ ¡ ¡ ¡ ¡A. ¡0.025 ¡quanNle ¡ 1000 ¡ ¡ ¡ ¡ ¡B. ¡0.05 ¡quanNle ¡ 500 ¡ ¡ ¡ ¡ ¡C. ¡0.975 ¡quanNle ¡ 0 250 300 350 400 450 500 550 sample_median

  6. Contents ¡ ✺ Review ¡of ¡variance, ¡sample ¡mean ¡ ✺ Sum ¡and ¡difference ¡between ¡ variables ¡of ¡normal ¡distribuNons ¡ ✺ Hypothesis ¡test ¡of ¡equality ¡of ¡two ¡ sample ¡means ¡ ✺ Chi-­‑square ¡test ¡

  7. Review ¡of ¡sample ¡mean ¡ ✺ The ¡sample ¡mean ¡is ¡the ¡average ¡of ¡ N ¡IID ¡ ¡ draws: ¡ X ( N ) = 1 N ( X 1 + X 2 + ... + X N ) Random ¡ ¡ variable! ¡ ✺ By ¡linearity ¡of ¡the ¡expectaNon ¡and ¡the ¡fact ¡ the ¡draws ¡of ¡sample ¡are ¡IID ¡ ¡ ¡ ¡ E [ X ( N ) ] = popmean ( { x } )

  8. Standard ¡deviation ¡of ¡sample ¡mean ¡ is ¡called ¡stderr ¡ ✺ By ¡the ¡variance ¡of ¡the ¡sum ¡of ¡independent ¡ random ¡variables ¡and ¡the ¡scaling ¡property ¡of ¡ variance, ¡we ¡know ¡the ¡variance ¡of ¡sample ¡mean ¡is: ¡ ** ¡ var [ X ( N ) ] = popvar ( { x } ) ¡ ¡ N ✺ We ¡call ¡the ¡standard ¡deviaNon ¡of ¡sample ¡mean ¡ stderr ¡and ¡so ¡we ¡have: ¡ ** ¡ ¡ ¡ var [ X ( N ) ] = popstd ( { x } ) � stderr = √ N

  9. Review ¡of ¡sample ¡mean ¡ ✺ When ¡ N ¡is ¡very ¡large, ¡according ¡to ¡the ¡ Central ¡ Limit ¡Theorem , ¡sample ¡mean ¡is ¡approaching ¡a ¡ normal ¡distribuNon. ¡And ¡this ¡normal ¡density ¡ has ¡ μ ¡≈ ¡mean ¡of ¡the ¡realized ¡sample ¡and ¡ σ ¡≈ ¡ stderr. ¡ ✺ When ¡we ¡don’t ¡know ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡, ¡we ¡ popstd ( { x } ) esNmate ¡it ¡with ¡the ¡following: ¡ ** ¡ stderr ( { x } ) ≃ stdunbiased ( { x } ) ¡ ¡ √ N

  10. Q. ¡ ¡ ✺ Among ¡the ¡students ¡in ¡CS361, ¡I ¡randomly ¡sampled ¡ HW1, ¡HW2 ¡and ¡HW3 ¡grades ¡from ¡random ¡16 ¡students ¡ for ¡each ¡homework, ¡and ¡assume ¡students’ ¡ performance ¡in ¡HW1, ¡HW2 ¡and ¡HW3 ¡are ¡independent. ¡ Suppose ¡I ¡found ¡the ¡populaNon ¡variances ¡of ¡the ¡ grades ¡of ¡HW1, ¡HW2, ¡and ¡HW3 ¡are ¡9, ¡4, ¡4, ¡what ¡is ¡the ¡ variance ¡of ¡the ¡sum ¡of ¡the ¡three ¡sample ¡means? ¡ A. ¡7/4 ¡ ¡ ¡ ¡ ¡ ¡ ¡B. ¡7/8 ¡ ¡ C. ¡ ¡17/16 ¡D. ¡ ¡7/16 ¡ ¡

  11. Calculate ¡the ¡standard ¡error ¡for ¡ sample ¡mean ¡ ✺ The ¡unbiased ¡esNmate ¡of ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡ popsd ( { x } ) defined ¡as ¡ � 1 � stdunbiased ( { x } ) = ( x i − mean ( { x i } )) 2 N − 1 x i ∈ sample ✺ So ¡the ¡standard ¡error ¡is ¡esNmated ¡as ¡ stderr ( { x } ) = std [ X ( N ) ] = popsd ( { x } ) √ N = stdunbiased ( { x } ) √ N

  12. Interpreting ¡the ¡standard ¡error ¡ Probability ¡ 99.7% ¡ distribuNon ¡ 95% ¡ of ¡sample ¡ 68% ¡ mean ¡tends ¡ normal ¡ when ¡N ¡is ¡ large ¡ Credit: ¡ ¡ wikipedia ¡ PopulaNon ¡ ¡ μ+Standard ¡error ¡ mean ¡

  13. Confidence ¡intervals ¡when ¡N ¡is ¡large ¡ ✺ For ¡about ¡68% ¡of ¡realized ¡sample ¡means ¡ mean ( { x } ) − stderr ( { x } ) ≤ popmean ( { x } ) ≤ mean ( { x } ) + stderr ( { x } ) ✺ For ¡about ¡95% ¡of ¡realized ¡sample ¡means ¡ mean ( { x } ) − 2 · stderr ( { x } ) ≤ popmean ( { x } ) ≤ mean ( { x } )+2 · stderr ( { x } ) ✺ For ¡about ¡99.7% ¡of ¡realized ¡sample ¡means ¡ mean ( { x } ) − 3 · stderr ( { x } ) ≤ popmean ( { x } ) ≤ mean ( { x } )+3 · stderr ( { x } )

  14. What ¡does ¡95% ¡Confidence ¡interval ¡ mean? ¡ ✺ For ¡95% ¡of ¡the ¡realized ¡sample ¡means, ¡if ¡you ¡ construct ¡the ¡confidence ¡interval ¡this ¡way, ¡the ¡ populaNon ¡mean ¡will ¡lie ¡within ¡such ¡interval. ¡ ✺ It ¡does ¡ not ¡mean ¡the ¡populaNon ¡mean ¡lies ¡in ¡the ¡ interval ¡with ¡probability ¡95% ¡

  15. Contents ¡ ✺ Review ¡of ¡variance, ¡sample ¡mean ¡ ✺ Sum ¡and ¡difference ¡between ¡ variables ¡of ¡normal ¡distribuEons ¡ ✺ Hypothesis ¡test ¡of ¡equality ¡of ¡two ¡ sample ¡means ¡ ✺ Chi-­‑square ¡test ¡

  16. We ¡are ¡interested ¡in ¡comparing ¡ sample ¡means ¡ ✺ Are ¡the ¡average ¡ daily ¡body ¡ temperature ¡of ¡the ¡ two ¡beavers ¡the ¡ vs. ¡ same? ¡ ✺ We ¡need ¡to ¡model ¡ the ¡difference ¡ between ¡two ¡ sample ¡means ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

  17. How ¡do ¡we ¡model ¡the ¡difference ¡ between ¡two ¡samples ¡means? ¡ ✺ We ¡know ¡when ¡the ¡sample ¡size ¡ N ¡is ¡large, ¡ the ¡sample ¡mean ¡random ¡variable ¡ approaches ¡normal. ¡ ✺ So ¡our ¡problem ¡became ¡ finding ¡the ¡model ¡ of ¡the ¡difference ¡between ¡two ¡normally ¡ distributed ¡random ¡variables. ¡

  18. Background: ¡sum ¡of ¡independent ¡normals ¡ ¡ ✺ We ¡know ¡ X 1 ∼ normal ( µ 1 , σ 2 1 ) X 2 ∼ normal ( µ 2 , σ 2 2 ) ? ¡ X 1 + X 2 ∼ normal ( µ 1 + µ 2 , σ 2 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ 1 + σ 2 2 ) ✺ The ¡sum ¡of ¡ X 1 ¡and ¡ X 2 ¡is ¡sNll ¡normal ¡(proof ¡ omijed) ¡

  19. Background: ¡sum ¡of ¡independent ¡normals ¡ ¡ ✺ We ¡know ¡ X 1 ∼ normal ( µ 1 , σ 2 1 ) X 2 ∼ normal ( µ 2 , σ 2 2 ) ✺ So ¡ X 1 + X 2 ∼ normal ( µ 1 + µ 2 , σ 2 1 + σ 2 2 ) ✺ By ¡the ¡linearity ¡of ¡expected ¡value ¡and ¡the ¡ sum ¡rule ¡of ¡variance ¡of ¡the ¡sum ¡of ¡two ¡ independent ¡random ¡variables. ¡

  20. Background: ¡sum ¡of ¡independent ¡normals ¡ ¡ ✺ We ¡know ¡ ¡ X 1 ∼ normal ( µ 1 , σ 2 1 ) X 2 ∼ normal ( µ 2 , σ 2 2 ) ✺ So ¡ X 1 + X 2 ∼ normal ( µ 1 + µ 2 , σ 2 1 + σ 2 2 ) ✺ By ¡properNes: ¡ ¡ E [ X 1 + X 2 ] = E [ X 1 ] + E [ X 2 ] var [ X 1 + X 2 ] = var [ X 1 ] + var [ X 2 ]

  21. Difference ¡of ¡independent ¡normals ¡ ¡ ✺ We ¡know ¡ X 1 ∼ normal ( µ 1 , σ 2 1 ) X 2 ∼ normal ( µ 2 , σ 2 2 ) X 1 − X 2 ∼ ? ¡ ✺ The ¡difference ¡of ¡ X 1 ¡and ¡ X 2 ¡is ¡sNll ¡normal ¡ (proof ¡omijed) ¡

  22. Difference ¡of ¡independent ¡normals ¡ ¡ ✺ We ¡know ¡ X 1 ∼ normal ( µ 1 , σ 2 1 ) X 2 ∼ normal ( µ 2 , σ 2 2 ) ** ¡ ✺ So ¡ X 1 − X 2 ∼ normal ( µ 1 − µ 2 , σ 2 1 + σ 2 2 ) ✺ By ¡the ¡linearity ¡of ¡expected ¡value ¡and ¡the ¡sum ¡ rule ¡of ¡variance ¡of ¡the ¡sum ¡of ¡two ¡independent ¡ random ¡variables ¡and ¡the ¡scaling ¡property ¡of ¡ variance. ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend