SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Quiz
                    • Pick up quiz on your way in.
                    • Start at 1pm
                    • Finish at 1:10pm


                    • Bonus: no homework this week.
                      Homework help sessions -> review
                      sessions.


Tuesday, 16 February 2010
Stat310  Transformations & CDF


                            Hadley Wickham
Tuesday, 16 February 2010
1. Transformations
                2. CDF (again)
                      1. Exact computation
                      2. Tables




Tuesday, 16 February 2010
Transformations
                     Distribution                 Change of
                      function                     variable
                     technique                    technique



                            Much more useful for 2+ rvs
Tuesday, 16 February 2010
Remember: it’s the sample
                 space that changes, not
                     the probability



Tuesday, 16 February 2010
Distribution function
                                  technique

                    Y = u(X)
                    1. Find region in X such that g(X) < y
                    2. Find cdf with integration
                    3. Find pdf by differentiating




Tuesday, 16 February 2010
Finish the proof

                    X = Uniform(-1, 1)
                    Y = X2
                    P(Y < y) =   P(X2<   y) = ...




Tuesday, 16 February 2010
Change of variables

                    If Y = u(X), and
                    v is the inverse of u, X = v(Y)
                    then
                    fY(y) = fX(v(y)) |v’(y)|

                                               Transformation must
                                                 have an inverse!
Tuesday, 16 February 2010
Your turn
                    X = Uniform(-1, 1)
                    Y=      X2


                    Can you use the change of variables
                    technique here? Why/why not? If not,
                    how could you modify X to make it
                    possible?



Tuesday, 16 February 2010
Your turn

                    X ~ Exponential(β)
                    Y = exp(X)


                    Find fY(y). Does y have a named
                    distribution?


Tuesday, 16 February 2010
Relationship to uniform


                    Important connection between the
                    uniform and every other random variable
                    through the cdf.




Tuesday, 16 February 2010
Uniform to any rv
                    IF
                    Y ~ Uniform(0, 1)
                    F a cdf
                    THEN
                    X=      F -1(Y)   is a rv with cdf F(x)
                    (Assume F strictly increasing for simplicity)



Tuesday, 16 February 2010
Any rv to uniform
                    IF
                    X has cdf F
                    Y = F(X)
                    THEN
                    Y ~ Uniform(0, 1)
                    (Assume F strictly increasing for simplicity)



Tuesday, 16 February 2010
CDF



Tuesday, 16 February 2010
F (x) = P (X ≤ x)

                                        
                  discrete    F (x) =         f (t)
                                        tx
                                         x
        continuous            F (x) =          f (t)dt
                                         −∞


Tuesday, 16 February 2010
f (x)
  Integrate                         Differentiate




                            F(x)
Tuesday, 16 February 2010
lim F (x) = 0
                            x→−∞

                             lim F (x) = 1
                            x→∞


                             monotone increasing

                               right-continuous


Tuesday, 16 February 2010
lim F (x) = 0
                            x→−∞

                             lim F (x) = 1
                            x→∞


                             monotone increasing

                               right-continuous


Tuesday, 16 February 2010
Using the cdf
        P (a  X ≤ b) = F (b) − F (a)
                    Exact computation
                    Tables
                    Computer




Tuesday, 16 February 2010
Exact computation

                    For some distributions we can write the
                    cdf in closed form. For example: the
                    exponential distribution has cdf:
                                 
                                     1−e −λx
                                               ,   x ≥ 0,
               F (x; λ) =
                                       0,          x  0.


Tuesday, 16 February 2010
Exact computation
                    Many, however cannot:
                    http://en.wikipedia.org/wiki/
                    Binomial_distribution
                    http://en.wikipedia.org/wiki/
                    Gamma_distribution
                    integrate 1/(sqrt(2 pi)) e ^ (-t^2 / 2) from -
                    infinity to x


Tuesday, 16 February 2010
Closed form
                    Neither the CDF of the normal distribution
                    nor erf can be expressed in terms of finite
                    additions, subtractions, multiplications,
                    and root extractions, and so both must be
                    either computed numerically or otherwise
                    approximated.
                    i.e. can’t be expressed in closed form


