11-02 Cont Random Variables (2)

11-02 Cont Random Variables (2) - BTRY 4080 STSCI 4080 Fall...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
BTRY 4080 / STSCI 4080 Fall 2010 258 Section 5.3: Uniform Random Variables Definition: X is a uniform random variable on the interval ( a,b ) if its probability density function is given by f ( x ) = 1 b a if a < x < b 0 otherwise Useful shorthand: f ( x ) = 1 b a I { x ( a,b ) } . Denote X Uniform ( a,b ) , or simply X U ( a,b ) . Parameters are a,b .
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
BTRY 4080 / STSCI 4080 Fall 2010 259 Cumulative distribution function F ( x ) = 0 if x a x a b a if a < x < b 1 if x b If X U (0 , 1) , then F ( x ) = x (i.e., if 0 x 1 ) Mean & Variance E ( X ) = a + b 2 , V ar ( X ) = ( b a ) 2 12
Image of page 2
BTRY 4080 / STSCI 4080 Fall 2010 260 Example (Monte Carlo integration, Slides 19-21): Let g ( x ) be (almost) any function defined on the interval [ a,b ] , where a,b are finite. Suppose we wish to compute the integral I = integraldisplay b a g ( u ) du. For example: g ( u ) = sin 2 ( u ) , a = 0 , b = 2 π ; alternatively, g ( u ) = 1 2 π e u 2 / 2 , a = 1 . 645 , b = 1 . 645 . By Proposition 2.1: we can write I = integraldisplay b a g ( u ) du = ( b a ) integraldisplay b a g ( u ) × 1 ( b a ) du = ( b a ) E [ g ( U )] where U Uniform ( a,b ) . Hence, one can compute I by computing the expectation of g ( U ) , a transformed U ( a,b ) random variable.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
BTRY 4080 / STSCI 4080 Fall 2010 261 In fact: can approximate the value of I by simulating random numbers from a U ( a,b ) ; this is an example of Monte Carlo integration . General algorithm: 1. Generate a random sample of uniform random numbers, say u 1 ...u n , on the interval [ a,b ] 2. Compute y i = g ( u i ) for i = 1 ...n 3. Compute ¯ y as an approximation to E [ Y ] = E [ g ( U )] 4. Compute ˆ I = ( b a y .
Image of page 4
BTRY 4080 / STSCI 4080 Fall 2010 262 An example (reviewed): A fact from trigonometry: I = integraldisplay π/ 2 0 cos xdx = sin parenleftBig π 2 parenrightBig = 1 . Here, and proceeding differently from Slides 19-20: Take g ( x ) = cos( x ) Randomly generate a large number of points between 0 and 1 2 π . Suppose I do this n times, getting the random numbers x 1 ...x n . Compute y i = cos( x i ) for i = 1 , 2 ,...n. Compute hatwide I = π 2 ¯ y .
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
BTRY 4080 / STSCI 4080 Fall 2010 263 In R: the runif(n,a,b) function generates n numbers at random from the interval ( a,b ) . Usage for n = 1000, 100000: > x = runif(1000, 0, pi/2) > y = pi/2 * cos(x) > mean(y) [1] 0.9977134 > x = runif(1000, 0, pi/2) > y = pi/2 * cos(x) > mean(y) [1] 0.9771091 > x = runif(100000, 0, pi/2) > y = pi/2 * cos(x) > mean(y) [1] 0.9991868 > x = runif(100000, 0, pi/2) > y = pi/2 * cos(x) > mean(y) [1] 0.9975812 Food for thought: is it possible to use probability theory to choose n ?
Image of page 6
BTRY 4080 / STSCI 4080 Fall 2010 264 Section 5.4: Normal Random Variables Definition: X is a normal random variable, X N ( μ,σ 2 ) , if it has pdf given by f ( x ) = 1 σ 2 π e ( x - μ ) 2 2 σ 2 , −∞ < x < Cumulative distribution function (parameters: μ,σ 2 ): F ( x ) = integraltext x −∞ f ( u ) du Mean & Variance: E ( X ) = μ , V ar ( X ) = σ 2
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
BTRY 4080 / STSCI 4080 Fall 2010 265
Image of page 8
BTRY 4080 / STSCI 4080 Fall 2010 266 PDF is classical “bell-shaped” curve. Derived by French mathematician Abraham DeMoivre in 1733 as a way to approximate symmetric binomial probabilities (i.e., p = 1 / 2 ; well before Poisson in 1838!); generalized to arbitrary p by Pierre-Simon Laplace (1812).
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern