SlideShare a Scribd company logo
1 of 36
Download to read offline
Stat310
     Continuous random variables


                            Hadley Wickham
Thursday, 4 February 2010
1. Finish off Poisson
                2. New conditions & definitions
                3. Uniform distribution
                4. Exponential and gamma




Thursday, 4 February 2010
Challenge

                    If X ~ Poisson(109.6), what is P(X > 100) ?
                    What’s the probability they score over 100
                    points? (How could you work this out?)




Thursday, 4 February 2010
1.0                                                                                                                                                                                              ●●   ●●●●●●●●●●●●●●●●●●
                                                                                                                                                                                                       ●   ●●●
                                                                                                                                                                                                   ●
                                                                                                                                                                                                ●●
                                                                                                                                                                                            ●
                                                                                                                                                                                        ●
                                                                                                                                                                                    ●
                                                                                                                                                                                ●
                                                                                                                                                                            ●
                                                                                                                                                                        ●
                                                                                                                                                                    ●
                                                                                                                                                                ●
              0.8                                                                                                                                           ●
                                                                                                                                                        ●
                                                                                                                                                    ●
                                                                                                                                                ●
                                                                                                                                            ●

                                                                                                                                        ●

                                                                                                                                    ●
              0.6
                                                                                                                                ●
 cumulative




                                                                                                                            ●

                                                                                                                        ●

                                                                                                                    ●

                                                                                                                ●
              0.4
                                                                                                            ●

                                                                                                        ●

                                                                                                    ●
                                                                                                ●
                                                                                            ●
                                                                                        ●
              0.2                                                                   ●
                                                                                ●
                                                                            ●
                                                                        ●
                                                                    ●
                                                                ●
                                                            ●
                                                        ●
                                                    ●
                                            ●   ●
                                    ●●   ●●
              0.0   ●●●●●●●●●●●●●




                             80                                                             100                                                                             120                                           140
                                                                                                                            grid
Thursday, 4 February 2010
Multiplication

                    X ~ Poisson(λ)
                    Y = tX
                    Then Y ~ Poisson(λt)




Thursday, 4 February 2010
Continuous
                            random variables
                   Recall: have uncountably many outcomes



Thursday, 4 February 2010
f (x)                 For continuous x,
                                        f(x) is a probability
                                        density function.




                   Not a probability!
                   (may be greater than one)


Thursday, 4 February 2010
b
            P (a  X  b) =                        f (x)dx
                                           a
                                              b
            P (a ≤ X ≤ b) =                        f (x)dx
                                           a



                            What does P(X = a) = ?
Thursday, 4 February 2010
Conditions



                      f (x) ≥ 0 ∀x ∈ R
                         
                            f (x) = 1
                            R

Thursday, 4 February 2010
E(u(X)) =                    u(x)f (x)dx
                                R

                            
             MX (t) =               e f (x)dx
                                    tx
                            R

Thursday, 4 February 2010
Aside
                    Why do we need different methods for
                    discrete and continuous variables?
                    Our definition of integration (Riemanian)
                    isn’t good enough, because it can’t deal
                    with discrete pdfs.
                    Can generalise to get Lebesgue
                    integration. More general approach called
                    measure theory.


Thursday, 4 February 2010
Cumulative distribution function
                                                 x
           F (x) = P (X ≤ x) =                        f (t)dt
                                                −∞


                                 b
       P (X ∈ [a, b]) =               f (x)dx = F (b) − F (a)
                              a




Thursday, 4 February 2010
f (x)
  Integrate                         Differentiate




                            F(x)
Thursday, 4 February 2010
Uniform distribution



Thursday, 4 February 2010
The uniform

                    Assigns probability uniformly in an interval
                    [a, b] of the real line
                    X ~ Uniform(a, b)
                    What are F(x) and f(x) ?
                                b
                                     f (x)dx = 1
                             a
Thursday, 4 February 2010
Intuition

                    X ~ Unif(a, b)
                    How do you expect the mean to be
                    related to a and b?
                    How do you expect the variance to be
                    related to a and b?



Thursday, 4 February 2010
1
                        f (x) =       x ∈ [a, b]
                                b−a

                  F (x) =        0    xa
                  F (x) =       x−a
                                b−a   x ∈ [a, b]
                  F (x) =        1    xb