http://mathworld.wolfram.com/NormalDistribution.html
Tuesday, 16 February 2010
Two approaches

                    Look up the number in a table.
                            Problem: you need a table for every
                            combination of the parametes
                    Use a computer.
                            Problem: you need a computer



Tuesday, 16 February 2010
Tables



Tuesday, 16 February 2010
Standard normal
                    Fortunately, for the normal distribution, we
                    can convert any random variable with a
                    normal distribution to a standard normal.
                    This means we only need one table for
                    any possible normal distribution. (For
                    other distributions there will be multiple
                    tables, and typically you will have to pick
                    one with similar values to your example).


Tuesday, 16 February 2010
P (Z  z) = Φ(z)
                            Φ(−z) = 1 − Φ(z)

                      P (−1  Z  1) = 0.68
                      P (−2  Z  2) = 0.95
                      P (−3  Z  3) = 0.998
Tuesday, 16 February 2010
Using the tables
                      Column + row = z
                      Find: Φ(2.94), Φ(-1), Φ(0.01), Φ(4)


                      Can also use in reverse: For what value
                      of z is P(Z  z) = 0.90 ? i.e. What is Φ-1(0.90)?
                      Find: Φ-1(0.1), Φ-1(0.5), Φ-1(0.65), Φ-1(1)



Tuesday, 16 February 2010
Next time


                    Using the computer instead
                    Generating random values and simulation




Tuesday, 16 February 2010

Contenu connexe

Tendances

11.[104 111]analytical solution for telegraph equation by modified of sumudu ...
11.[104 111]analytical solution for telegraph equation by modified of sumudu ...11.[104 111]analytical solution for telegraph equation by modified of sumudu ...
11.[104 111]analytical solution for telegraph equation by modified of sumudu ...Alexander Decker
 
Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Matthew Leingang
 
Lesson 14: Derivatives of Logarithmic and Exponential Functions
Lesson 14: Derivatives of Logarithmic and Exponential FunctionsLesson 14: Derivatives of Logarithmic and Exponential Functions
Lesson 14: Derivatives of Logarithmic and Exponential FunctionsMatthew Leingang
 
Topographic graph clustering with kernel and dissimilarity methods
Topographic graph clustering with kernel and dissimilarity methodsTopographic graph clustering with kernel and dissimilarity methods
Topographic graph clustering with kernel and dissimilarity methodstuxette
 
Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...Alexander Decker
 
11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...Alexander Decker
 
computational stochastic phase-field
computational stochastic phase-fieldcomputational stochastic phase-field
computational stochastic phase-fieldcerniagigante
 
Robust 3D gravity gradient inversion by planting anomalous densities
Robust 3D gravity gradient inversion by planting anomalous densitiesRobust 3D gravity gradient inversion by planting anomalous densities
Robust 3D gravity gradient inversion by planting anomalous densitiesLeonardo Uieda
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge TheoryL. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge TheorySEENET-MTP
 
Reflect tsukuba524
Reflect tsukuba524Reflect tsukuba524
Reflect tsukuba524kazuhase2011
 
Logics of the laplace transform
Logics of the laplace transformLogics of the laplace transform
Logics of the laplace transformTarun Gehlot
 
N17. Bellettini- "constraining spacetime torsion"
N17. Bellettini- "constraining spacetime torsion" N17. Bellettini- "constraining spacetime torsion"
N17. Bellettini- "constraining spacetime torsion" IAPS
 
Fractional Calculus
Fractional CalculusFractional Calculus
Fractional CalculusVRRITC
 
Lesson 16: Inverse Trigonometric Functions
Lesson 16: Inverse Trigonometric FunctionsLesson 16: Inverse Trigonometric Functions
Lesson 16: Inverse Trigonometric FunctionsMatthew Leingang
 
An Affine Combination Of Two Lms Adaptive Filters
An Affine Combination Of Two Lms Adaptive FiltersAn Affine Combination Of Two Lms Adaptive Filters
An Affine Combination Of Two Lms Adaptive Filtersbermudez_jcm
 
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Matthew Leingang
 

Tendances (20)

11.[104 111]analytical solution for telegraph equation by modified of sumudu ...
11.[104 111]analytical solution for telegraph equation by modified of sumudu ...11.[104 111]analytical solution for telegraph equation by modified of sumudu ...
11.[104 111]analytical solution for telegraph equation by modified of sumudu ...
 
Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)
 
09 Normal Trans
09 Normal Trans09 Normal Trans
09 Normal Trans
 
Koc2(dba)
Koc2(dba)Koc2(dba)
Koc2(dba)
 
Lesson 14: Derivatives of Logarithmic and Exponential Functions
Lesson 14: Derivatives of Logarithmic and Exponential FunctionsLesson 14: Derivatives of Logarithmic and Exponential Functions
Lesson 14: Derivatives of Logarithmic and Exponential Functions
 
Topographic graph clustering with kernel and dissimilarity methods
Topographic graph clustering with kernel and dissimilarity methodsTopographic graph clustering with kernel and dissimilarity methods
Topographic graph clustering with kernel and dissimilarity methods
 
Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...
 
11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...
 
Fourier series
Fourier seriesFourier series
Fourier series
 
computational stochastic phase-field
computational stochastic phase-fieldcomputational stochastic phase-field
computational stochastic phase-field
 
Robust 3D gravity gradient inversion by planting anomalous densities
Robust 3D gravity gradient inversion by planting anomalous densitiesRobust 3D gravity gradient inversion by planting anomalous densities
Robust 3D gravity gradient inversion by planting anomalous densities
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge TheoryL. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
L. Jonke - A Twisted Look on Kappa-Minkowski: U(1) Gauge Theory
 
Reflect tsukuba524
Reflect tsukuba524Reflect tsukuba524
Reflect tsukuba524
 
Logics of the laplace transform
Logics of the laplace transformLogics of the laplace transform
Logics of the laplace transform
 
N17. Bellettini- "constraining spacetime torsion"
N17. Bellettini- "constraining spacetime torsion" N17. Bellettini- "constraining spacetime torsion"
N17. Bellettini- "constraining spacetime torsion"
 
Fractional Calculus
Fractional CalculusFractional Calculus
Fractional Calculus
 
Lesson 16: Inverse Trigonometric Functions
Lesson 16: Inverse Trigonometric FunctionsLesson 16: Inverse Trigonometric Functions
Lesson 16: Inverse Trigonometric Functions
 
An Affine Combination Of Two Lms Adaptive Filters
An Affine Combination Of Two Lms Adaptive FiltersAn Affine Combination Of Two Lms Adaptive Filters
An Affine Combination Of Two Lms Adaptive Filters
 
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)
 

En vedette

Luta com crocodilo
Luta com crocodiloLuta com crocodilo
Luta com crocodilocarloskurare
 
2.2 Billion spent online, in 2013.
2.2 Billion spent online, in 2013.2.2 Billion spent online, in 2013.
2.2 Billion spent online, in 2013.Mike Weiss
 
Sandpapir Nr. 39 1959
Sandpapir Nr. 39 1959Sandpapir Nr. 39 1959
Sandpapir Nr. 39 1959ispirix
 
Kisah nabi muhammad saw
Kisah nabi muhammad sawKisah nabi muhammad saw
Kisah nabi muhammad sawGunawan Anwar
 
Unids hi5 system slideshare
Unids hi5 system   slideshareUnids hi5 system   slideshare
Unids hi5 system slideshareJerry Looi
 
Vi forener Norden! Hva, hvem og hvorfor Foreningen Norden
Vi forener Norden! Hva, hvem og hvorfor Foreningen NordenVi forener Norden! Hva, hvem og hvorfor Foreningen Norden
Vi forener Norden! Hva, hvem og hvorfor Foreningen NordenRune Meier
 
Síndrome x frágil
Síndrome x frágilSíndrome x frágil
Síndrome x frágilpauly1991
 
PRESENTACIÖN PUESTAS DE SOL
PRESENTACIÖN PUESTAS DE SOLPRESENTACIÖN PUESTAS DE SOL
PRESENTACIÖN PUESTAS DE SOLguesta30e92
 
Estats De La MatèRia
Estats De La MatèRiaEstats De La MatèRia
Estats De La MatèRiagemmatena
 
Features: safely deploying your site
Features: safely deploying your siteFeatures: safely deploying your site
Features: safely deploying your siteJoão Ventura
 
Agradecimiento
AgradecimientoAgradecimiento
AgradecimientoESPEJO 25
 
