Studio 3 18.05 Spring 2014 Jeremy Orloff and Jonathan Bloom - - PowerPoint PPT Presentation

studio 3 18 05 spring 2014 jeremy orloff and jonathan
SMART_READER_LITE
LIVE PREVIEW

Studio 3 18.05 Spring 2014 Jeremy Orloff and Jonathan Bloom - - PowerPoint PPT Presentation

Studio 3 18.05 Spring 2014 Jeremy Orloff and Jonathan Bloom frequency density 4 0.4 3 0.3 2 0.2 1 0.1 x x .5 1.5 2.5 3.5 4.5 .5 1.5 2.5 3.5 4.5 Concept questions Suppose X is a continuous random variable. a) What is P ( a X


slide-1
SLIDE 1

Studio 3 18.05 Spring 2014 Jeremy Orloff and Jonathan Bloom

x frequency .5 1.5 2.5 3.5 4.5 1 2 3 4 x density .5 1.5 2.5 3.5 4.5 0.1 0.2 0.3 0.4

slide-2
SLIDE 2

Concept questions Suppose X is a continuous random variable. a) What is P(a ≤ X ≤ a)? b) What is P(X = 0)? c) Does P(X = 2) = 0 mean X never equals 2?

answer: a) 0 b) 0 c) No. For a continuous distribution any single value has probability 0. Only a range of values has non-zero probability.

July 13, 2014 2 / 11

slide-3
SLIDE 3

Concept question

Which of the following are graphs of valid cumulative distribution functions? Add the numbers of the valid cdf’s and click that number.

answer: Test 2 and Test 3.

July 13, 2014 3 / 11

slide-4
SLIDE 4

Solution

Test 1 is not a cdf: it takes negative values, but probabilities are positive. Test 2 is a cdf: it increases from 0 to 1. Test 3 is a cdf: it increases from 0 to 1. Test 4 is not a cdf: it decreases. A cdf must be non-decreasing since it represents accumulated probability.

July 13, 2014 4 / 11

slide-5
SLIDE 5

Exponential Random Variables

Parameter: λ (called the rate parameter). Range: [0, ∞). Notation: exponential(λ) or exp(λ). Density: f (x) = λe−λx for 0 ≤ x. Models: Waiting time

x P(3 < X < 7) 2 4 6 8 10 12 14 16 .1 x F(x) = 1 − e−x/10 2 4 6 8 10 12 14 16 1

Continuous analogue of geometric distribution –memoryless!

July 13, 2014 5 / 11

slide-6
SLIDE 6

Uniform and Normal Random Variables

Uniform: U(a, b) or uniform(a, b) Range: [a, b] 1 PDF: f (x) = b − a Normal: N(µ, σ2) Range: (−∞, ∞] 1

−(x−µ)2/2σ2

PDF: f (x) = √ e σ 2π http://web.mit.edu/jorloff/www/18.05/applets/ probDistrib.html

July 13, 2014 6 / 11

slide-7
SLIDE 7

Table questions

Open the applet http://web.mit.edu/jorloff/www/18.05/applets/ probDistrib.html

  • 1. For the standard normal distribution N(0, 1) how much

probability is within 1 of the mean? Within 2? Within 3?

  • 2. For N(0, 32) how much probability is within σ of the mean?

Within 2σ? Within 3σ.

  • 3. Does changing µ change your answer to problem 2?

July 13, 2014 7 / 11

slide-8
SLIDE 8

Normal probabilities

z −σ σ −2σ 2σ −3σ 3σ Normal PDF within 1 · σ ≈ 68% within 2 · σ ≈ 95% within 3 · σ ≈ 99% 68% 95% 99%

Rules of thumb: P(−1 ≤ Z ≤ 1) ≈ .68, P(−2 ≤ Z ≤ 2) ≈ .95, P(−3 ≤ Z ≤ 3) ≈ .997

July 13, 2014 8 / 11

slide-9
SLIDE 9

Download R script

Download studio3.zip and unzip it into your 18.05 working directory. Open studio3.r in RStudio.

July 13, 2014 9 / 11

slide-10
SLIDE 10

Histograms

Will discuss in more detail in class 6. Made by ‘binning’ data. Frequency: height of bar over bin = # of data points in bin. Density: area of bar over bin is proportional to # of data points in

  • bin. Total area of a density histogram is 1.

x frequency .5 1.5 2.5 3.5 4.5 1 2 3 4 x density .5 1.5 2.5 3.5 4.5 0.1 0.2 0.3 0.4

July 13, 2014 10 / 11

slide-11
SLIDE 11

Histograms of averages of exp(1)

  • 1. Generate a frequency histogram of 1000 samples from an exp(1)

random variable.

  • 2. Generate a density histogram for the average of 2 independent

exp(1) random variable.

  • 3. Using rexp(), matrix() and colMeans() generate a density

histogram for the average of 50 independent exp(1) random variables. Make 10000 sample averages and use a binwidth of .1 for this. Look at the spread of the histogram.

  • 4. Superimpose a graph of the pdf of N(1, 1/50) on your plot in

problem 3. (Remember the second parameter in N is σ2.)

Code for the solutions is at http://web.mit.edu/jorloff/www/18.05/r-code/studio3-sol.r

July 13, 2014 11 / 11

slide-12
SLIDE 12