Thursday, 4 February 2010
b
                                                              1
          MX (t) = E[e                Xt
                                           ]=            ext
                                                                 dx
                                                 a           b−a


                       integrate e^(x * t) 1/(b-a) dx from a to b




Thursday, 4 February 2010
Mean  variance
                    Find mgf: integrate e^(x * t) 1/(b-a) dx from a
                    to b
                    Find 1st moment: d/dt (E^(a_1 t) - E^(b_1 t))/
                    (a_1 t - b_1 t) where t = 0
                    Find 2nd moment d^2/dt^2 (E^(a_1 t) - E^
                    (b_1 t))/(a_1 t - b_1 t) where t = 0
                    Find var: simplify 1/3 (a_1
                    b_1+a_1^2+b_1^2) - ((a_1 + b_1)/2) ^ 2


Thursday, 4 February 2010
a+b
                             E(X) =
                                     2
                                      (b − a)
                                            2
                            V ar(X) =
                                         12

Thursday, 4 February 2010
Write out in a similar
                way when using wolfram
                  alpha in homework


Thursday, 4 February 2010
Exponential and
                    gamma distributions


Thursday, 4 February 2010
Conditions
                    Let X ~ Poisson(λ)
                    Let Y be the time you wait for the next
                    event to occur. Then
                    Y ~ Exponential(β = 1 / λ)
                    Let Z be the time you wait for α events to
                    occur. Then Z ~ Gamma(α, β = 1 / λ)



Thursday, 4 February 2010
LA Lakers
                    Last time we said the distribution of
                    scores looked pretty close to Poisson.
                    Does the distribution of times between
                    scores look exponential?
                    (Downloaded play-by-play data for all
                    NBA games in 08/09 season, extracted all
                    point scoring plays by Lakers, computed
                    times between them - 4660 in total)


Thursday, 4 February 2010
8 are exponential. 1 is real.
           1                                                    2                            3
              0.030
              0.025
              0.020
              0.015
              0.010
              0.005
              0.000
                                   4                            5                            6
              0.030
              0.025
 Proportion




              0.020
              0.015
              0.010
              0.005
              0.000
                                   7                            8                            9
              0.030
              0.025
              0.020
              0.015
              0.010
              0.005
              0.000
                      0   50   100 150 200 250 300 0   50   100 150 200 250 300 0   50   100 150 200 250 300
                                                            value
Thursday, 4 February 2010
0.030
                            What causes this spike?

              0.025




              0.020
 Proportion




              0.015




              0.010




              0.005




              0.000

                       0         50   100   150    200   250   300
                                             dur
Thursday, 4 February 2010
0.030
                                                          β = 44.9 s

              0.025




              0.020
 Proportion




              0.015




              0.010




              0.005




              0.000

                       0    50   100   150    200   250     300
                                        dur
Thursday, 4 February 2010
Why?

                    Why is it easy to see that the waiting
                    times are not exponential, when we
                    couldn’t see that the scores were not
                    Poisson?




Thursday, 4 February 2010
Next

                    Remove free throws.
                    Try using a gamma instead (it’s a bit more
                    flexible because it has two parameters,
                    but it maintains the basic idea)




Thursday, 4 February 2010
8 are gamma. 1 is real.
           1                                                      2                           3
              0.020

              0.015

              0.010

              0.005

              0.000
                                    4                             5                           6
              0.020

              0.015
 Proportion




              0.010

              0.005

              0.000
                                    7                             8                           9
              0.020

              0.015

              0.010

              0.005

              0.000
                      0     100   200   300   400   0   100    200    300   400   0   100   200   300   400
                                                              value
Thursday, 4 February 2010
0.020




              0.015
 Proportion




              0.010




              0.005




              0.000

                      0     100   200     300   400
                                    dur
Thursday, 4 February 2010
0.020
                                                        β = 28.3
                                                        α = 2.28

              0.015                             Out of 6611 shots,
                                                    3140 made it:
                                                1 went in for every
 Proportion




              0.010
                                                      2.1 attempts



              0.005




              0.000

                      0     100   200     300           400
                                    dur