Fotografías del Congreso
Fotografías del CongresoFotografías del Congreso
Fotografías del Congresomartarure
 
Senos O Gluteos
Senos O GluteosSenos O Gluteos
Senos O Gluteospolesu
 

En vedette (20)

Luta com crocodilo
Luta com crocodiloLuta com crocodilo
Luta com crocodilo
 
Festival de Harbin
Festival de HarbinFestival de Harbin
Festival de Harbin
 
2.2 Billion spent online, in 2013.
2.2 Billion spent online, in 2013.2.2 Billion spent online, in 2013.
2.2 Billion spent online, in 2013.
 
Sandpapir Nr. 39 1959
Sandpapir Nr. 39 1959Sandpapir Nr. 39 1959
Sandpapir Nr. 39 1959
 
Kisah nabi muhammad saw
Kisah nabi muhammad sawKisah nabi muhammad saw
Kisah nabi muhammad saw
 
Max weber
Max weberMax weber
Max weber
 
Module 3 lesson 5
Module 3 lesson 5Module 3 lesson 5
Module 3 lesson 5
 
Arti. opinion
Arti. opinionArti. opinion
Arti. opinion
 
New Copy Rights2
New Copy Rights2New Copy Rights2
New Copy Rights2
 
Unids hi5 system slideshare
Unids hi5 system   slideshareUnids hi5 system   slideshare
Unids hi5 system slideshare
 
Eliana 2
Eliana 2Eliana 2
Eliana 2
 
Vi forener Norden! Hva, hvem og hvorfor Foreningen Norden
Vi forener Norden! Hva, hvem og hvorfor Foreningen NordenVi forener Norden! Hva, hvem og hvorfor Foreningen Norden
Vi forener Norden! Hva, hvem og hvorfor Foreningen Norden
 
Pasen
PasenPasen
Pasen
 
Síndrome x frágil
Síndrome x frágilSíndrome x frágil
Síndrome x frágil
 
PRESENTACIÖN PUESTAS DE SOL
PRESENTACIÖN PUESTAS DE SOLPRESENTACIÖN PUESTAS DE SOL
PRESENTACIÖN PUESTAS DE SOL
 
Estats De La MatèRia
Estats De La MatèRiaEstats De La MatèRia
Estats De La MatèRia
 
Features: safely deploying your site
Features: safely deploying your siteFeatures: safely deploying your site
Features: safely deploying your site
 
Agradecimiento
AgradecimientoAgradecimiento
Agradecimiento
 
Fotografías del Congreso
Fotografías del CongresoFotografías del Congreso
Fotografías del Congreso
 
Senos O Gluteos
Senos O GluteosSenos O Gluteos
Senos O Gluteos
 

Similaire à 10 Computing

Lesson 27: Integration by Substitution (Section 041 slides)
Lesson 27: Integration by Substitution (Section 041 slides)Lesson 27: Integration by Substitution (Section 041 slides)
Lesson 27: Integration by Substitution (Section 041 slides)Matthew Leingang
 
Lesson 27: Integration by Substitution (Section 041 slides)
Lesson 27: Integration by Substitution (Section 041 slides)Lesson 27: Integration by Substitution (Section 041 slides)
Lesson 27: Integration by Substitution (Section 041 slides)Mel Anthony Pepito
 
Lesson 4: Calculating Limits (Section 21 slides)
Lesson 4: Calculating Limits (Section 21 slides)Lesson 4: Calculating Limits (Section 21 slides)
Lesson 4: Calculating Limits (Section 21 slides)Mel Anthony Pepito
 
Lesson 4: Calculating Limits (Section 21 slides)
Lesson 4: Calculating Limits (Section 21 slides)Lesson 4: Calculating Limits (Section 21 slides)
Lesson 4: Calculating Limits (Section 21 slides)Matthew Leingang
 
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)Matthew Leingang
 
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)Mel Anthony Pepito
 
Lesson 27: The Fundamental Theorem of Calculus
Lesson 27: The Fundamental Theorem of Calculus Lesson 27: The Fundamental Theorem of Calculus
Lesson 27: The Fundamental Theorem of Calculus Mel Anthony Pepito
 
