1 Some probabilistic models

Most common discrete random variables Bernoulli trials

Most common continuous random variables Uniform distribution Central Limit Theorem

Other distributions related to the Normal (Chapter 4. Introduction to statistical inference)

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

2 Bernoulli trials Description / Definition It is a way to model statistically any experiment that has only two possible results , mutually exclusive, that they are called and failure , with the condition that the of these two results does not change each time the experiment is carried out.(Bernoulli trials or experiments). If the probability of success is p (therefore, of failure is 1 p), the Bernoulli is defined as − 1, if a success is observed , X =  0, if a failure is observed .

Support of X : S = 0, 1 , with P(X = 0) = 1 p = q, P(X = 1) = p. { } − To denote that X follows a with parameter p we write X Ber (p). ∼ I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 3 Bernoulli trials

Example Result of tossing a coin

1, if heads , X =  0, if tails .

It is Bernoulli trial, where as success we consider the heads. X follows a Bernoulli distribution with parameter 1 /2 (if the coin is fair). Example An airline has determined that the passengers that purchase tickets for a given flight have probability 0 .05 of not showing up at the airport We define 1 if the passenger shows up Y =  0 if he/she does not show up Y follows a Bernoulli distribution with parameter 0 .95

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

4 Bernoulli trials

Probability function:

P(X = 0) = 1 p P (X = 1) = p − Distribution function: 8 < 0, if x < 0 − ≤ F (x) = : 1 p, if 0 x < 1 1, if x ≥ 1

Properties E(X ) = 0 P(X = 0) + 1 P(X = 1) = 0 (1 p) + 1 p = p − E(X 2) = 0 2 P(X = 0) + 1 2 P(X = 1) = 0 2 (1 p) + 1 2 p = p − V (X ) = E(X 2) E(X )2 = p p2 = p(1 p) = pq − − −

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 5 Binomial Distribution

Description / Definition Consider independent Bernoulli trials that they are repeated n times with the same probability of success p. The r.v. X that counts the number of observed successes in the n trials is said to follow a Binomial distribution with parameters n and p and we write X B(n, p). ∼ The r.v. X takes values in S = 0, 1, 2,..., n and its probability function is given by the formula { }

n x n−x P(X = x) = p (1 p) , x = 0 , 1,..., n, 0 p 1, x  − ≤ ≤ n where = n! , for 0 x n. Recall that, for convenience, 0! = 1. x x!( n−x)! ≤ ≤  Properties E(X ) = np , V (X ) = np (1 p) = npq . −

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

6 Binomial Distribution

Example The airline in the preceding example has sold 80 tickets for a given flight. The probability of a passenger not showing up is equal to 0 .05. Define X = number of passengers that show up . Then (assuming independence)

X B(80 , 0.95) ∼

The probability that all 80 passengers show up is

80 − P(X = 80) = 0.95 80 (1 0.95)80 80 = 0 .0165 80  × −

The probability that at least one passenger does not show up is

P(X < 80) = 1 P(X = 80) = 1 0.0165 = 0 .9835 − −

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 7 Binomial Distribution: probability function

The probability function of X B(80 , 0.95) is ∼

Binomial Distribution: Trials = 80, Probability of success = 0.95 Probability Mass 0.00 0.05 0.10 0.15 0.20

68 70 72 74 76 78 80

Number of Successes

Changing the probability of success:

Binomial Distribution: Trials = 80, Probability of success = 0.5 Binomial Distribution: Trials = 80, Probability of success = 0.1 Probability Mass Probability Mass 0.00 0.05 0.10 0.15 0.00 0.02 0.04 0.06 0.08

25 30 35 40 45 50 55 5 10 15

Number of Successes Number of Successes

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

8 Poisson distribution: counting rare events Description / Definition Counts the number of rare events that take place in a given period of time, or in a predefined space. For example, number of phone calls in an hour, number of typos in a page, number of traffic accidents in a week, . . . A random variable X follows a Poisson distribution with parameter λ, it is denoted X Pois (λ), if its probability function is ∼ x −λ λ P(X = x) = e , para x = 0 , 1, 2,... x! Observe that X takes values in S = 0, 1, 2,... = N 0 . { } ∪ { } Properties E(X ) = λ, V (X ) = λ. λ represents the mean number of events that occur per time or space unit. Exponencial Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 9 Poisson distribution: counting rare events

Property of Poisson If X Pois (λ) and represents the number of rare events in time or space unit,∼ and Y is a r.v. that represents the number of these rare events in s units , then: Y Pois (sλ) ∼

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

10 Poisson distribution: counting rare events Example The mean number of typos per slide is 0.2. Let X the r.v. that counts the number of typos per slide, then

X Pois (0 .2) ∼ What is the probability that in one slide there are no typos?

