Continuous Probability in CSE 312 Winter Lecture 14

continuous probability n.w
1 / 33
Embed
Share

Explore the concepts of continuous probability in CSE 312 Winter Lecture 14. Learn about probability density functions, cumulative distribution functions, and more. Dive into the world of random variables in a countable sample space and gain insights into making predictions from data.

  • Continuous Probability
  • CSE 312
  • Lecture 14
  • Random Variables
  • Probability

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Continuous Probability CSE 312 Winter 25 Lecture 14

  2. Zoo! ?~???(?) ?~????(?,?) ?~???(?,?) ?~???(?) ? ? ??? = ? ?; ??(?) = ? ? ??? = ? ?? ?? ? ? =? ? ??? ? =? ? ??? ?? ? ??? = ??? = ? ? =? + ? ? ? + ? ? ? = ?? ? ? = ? ? ? ? ? ? + ? ?? ?? ??? ? = ??? ? = ??(? ?) ??? ? = ?(? ?) ?~???(?) ?~??????(?,?,?) ?~??????(?,?) ??? =??? ? ? ? ? ? ? ? =? ? ? ? ? ? ? ? ? ??? ?? ? ??? = ??? = ?! ? ? = ?? ? ? = ? ? ? ??? ? =?(? ?) ??? ? =?(? ?)(? ?) ??(? ?) ??? ? = ? ??

  3. Zoo Takeaways We skipped hypergeometric; slides are there, you can use the formulas! Drawing without replacement from an urn is the situation. You can do relatively complicated counting/probability calculations much more quickly than you could week 1! You can now explain why your problem is a zoo variable and save explanation on homework (and save yourself calculations in the future). Don t spend extra effort memorizing but be careful when looking up Wikipedia articles. The exact definitions of the parameters can differ (is a geometric random variable the number of failures before the first success, or the total number of trials including the success?)

  4. Where Are We?

  5. What have we done over the past 5 weeks? Counting Combinations, permutations, indistinguishable elements, starts and bars, inclusion- exclusion Probability foundations Events, sample space, axioms of probability, expectation, variance Conditional probability Conditioning, independence, Bayes Rule Refined our intuition Especially around Bayes Rule

  6. Whats next? Continuous random variables. So far our sample spaces have been countable. What happens if we want to choose a random real number? How do expectation, variance, conditioning, etc. change in this new context? Mostly analogous to discrete cases, but with integrals instead of sums. Analysis when it s inconvenient (or impossible) to exactly calculate probabilities. Central Limit Theorem (approximating discrete distributions with continuous ones) Tail Bounds/Concentration (arguing it s unlikely that a random variable is far from its expectation) A first taste of making predictions from data (i.e., a bit of ML)

  7. Today Continuous Probability Probability Density Function Cumulative Distribution Function Goal for today is to get intuition on what s different in the continuous case. Your goal today is to start building up a gut-feeling of what s happening. ASK QUESTIONS, (always, but today especially).

  8. Continuous Random Variables

  9. Continuous Random Variables We ll need continuous probability spaces and continuous random variables to describe experiments that have uncountably-infinite sample spaces. e.g. all real numbers How long until the next bus shows up? What location does a dart land?

  10. Continuous Random Variables Wait, we re computer scientists. Computers don t do real numbers, why should we? Continuous random variables will be a useful model for enormous sample spaces. The math will be easier. Example: polling a large population. The sample space is actually discrete. But we re going to round the result anyway. Make it continuous first for easier math, then round.

  11. Why Need New Rules? We want to choose a uniformly random real number between 0 and 1. What s the probability the number is between 0.4 and 0.5? For discrete random variables, we d ask for ? So we get The mathematical tools to get consistent answers from expressions like those is calculus.

  12. Lets start with the pmf For discrete random variables, we defined the pmf: ??? = (? = ?). We can t have a pmf quite like we did for discrete random variables. Let ? be a random real number between 0 and 1. 1 ?? ? = .1 = Let s try to maintain as many rules as we can Discrete ??? 0 Continuous ??? 0 ??(?) d? = 1 Use ?? instead of ?? to remember it s different . ??(?) = 1 ?

  13. The probability density function For Continuous random variables, the analogous object is the probability density function we write ??? instead of ??(?) Idea: Make it work right for events events since single outcomes don t make sense. ? integrating is analogous to sum. ? ? ? = ? ??? d? = ? ?

  14. The probability density function For Continuous random variables, the analogous object is the probability density function we write ??? instead of ??(?) Idea: Make it work right for events events since single outcomes don t make sense. ? ??? d? = ? integrating is analogous to sum. ? ? ? = ? ? Let s derive an example PDF together! For a uniform random real number in [0,1]

  15. The probability density function For Continuous random variables, the analogous object is the probability density function we write ??? instead of ??(?) Idea: Make it work right for events events since single outcomes don t make sense. 0 ? 1 = 1 integrating is analogous to sum. (? is negative) = 0 .4 ? .5 = .1

  16. The probability density function For Continuous random variables, the analogous object is the probability density function we write ??? instead of ??(?) Idea: Make it work right for events events since single outcomes don t make sense. 1 ??? d? = 1 0 ? 1 = 1 integrating is analogous to sum. 0 0 (? is negative) = 0 ??? d? = 0 .5 .4 ? .5 = .1 ??(?) d? = .1 .4

  17. PDF for uniform Let ? be a uniform real number between 0 and 1. What should ??(?) be to make all those events integrate to the right values? ??? = 0 if ? < 0 or ? > 1 1 if 0 ? 1

  18. Probability Density Function So ? = .1 =?? ??.1 = 1 The number that best represents (? = .1) is 0. This is different from ??(?) For continuous probability spaces: Impossible events have probability ?, but some probability ? events might be possible. So what is ??(?)???

  19. Using the PDF Let s look at a different pdf Compare the events: ? .2 and ? .5 (.2 ?/2 ? .2 + ?/2) What will the pdf give? .2 ?/2 ??.2 ? 2+?/2??? d? .2 .5 What happens if we look at the ratio (? .2) (? .5)

  20. Using the PDF Let s look at a different pdf Compare the events: ? .2 and ? .5 (.2 ?/2 ? .2 + ?/2) What will the pdf give? .2 ?/2 2+?/2??? d? ??.2 ? .2 .5 What happens if we look at the ratio .2 ? .5 ? 2 ? .2+? 2 ? .5+? (? .2) (? .5)= =???(.2) ???(.5)=??.2 2 ??(.5) 2

  21. So whats the pdf? It s the number that when integrated over gives the probability of an event. Equivalently, it s number such that: -integrating over all real numbers gives 1. -comparing ??? and ??( ) gives the relative chances of ? being near ? or .

  22. CDFs

  23. Whats a CDF? The Cumulative Distribution Function ??? = (? ?) analogous to the CDF for discrete variables. ? ??? d? ??? = ? ? = So how do I get from CDF to PDF? Taking the derivative! ? d d d???(?) = ??? d? = ??(?) ??

  24. Comparing Discrete and Continuous Discrete Random Variables Continuous Random Variables Probability ? Equivalent to impossible All impossible events have probability 0, but not conversely. PDF ??(?) gives chances relative to ??(? ) Integrate PDF to get probability Relative Chances PMF: ??? = (? = ?) Sum over PMF to get probability Events Convert from CDF to PMF Sum up PMF to get CDF. Look for breakpoints in CDF to get PMF. Integrate PDF to get CDF. Differentiate CDF to get PDF. ?[?] ?(?) ??(?) ? ??? d? ? ?[? ? ] ? ? ? ??(?) ?(?) ??? d? ? ? ?2 ? ? 2 ???(?) ? ?2 ? ? 2= 2??? d? ? ? ?

  25. What about expectation? For a random variable ?, we define: ?(?) ??? d? ? ? = Just replace summing over the pmf with integrating the pdf. It still represents the average value of ?.

  26. Expectation of a function For any function ? and any continuous random variable, ?: ? ? ? = ? ?(?) ??? ?? Again, analogous to the discrete case; just replace summation with integration and pmf with the pdf. We re going to treat this as a definition. Technically, this is really a theorem; since ?() is the pdf of ? and it only gives relative likelihoods for ?, we need a proof to guarantee it works for ?(?). Sometimes called Law of the Unconscious Statistician.

  27. Linearity of Expectation Still true! ? ?? + ?? + ? = ?? ? + ??[?] + ? For all ?,?; even if they re continuous. Won t show you the proof for just ?[?? + ?], it s ? ?? + ? = ?? ? + ? ??(?) d? ?? ? ??? ?? + ? ? ??? ?? + ? = ?? ? + ? ???? ?? ??? ?? = = ?

  28. Variance No surprises here ??? ? = ? ?? ? ? ?= ? ?? ??(?) ? ? ? ?

  29. 1 Let s calculate an expectation ? ? if ? ? ? 0 otherwise ??? = Let ? be a uniform random number between ? and ?. ? ??? d? ? ? =

  30. Lets calculate an expectation Let ? be a uniform random number between ? and ?. ? ??? d? ? ? = ? ?? ? 0d? 1 = ? 0 d? + ? ? ? ? ? d? + 0 ? ?=?= ? ?d? + ? = 0 + ? ?2 ?2 ?2 ?2 ?2 2 ? ?= ?+? ? ? 2 ? ? =?+? = 2(? ?) 2 ? ?= 2(? ?) 2

  31. What about ? ? ? Let ?~Unif(?,?), what about ? ?2? ?2??? d? ? ?2= ? ??2 ?2 0 d? 1 ?2 0 d? + ? ??2 = ? ?d? + ? 1 = 0 + ? ? ?d? + 0 ? ?3 3 ?3 3 ?3 1 1 1 3 ? ? ? ? ?2+ ?? + ?2 = ? ? ?=?= = ? ? 3 =?2+??+?2 3

  32. Lets assemble the variance Var ? = ? ?2 ? ? 2 2 =?2+??+?2 ?+? 2 3(?2+2??+?2) 3 =4(?2+??+?2) 12 12 =?2 2??+?2 12 ? ?2 12 =

  33. Continuous Uniform Distribution ?~Unif(?,?) (uniform real number between ? and ?) 1 ? ? if ? ? ? 0 otherwise 0 ? ? ? ? if ? ? ? 1 PDF: ??? = if ? < ? CDF: ??? = if ? ? ? ? =?+? 2 ? ?2 12 Var ? =

More Related Content