Lesson 27: The Fundamental Theorem of Calculus
Lesson 27: The Fundamental Theorem of CalculusLesson 27: The Fundamental Theorem of Calculus
Lesson 27: The Fundamental Theorem of CalculusMatthew Leingang
 
Lesson 28: Integration by Subsitution
Lesson 28: Integration by SubsitutionLesson 28: Integration by Subsitution
Lesson 28: Integration by SubsitutionMel Anthony Pepito
 
Lesson 28: Integration by Subsitution
Lesson 28: Integration by SubsitutionLesson 28: Integration by Subsitution
Lesson 28: Integration by SubsitutionMatthew Leingang
 
Probability cheatsheet
Probability cheatsheetProbability cheatsheet
Probability cheatsheetSuvrat Mishra
 
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)Mel Anthony Pepito
 
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)Matthew Leingang
 

Similaire à 10 Computing (18)

10 Transformations
10 Transformations10 Transformations
10 Transformations
 
11 Simulation
11 Simulation11 Simulation
11 Simulation
 
12 Bivariate
12 Bivariate12 Bivariate
12 Bivariate
 
Lesson 27: Integration by Substitution (Section 041 slides)
Lesson 27: Integration by Substitution (Section 041 slides)Lesson 27: Integration by Substitution (Section 041 slides)
Lesson 27: Integration by Substitution (Section 041 slides)
 
Lesson 27: Integration by Substitution (Section 041 slides)
Lesson 27: Integration by Substitution (Section 041 slides)Lesson 27: Integration by Substitution (Section 041 slides)
Lesson 27: Integration by Substitution (Section 041 slides)
 
Lesson 4: Calculating Limits (Section 21 slides)
Lesson 4: Calculating Limits (Section 21 slides)Lesson 4: Calculating Limits (Section 21 slides)
Lesson 4: Calculating Limits (Section 21 slides)
 
Lesson 4: Calculating Limits (Section 21 slides)
Lesson 4: Calculating Limits (Section 21 slides)Lesson 4: Calculating Limits (Section 21 slides)
Lesson 4: Calculating Limits (Section 21 slides)
 
Lecture6.handout
Lecture6.handoutLecture6.handout
Lecture6.handout
 
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
 
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 021 slides)
 
Lesson 27: The Fundamental Theorem of Calculus
Lesson 27: The Fundamental Theorem of Calculus Lesson 27: The Fundamental Theorem of Calculus
Lesson 27: The Fundamental Theorem of Calculus
 
Lesson 27: The Fundamental Theorem of Calculus
Lesson 27: The Fundamental Theorem of CalculusLesson 27: The Fundamental Theorem of Calculus
Lesson 27: The Fundamental Theorem of Calculus
 
Lesson 28: Integration by Subsitution
Lesson 28: Integration by SubsitutionLesson 28: Integration by Subsitution
Lesson 28: Integration by Subsitution
 
Lesson 28: Integration by Subsitution
Lesson 28: Integration by SubsitutionLesson 28: Integration by Subsitution
Lesson 28: Integration by Subsitution
 
Probability Cheatsheet.pdf
Probability Cheatsheet.pdfProbability Cheatsheet.pdf
Probability Cheatsheet.pdf
 
Probability cheatsheet
Probability cheatsheetProbability cheatsheet
Probability cheatsheet
 
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
 
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
Lesson 26: The Fundamental Theorem of Calculus (Section 041 slides)
 

Plus de 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
 
17 polishing
17 polishing17 polishing
17 polishing
 
16 critique
16 critique16 critique
16 critique
 
15 time-space
15 time-space15 time-space
15 time-space
 
