Lab 3. Continuous Random Variables Objectives ˆ Continuous distributions in R: exponential, Γ, and χ2 ˆ Related statistics, properties, and simulation

Uniform random variable – Continuous Case X ∼ uniform (a, b) Then, f (x) = µ=

1 , b−a

a+b , 2

a≤x≤b σ2 =

(b − a)2 12

Z b 1 1 b2 − a2 a+b x dx = · = b−a a b−a 2 2 a Z b Z b 1 b3 − a3 a2 + ab + b2 1 x2 dx = · = E(X 2 ) = x2 · f (x) dx = b−a a b−a 3 3 a   a2 + ab + b2 a + b 2 (b − a)2 σ 2 = E(X 2 ) − {E(X)}2 = − = 3 2 12 Z

µ = E(X) =

b

x · f (x) dx =

Statistics programs including R generate uniform random numbers between 0 and 1, by default. You can ask for uniform random numbers between 5 and 10, for example. Here is how to simulate continuous uniform random numbers. x