Thursday, 4 February 2010
Exponential          Gamma

                                    1 −x/θ              1
               pdf          f (x) = e         f (x) =
                                                      Γ(α)θα
                                                             xα−1 e−x/θ
                                    θ
                                       1                  1
              mgf           M (t) =           M (t) =
                                                      (1 − θt)α
                                     1 − θt
           Mean                   θ                    αθ
                                      2                      2
     Variance                     θ                    αθ
Thursday, 4 February 2010
Another derivation
                    Find mgf: integrate 1 / (gamma(alpha)
                    theta^alpha) x^(alpha - 1) e^(-x / theta) e^
                    (x*t) from x = 0 to infinity
                    Find mean: d/dt theta^(-alpha) (1/theta - t)
                    ^(-alpha) where t = 0
                    Rewrite: d/dt x_2^(-x_1) (1/x_2 - t)^(-x_1)
                    where t = 0


Thursday, 4 February 2010
Your turn
                    Assume the distribution of offensive
                    points by the LA lakers is Poisson(109.6).
                    A game is 48 minutes long.
                    Let W be the time you wait between the
                    Lakers scoring a point. What is the
                    distribution of W?
                    How long do you expect to wait?


Thursday, 4 February 2010
Next week

                    Normal distribution: Read 3.2.4
                    Calculating probabilities
                    Transformations: Read 3.4 up to 3.4.3




Thursday, 4 February 2010

More Related Content

Similar to 08 Continuous

Similar to 08 Continuous (20)

02 Large
02 Large02 Large
02 Large
 
02 large
02 large02 large
02 large
 
04 Wrapup
04 Wrapup04 Wrapup
04 Wrapup
 
How People Use Facebook -- And Why It Matters
How People Use Facebook -- And Why It MattersHow People Use Facebook -- And Why It Matters
How People Use Facebook -- And Why It Matters
 
Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1Los Angeles R users group - July 12 2011 - Part 1
Los Angeles R users group - July 12 2011 - Part 1
 
13 Bivariate
13 Bivariate13 Bivariate
13 Bivariate
 
研修企画書11 12term voda-カヤック
研修企画書11 12term voda-カヤック研修企画書11 12term voda-カヤック
研修企画書11 12term voda-カヤック
 
About Vision, Mission And Strategy
About Vision, Mission And StrategyAbout Vision, Mission And Strategy
About Vision, Mission And Strategy
 
Over Visie, Missie En Strategie
Over Visie, Missie En StrategieOver Visie, Missie En Strategie
Over Visie, Missie En Strategie
 
Model Visualisation (with ggplot2)
Model Visualisation (with ggplot2)Model Visualisation (with ggplot2)
Model Visualisation (with ggplot2)
 
研修企画書11-12term voda-カヤック
研修企画書11-12term voda-カヤック研修企画書11-12term voda-カヤック
研修企画書11-12term voda-カヤック
 
14 case-study
14 case-study14 case-study
14 case-study
 
1 basics
1 basics1 basics
1 basics
 
01 Intro
01 Intro01 Intro
01 Intro
 
17 polishing
17 polishing17 polishing
17 polishing
 
01 intro
01 intro01 intro
01 intro
 
The ecological and evolutionary impacts of altered
The ecological and evolutionary impacts of alteredThe ecological and evolutionary impacts of altered
The ecological and evolutionary impacts of altered
 
07 Discrete
07 Discrete07 Discrete
07 Discrete
 
Space-time data workshop at IfGI
Space-time data workshop at IfGISpace-time data workshop at IfGI
Space-time data workshop at IfGI
 
17 Sampling Dist
17 Sampling Dist17 Sampling Dist
17 Sampling Dist
 

More from Hadley Wickham (20)

27 development
27 development27 development
27 development
 
27 development
27 development27 development
27 development
 
24 modelling
24 modelling24 modelling
24 modelling
 
23 data-structures
23 data-structures23 data-structures
23 data-structures
 
Graphical inference
Graphical inferenceGraphical inference
Graphical inference
 
R packages
R packagesR packages
R packages
 
22 spam
22 spam22 spam
22 spam
 
21 spam
21 spam21 spam
21 spam
 
20 date-times
20 date-times20 date-times
20 date-times
 
19 tables
19 tables19 tables
19 tables
 