14 case-study
14 case-study14 case-study
14 case-study
 
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 Computing

  • 1. Quiz • Pick up quiz on your way in. • Start at 1pm • Finish at 1:10pm • Bonus: no homework this week. Homework help sessions -> review sessions. Tuesday, 16 February 2010
  • 2. Stat310 Transformations & CDF Hadley Wickham Tuesday, 16 February 2010
  • 3. 1. Transformations 2. CDF (again) 1. Exact computation 2. Tables Tuesday, 16 February 2010
  • 4. Transformations Distribution Change of function variable technique technique Much more useful for 2+ rvs Tuesday, 16 February 2010
  • 5. Remember: it’s the sample space that changes, not the probability Tuesday, 16 February 2010
  • 6. Distribution function technique Y = u(X) 1. Find region in X such that g(X) < y 2. Find cdf with integration 3. Find pdf by differentiating Tuesday, 16 February 2010
  • 7. Finish the proof X = Uniform(-1, 1) Y = X2 P(Y < y) = P(X2< y) = ... Tuesday, 16 February 2010
  • 8. Change of variables If Y = u(X), and v is the inverse of u, X = v(Y) then fY(y) = fX(v(y)) |v’(y)| Transformation must have an inverse! Tuesday, 16 February 2010
  • 9. Your turn X = Uniform(-1, 1) Y= X2 Can you use the change of variables technique here? Why/why not? If not, how could you modify X to make it possible? Tuesday, 16 February 2010
  • 10. Your turn X ~ Exponential(β) Y = exp(X) Find fY(y). Does y have a named distribution? Tuesday, 16 February 2010
  • 11. Relationship to uniform Important connection between the uniform and every other random variable through the cdf. Tuesday, 16 February 2010
  • 12. Uniform to any rv IF Y ~ Uniform(0, 1) F a cdf THEN X= F -1(Y) is a rv with cdf F(x) (Assume F strictly increasing for simplicity) Tuesday, 16 February 2010
  • 13. Any rv to uniform IF X has cdf F Y = F(X) THEN Y ~ Uniform(0, 1) (Assume F strictly increasing for simplicity) Tuesday, 16 February 2010
  • 15. F (x) = P (X ≤ x) discrete F (x) = f (t) tx x continuous F (x) = f (t)dt −∞ Tuesday, 16 February 2010
  • 16. f (x) Integrate Differentiate F(x) Tuesday, 16 February 2010
  • 17. lim F (x) = 0 x→−∞ lim F (x) = 1 x→∞ monotone increasing right-continuous Tuesday, 16 February 2010
  • 18. lim F (x) = 0 x→−∞ lim F (x) = 1 x→∞ monotone increasing right-continuous Tuesday, 16 February 2010
  • 19. Using the cdf P (a X ≤ b) = F (b) − F (a) Exact computation Tables Computer Tuesday, 16 February 2010
  • 20. Exact computation For some distributions we can write the cdf in closed form. For example: the exponential distribution has cdf: 1−e −λx , x ≥ 0, F (x; λ) = 0, x 0. Tuesday, 16 February 2010
  • 21. Exact computation Many, however cannot: http://en.wikipedia.org/wiki/ Binomial_distribution http://en.wikipedia.org/wiki/ Gamma_distribution integrate 1/(sqrt(2 pi)) e ^ (-t^2 / 2) from - infinity to x Tuesday, 16 February 2010
  • 22. Closed form Neither the CDF of the normal distribution nor erf can be expressed in terms of finite additions, subtractions, multiplications, and root extractions, and so both must be either computed numerically or otherwise approximated. i.e. can’t be expressed in closed form http://mathworld.wolfram.com/NormalDistribution.html Tuesday, 16 February 2010
  • 23. Two approaches Look up the number in a table. Problem: you need a table for every combination of the parametes Use a computer. Problem: you need a computer Tuesday, 16 February 2010
  • 25. Standard normal Fortunately, for the normal distribution, we can convert any random variable with a normal distribution to a standard normal. This means we only need one table for any possible normal distribution. (For other distributions there will be multiple tables, and typically you will have to pick one with similar values to your example). Tuesday, 16 February 2010
  • 26. P (Z z) = Φ(z) Φ(−z) = 1 − Φ(z) P (−1 Z 1) = 0.68 P (−2 Z 2) = 0.95 P (−3 Z 3) = 0.998 Tuesday, 16 February 2010
  • 27. Using the tables Column + row = z Find: Φ(2.94), Φ(-1), Φ(0.01), Φ(4) Can also use in reverse: For what value of z is P(Z z) = 0.90 ? i.e. What is Φ-1(0.90)? Find: Φ-1(0.1), Φ-1(0.5), Φ-1(0.65), Φ-1(1) Tuesday, 16 February 2010
  • 28. Next time Using the computer instead Generating random values and simulation Tuesday, 16 February 2010