0 − . 0.2 − . P(X = 0) = e 0 2 = e 0 2 = 0 .8187. 0! What is the probability that in 4 slides there is exactly one typos? Let Y the r.v. that counts the number of typos in 4 slides. Then:

Y Pois (0 .2 4) = Pois (0 .8) ∼ 1 · − . 0.8 − . P(Y = 1) = e 0 8 = e 0 8 0.8 = 0 .3595. 1!

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 11 Uniform Distribution

Description / Definition It is said that a variable X follows a uniform distribution in the interval (a, b), and it is denoted by X (a, b), if its density function is ∼ U 1 , if x (a, b), f (x) = b−a ∈  0, if x / (a, b). ∈

This r.v. is defined by its minimum and maximum values, that is, a and b are its parameters. Properties a+b (b−a)2 E(X ) = 2 , V (X ) = 12 .

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

12 Uniform Distribution

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 13 Exponential distribution

Description / Definition The exponential distribution models the elapsed time between two events that occur independently, separately and uniformly in time. It is said the the r.v. X follows a exponential distribution with parameter λ, and it is denoted by X exp (λ), if its density function is ∼ −λx f (x) = λ e , para x 0. ≥

Observe that X takes values in the set S = [0 , + ). ∞ Examples Time between the arrivals of two trucks at a discharge point. Time between emergency calls. Lifetime of a light bulb.

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

14 Exponential distribution

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 15 Exponential distribution

Properties

1 E(X ) = λ 1 V (X ) = λ2 Distribution funcion: 1 e−λx , if x 0, F (x) = − ≥  0, if x < 0.

The exponential is related to the Poisson distribution. Poisson λ is the number of occurrences of an event per unit of time.

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

16 Exponential distribution Example On average, there are 50 serious house fires each year in a specific area. We know that the number of fires each year follows a Poisson distribution.

What is the mean time between two fires? If a fire has just taken place, what is the probability that the next fire occurs after two weeks? We know that: The number of fires N (λ) with λ = 50 . ∼ P The time between two fires X (λ) with λ = 50 . ∼ E 1 The average time between two fires E[X ] = λ = 1 /50 years, 7.3 days. 2 Two weeks expressed as a fraction of years is: 52 = 0 .038 P[X > 0.038] = 1 P[X 0.038] = 1 (1 e−50 ·0.038 ) = 0 .15 − ≤ − − Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 17 Normal distribution

Description / Definition The normal distribution describes an ideal r.v. It is a theoretical model that approximates very well real situations. The statistical inference is fundamentally based on the normal distribution and on distributions that are derived from the normal. It is said that a r.v. X follows a normal distribution or gaussian with parameters µ and σ, and it is denoted by X (µ, σ ), if its density function is ∼ N 1 1 f (x) = exp (x µ)2 σ √2 π −2 σ2 − 

Properties E(X ) = µ, V (X ) = σ2.

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

18 Normal distribution

Density function for 3 different values of µ and σ.

5 5 5 5

5 ^5_ 5 ^ 5_ 5 ^5 _ 5 5  R R R R5   

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 19 Normal distribution

Property If X (µ, σ ), then: ∼ N P(µ σ < X < µ + σ) 0.683 − ≈ P(µ 2σ < X < µ + 2 σ) 0.955 − ≈ P(µ 3σ < X < µ + 3 σ) 0.997 − ≈

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

20 Normal distribution

Linear transformation

Y = a + b X (a + bµ, b σ) ∼ N | | Standardization or Typification If X (µ, σ ), we consider ∼ N X µ Z = − (0 , 1) σ ∼ N It is called Standard normal distribution .

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 21 Normal distribution: Example Let Z N(0 , 1). We calculate some probabilities: ∼ P(Z < 1.5) = 0 .9332 = DISTR.NORM(1.5;0;1;VERDADERO)

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

22 Normal distribution: Example (cont.)

P(Z > 1.5) = P(Z < 1.5) = 0 .9332 ¿why? − P(Z < 1.5) = P(Z > 1.5) = 1 P(Z < 1.5) = − − = 1 0.9332 = 0 .0668 ¿why not ? − ≤

P( 1.5 < Z < 1.5) = P(Z < 1.5) P(Z < 1.5) = − − − = DISTR.NORM(1.5;0;1;VERDADERO) DISTR.NORM(-1.5;0;1;VERDADERO) − = 0 .9332 0.0668 = 0 .8664 −

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 23 Normal distribution: Example

Let X N(µ = 2 , σ = 3). To calculate the P(X < 4), if we don’t have a computer,∼ we have to go to the tables of the standard normal distribution. To this end, we standardize the original variable:

X 2 4 2 P(X < 4) = P − < − = P Z < 0.66 6˙ 0.7454  3 3  ≈  where Z N(0 , 1) ∼ What is P( 1 < X < 3.5)? − P( 1 < X < 3.5) = P( 1 2 < X 2 < 3.5 2) = − − − − − 1 2 X 2 3.5 2 P − − < − < − = P( 1 < Z < 0.5) =  3 3 3  − P(Z < 0.5) P(Z < 1) = 0 .6915 0.1587 = 0 .5328 − − − where Z N(0 , 1) ∼

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

24 Normal distribution: Example (cont.)

Let X N(µ = 2 , σ = 3). If we use Excel we don’t have to standardize X . Directly∼ we calculate

P(X < 4) = DISTR.NORM(4;2;3;VERDADERO) = 0 .7475

P( 1 < X < 3.5) = P(X < 3.5) P(X < 1) = − − − = DISTR.NORM(3.5;2;3;VERDADERO) DISTR.NORM(-1;2;3;VERDADERO) = − = 0 .6915 0.1587 = 0 .5328 −

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 25 Normal distribution: another example

It is difficult to label packed meet with its correct weight given that it loses liquid. We define the “loss of liquid” as the percentage of weight lost relative to the original weight of the meat. Suppose that the loss of liquid is distributed normally with mean 4% and standard deviation of 1%. Let X be the loss of liquid of one randomly selected package of beef. What is the probability that 3% < X < 5%? What is the value of x for which 90% of the packages have lost less than x liquid? In a sample of 4 packages, what is the probability that all 4 packages have lost between 3 and 5% of their weight?

Sexauer, B. (1980) Drained-Weight Labelling for Meat and Poultry: An Economic Analysis of a Regulatory Proposal , Journal of Consumer Affairs, 14, 307-325.

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

26 Normal distribution: another example (cont.)

The r.v. X follows a distribution N(4 , 1). Then:

P(3 < X < 5) = P(X < 5) P(X < 3) = − = DISTR.NORM(5;4;1;VERDADERO) DISTR.NORM(3;4;1;VERDADERO) = − = 0 .8413 0.1587 = 0 .6827 −

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 27 Normal distribution: another example (cont.)

We want to find the value x0 such that P(X < x0) = 0 .9. We have to calculate the inverse function of the distribution of X . In Excel

x0 = DISTR.NORM.INV(0,9;4;1) = 5 .2816 Conclusion: 90% of the packages have lost less than x = 5 .28% weight.

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

28 Normal distribution: another example (cont.)

All the normal probabilities above can be obtained using the standard normal as follows.

3 4 X 4 5 4 P(3 < X < 5) = P − < − < − = P( 1 < Z < 1)  1 1 1  − = P(Z < 1) P(Z < 1) = 0 .8413 0.1587 = 0 .6827 − − − We want P(X < x) = 0 .9. Then

X 4 x 4 P − < − = P(Z < x 4) = 0 .9  1 1  −

Looking at the tables, we have x 4 1.28 Which implies that a 90% of the packages have lost less than x−=≈ 5 .28% weight.

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 29 Normal distribution: another example (cont.)

binomial

Y = number of packages in the sample that have lost between 3% and 5%. Y B(4 , p), where ∼ p = P(´exito) = P(p´erdida de peso entre 3% y 5%) = P(3 < X < 5) = 0 .6827

Then, 4 P(Y = 4) = 0.68274(1 0.6827)4 = 0 .2172  4  −

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

30 Central Limit Theorem (CLT)

The following theorem refers to the distribution of the mean of a set of independent and identically distributed (i.i.d.) r.v., that is they all have the same distribution, n 1 X¯ = Xi n Xi=1 and states that, for large n, the mean of iid r.v. follows (approximately) a normal distribution, independently of the distribution of the r.v. Therem Let X1, X2,..., Xn i.i.d. r.v. with mean µ and standard deviation σ (both finite). If n is sufficiently llarge, it holds that

X¯ µ − (0 , 1) σ/ √n ∼ N

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1 31 Approximations

Binomial (Theorem De Moivre-Laplace) If X B(n, p) with n sufficiently large ∼ X np − (0 , 1) np (1 p) ∼ N − p Poisson If X Pois (λ) with λ sufficiently large ∼ X λ − (0 , 1) √λ ∼ N

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1

32 CLT and approximations: Example Let X B(100 , 1/3). Estimate P(X < 40). ∼ binomial propiedades

First we calculate the mean and the variance of X . 1 E(X ) = 100 = 33 .3˙ × 3 1 2 Var (X ) = 100 = 22 .2˙ × 3 × 3 S.D.(X ) = 22 .2˙ = 4 .714 p We use the normal approximation

X 33 .3˙ 40 33 .3˙ P(X < 40) = P − < −  4.714 4.714  P (Z < 1.414) 0.921, ≈ ≈ donde Z N(0 , 1). ∼

Statistics I. ECO/ Double courses ECO-DER and ADE-INF 2010/11 Chapter 1