18 cleaning
18 cleaning18 cleaning
18 cleaning
 
16 critique
16 critique16 critique
16 critique
 
15 time-space
15 time-space15 time-space
15 time-space
 
13 case-study
13 case-study13 case-study
13 case-study
 
12 adv-manip
12 adv-manip12 adv-manip
12 adv-manip
 
11 adv-manip
11 adv-manip11 adv-manip
11 adv-manip
 
11 adv-manip
11 adv-manip11 adv-manip
11 adv-manip
 
10 simulation
10 simulation10 simulation
10 simulation
 
10 simulation
10 simulation10 simulation
10 simulation
 
09 bootstrapping
09 bootstrapping09 bootstrapping
09 bootstrapping
 

Recently uploaded

Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
Matteo Carbone
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
dlhescort
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
amitlee9823
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 

Recently uploaded (20)

VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperity
 

08 Continuous

  • 1. Stat310 Continuous random variables Hadley Wickham Thursday, 4 February 2010
  • 2. 1. Finish off Poisson 2. New conditions & definitions 3. Uniform distribution 4. Exponential and gamma Thursday, 4 February 2010
  • 3. Challenge If X ~ Poisson(109.6), what is P(X > 100) ? What’s the probability they score over 100 points? (How could you work this out?) Thursday, 4 February 2010
  • 4. 1.0 ●● ●●●●●●●●●●●●●●●●●● ● ●●● ● ●● ● ● ● ● ● ● ● ● 0.8 ● ● ● ● ● ● ● 0.6 ● cumulative ● ● ● ● 0.4 ● ● ● ● ● ● 0.2 ● ● ● ● ● ● ● ● ● ● ● ●● ●● 0.0 ●●●●●●●●●●●●● 80 100 120 140 grid Thursday, 4 February 2010
  • 5. Multiplication X ~ Poisson(λ) Y = tX Then Y ~ Poisson(λt) Thursday, 4 February 2010
  • 6. Continuous random variables Recall: have uncountably many outcomes Thursday, 4 February 2010
  • 7. f (x) For continuous x, f(x) is a probability density function. Not a probability! (may be greater than one) Thursday, 4 February 2010
  • 8. b P (a X b) = f (x)dx a b P (a ≤ X ≤ b) = f (x)dx a What does P(X = a) = ? Thursday, 4 February 2010
  • 9. Conditions f (x) ≥ 0 ∀x ∈ R f (x) = 1 R Thursday, 4 February 2010
  • 10. E(u(X)) = u(x)f (x)dx R MX (t) = e f (x)dx tx R Thursday, 4 February 2010
  • 11. Aside Why do we need different methods for discrete and continuous variables? Our definition of integration (Riemanian) isn’t good enough, because it can’t deal with discrete pdfs. Can generalise to get Lebesgue integration. More general approach called measure theory. Thursday, 4 February 2010
  • 12. Cumulative distribution function x F (x) = P (X ≤ x) = f (t)dt −∞ b P (X ∈ [a, b]) = f (x)dx = F (b) − F (a) a Thursday, 4 February 2010
  • 13. f (x) Integrate Differentiate F(x) Thursday, 4 February 2010
  • 15. The uniform Assigns probability uniformly in an interval [a, b] of the real line X ~ Uniform(a, b) What are F(x) and f(x) ? b f (x)dx = 1 a Thursday, 4 February 2010
  • 16. Intuition X ~ Unif(a, b) How do you expect the mean to be related to a and b? How do you expect the variance to be related to a and b? Thursday, 4 February 2010
  • 17. 1 f (x) = x ∈ [a, b] b−a F (x) = 0 xa F (x) = x−a b−a x ∈ [a, b] F (x) = 1 xb Thursday, 4 February 2010
  • 18. b 1 MX (t) = E[e Xt ]= ext dx a b−a integrate e^(x * t) 1/(b-a) dx from a to b Thursday, 4 February 2010
  • 19. Mean variance Find mgf: integrate e^(x * t) 1/(b-a) dx from a to b Find 1st moment: d/dt (E^(a_1 t) - E^(b_1 t))/ (a_1 t - b_1 t) where t = 0 Find 2nd moment d^2/dt^2 (E^(a_1 t) - E^ (b_1 t))/(a_1 t - b_1 t) where t = 0 Find var: simplify 1/3 (a_1 b_1+a_1^2+b_1^2) - ((a_1 + b_1)/2) ^ 2 Thursday, 4 February 2010
  • 20. a+b E(X) = 2 (b − a) 2 V ar(X) = 12 Thursday, 4 February 2010
  • 21. Write out in a similar way when using wolfram alpha in homework Thursday, 4 February 2010
  • 22. Exponential and gamma distributions Thursday, 4 February 2010
  • 23. Conditions Let X ~ Poisson(λ) Let Y be the time you wait for the next event to occur. Then Y ~ Exponential(β = 1 / λ) Let Z be the time you wait for α events to occur. Then Z ~ Gamma(α, β = 1 / λ) Thursday, 4 February 2010
  • 24. LA Lakers Last time we said the distribution of scores looked pretty close to Poisson. Does the distribution of times between scores look exponential? (Downloaded play-by-play data for all NBA games in 08/09 season, extracted all point scoring plays by Lakers, computed times between them - 4660 in total) Thursday, 4 February 2010
  • 25. 8 are exponential. 1 is real. 1 2 3 0.030 0.025 0.020 0.015 0.010 0.005 0.000 4 5 6 0.030 0.025 Proportion 0.020 0.015 0.010 0.005 0.000 7 8 9 0.030 0.025 0.020 0.015 0.010 0.005 0.000 0 50 100 150 200 250 300 0 50 100 150 200 250 300 0 50 100 150 200 250 300 value Thursday, 4 February 2010
  • 26. 0.030 What causes this spike? 0.025 0.020 Proportion 0.015 0.010 0.005 0.000 0 50 100 150 200 250 300 dur Thursday, 4 February 2010
  • 27. 0.030 β = 44.9 s 0.025 0.020 Proportion 0.015 0.010 0.005 0.000 0 50 100 150 200 250 300 dur Thursday, 4 February 2010
  • 28. Why? Why is it easy to see that the waiting times are not exponential, when we couldn’t see that the scores were not Poisson? Thursday, 4 February 2010
  • 29. Next Remove free throws. Try using a gamma instead (it’s a bit more flexible because it has two parameters, but it maintains the basic idea) Thursday, 4 February 2010
  • 30. 8 are gamma. 1 is real. 1 2 3 0.020 0.015 0.010 0.005 0.000 4 5 6 0.020 0.015 Proportion 0.010 0.005 0.000 7 8 9 0.020 0.015 0.010 0.005 0.000 0 100 200 300 400 0 100 200 300 400 0 100 200 300 400 value Thursday, 4 February 2010
  • 31. 0.020 0.015 Proportion 0.010 0.005 0.000 0 100 200 300 400 dur Thursday, 4 February 2010
  • 32. 0.020 β = 28.3 α = 2.28 0.015 Out of 6611 shots, 3140 made it: 1 went in for every Proportion 0.010 2.1 attempts 0.005 0.000 0 100 200 300 400 dur Thursday, 4 February 2010
  • 33. Exponential Gamma 1 −x/θ 1 pdf f (x) = e f (x) = Γ(α)θα xα−1 e−x/θ θ 1 1 mgf M (t) = M (t) = (1 − θt)α 1 − θt Mean θ αθ 2 2 Variance θ αθ Thursday, 4 February 2010
  • 34. Another derivation Find mgf: integrate 1 / (gamma(alpha) theta^alpha) x^(alpha - 1) e^(-x / theta) e^ (x*t) from x = 0 to infinity Find mean: d/dt theta^(-alpha) (1/theta - t) ^(-alpha) where t = 0 Rewrite: d/dt x_2^(-x_1) (1/x_2 - t)^(-x_1) where t = 0 Thursday, 4 February 2010
  • 35. Your turn Assume the distribution of offensive points by the LA lakers is Poisson(109.6). A game is 48 minutes long. Let W be the time you wait between the Lakers scoring a point. What is the distribution of W? How long do you expect to wait? Thursday, 4 February 2010
  • 36. Next week Normal distribution: Read 3.2.4 Calculating probabilities Transformations: Read 3.4 up to 3.4.3 Thursday, 4 February 2010