Agenda Course 02402 Introduction to Statistics 1 Stochastic - - PowerPoint PPT Presentation

agenda course 02402 introduction to statistics
SMART_READER_LITE
LIVE PREVIEW

Agenda Course 02402 Introduction to Statistics 1 Stochastic - - PowerPoint PPT Presentation

Agenda Course 02402 Introduction to Statistics 1 Stochastic Variables and Distributions The definition of a Stochastic Variable Lecture 2: Discrete Distributions Density function The distribution function 2 Specific Statistical distributions


slide-1
SLIDE 1

Course 02402 Introduction to Statistics Lecture 2: Discrete Distributions Per Bruun Brockhoff

DTU Informatics Building 305 - room 110 Danish Technical University 2800 Lyngby – Denmark e-mail: pbb@imm.dtu.dk

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 1 / 38

Agenda

1 Stochastic Variables and Distributions

The definition of a Stochastic Variable Density function The distribution function

2 Specific Statistical distributions

The Binomial distribution

Example 1

The hypergeometric distribution

Example 2

The Poisson distribution

Example 3

3 Mean and Variance

Mean values and variances of some known discrete distributions

4 R (R Note section 3 )

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 2 / 38 Stochastic Variables and Distributions The definition of a Stochastic Variable

Stochastic Variables A stochastic variable, what is that? Stochastic variables are written with capital letters, e.g. X, Y, Z The outcome of a stochastic variable is written with the corresponding lower case letters. x, y, z We differ between discrete and continuous stochastic variables

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 4 / 38 Stochastic Variables and Distributions The definition of a Stochastic Variable

From Chapter 3: The classical concept of probability is defined as: If there are n are equally likely possibilities, of which one must occur and s are regarded as favorable, or as a ’success’, then the probability of a "success" is given by: s n s=number of favorable outcomes n=number of possible

  • utcomes

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 5 / 38

slide-2
SLIDE 2

Stochastic Variables and Distributions Density function

Density function The Density function of a stochastic variable is denoted by f(x) We often call it a frequency function or f(x) tells something about the frequency of the

  • utcome x for the stochastic variable X

A good plot of f(x) is a bar chart (discrete) or a histogram (continuous)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 6 / 38 Stochastic Variables and Distributions Density function

The density function for a discrete variable For a discrete variable the density function can be written as: f(x) = P(X = x) where: f(x) > 0 for x ∈ S f(x) = 0 for x ∈ S

  • f(x) = 1

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 7 / 38 Stochastic Variables and Distributions The distribution function

The distribution function The distribution function for a stochastic variable is denoted by F(x). The distribution function is equal to the cumulative density function: F(x) = P(X ≤ x) F(x) =

x

  • t=−∞

f(t)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 8 / 38 Specific Statistical distributions

Specific Statistical distributions A number of statistical distributions exists that can be used to describe and analyse different kind of problems First we consider discrete distributions

The binomial distribution The hypergeometric distribution The Poisson distribution

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 10 / 38

slide-3
SLIDE 3

Specific Statistical distributions The Binomial distribution

The Binomial distribution We consider n independent trials, where n is a constant In every trial the outcome be either success or failure The probability of success p (same for all n trials)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 11 / 38 Specific Statistical distributions The Binomial distribution

The binomial distribution We say that a stochastic variable, X, follows a binomial distribution X ∼ b(x; n, p) The density function for the binomial distribution: f(x) = P(X = x) = n x

  • px(1 − p)n−x

The distribution function for the binomial distribution: F(x) = P(X ≤ x) table 1, page 505 (7ed: 576) (6ed: 565) → The distribution function F(x) = P(X ≤ x) is written as B(x; n, p)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 12 / 38 Specific Statistical distributions The Binomial distribution

The binomial distribution The binomial distribution is also used to analyse samples with replacement The hypergeometric distribution is used to analyse samples without replacement

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 13 / 38 Specific Statistical distributions The Binomial distribution

Example 1 In a call center in a phone company the costumer satisfaction is an issue. It is especially important that when errors/faults occur, then they are corrected within the same day. Assume that the probability of an error being corrected within the same is p = 0.7.

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 14 / 38

slide-4
SLIDE 4

Specific Statistical distributions The Binomial distribution

Example 1 During a day, 6 errors are reported. What is the probability that all of the errors are corrected within the same day?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 15 / 38 Specific Statistical distributions The Binomial distribution

Example 1 What is the probability that at most one of the errors is corrected within the same day?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 16 / 38 Specific Statistical distributions The Binomial distribution

Example 2 In a shipment of 15 hard disks five of them have smal scrathes. A random sample of 3 hard disks is taken. What is the probability that 1 of them has scratches?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 17 / 38 Specific Statistical distributions The hypergeometric distribution

The hypergeometric distribution We consider: A population of size N We take a sample of size n There are a defective population There are N − a none-defective in the population

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 18 / 38

slide-5
SLIDE 5

Specific Statistical distributions The hypergeometric distribution

The hypergeometric distribution We say that a stochastic variable, X, follows a hypergeometric distribution X ∼ h(x; n, a, N) The density function for the hypergeometric distribution is f(x) = P(X = x) = a x N − a n − x

  • N

n

  • Per Bruun Brockhoff (pbb@imm.dtu.dk)

Introduction to Statistics, Lecture 2 Fall 2012 19 / 38 Specific Statistical distributions The hypergeometric distribution

The hypergeometric distribution The hypergeometric distribution can be approximated by the binomial distribution if the population N is big and the sample n is small

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 20 / 38 Specific Statistical distributions The hypergeometric distribution

Example 2 In a shipment of 15 hard disks five of them have smal scrathes. A random sample of 3 hard disks is taken. What is the probability that 1 of them has scratches?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 21 / 38 Specific Statistical distributions The hypergeometric distribution

Example 3 Assume that on average 0.3 patients per day are put in hospital in Copenhagen due to air pollution What is the probability that at most two patients are put in hospital in Copenhagen due to air pollution on a given day?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 22 / 38

slide-6
SLIDE 6

Specific Statistical distributions The Poisson distribution

The Poisson distribution The Poisson distribution is often use as distribution (model) for counts which do not have a natural upper bound The Poisson distribution is often characterized as intensity, that is on the form number/unit The parameter λ gives the gives the intensity in the Poisson distribution

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 23 / 38 Specific Statistical distributions The Poisson distribution

The Poisson distribution X ∼ P(λ) The density function: f(x) = P(X = x) = λx

x! e−λ

The distribution function: F(x) = P(X ≤ x) table 2, page 510 (7ed: 581) (6ed: 570)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 24 / 38 Specific Statistical distributions The Poisson distribution

Example 3 Assume that on average 0.3 patients per day are put in hospital in Copenhagen due to air pollution What is the probability that at most two patients are put in hospital in Copenhagen due to air pollution on a given day?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 25 / 38 Specific Statistical distributions The Poisson distribution

Example 3 What is the probability that exactly two patients are put in hospital in Copenhagen due to air pollution on a given day?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 26 / 38

slide-7
SLIDE 7

Specific Statistical distributions The Poisson distribution

Example 3 What is the probability that at least 1 patient is put in hospital in Copenhagen due to air pollution on a given day?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 27 / 38 Specific Statistical distributions The Poisson distribution

Example 3 What is the probability that at most 1 patient is put in hospital in Copenhagen due to air pollution with 3 days?

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 28 / 38 Mean and Variance

The mean value of a discrete stochastic variable The mean value of a discrete stochastic variable is written as: µ =

  • S

x · f(x) where S is the sample space for X

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 30 / 38 Mean and Variance

The variance of a discrete stochastic variable The variance of a discrete stochastic variable is written as: σ2 =

  • S

(x − µ)2 · f(x) where S is the sample space for X

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 31 / 38

slide-8
SLIDE 8

Mean and Variance Mean values and variances of some known discrete distributions

Mean values and variances of some known discrete distributions The binomial distribution: Mean value: µ = n · p Variance: σ2 = n · p · (1 − p)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 32 / 38 Mean and Variance Mean values and variances of some known discrete distributions

Mean values and variances of some known discrete distributions The hypergeometric distribution: Mean value: µ = n · a

N

Variance: σ2 = na·(N−a)·(N−n)

N 2·(N−1)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 33 / 38 Mean and Variance Mean values and variances of some known discrete distributions

Mean vales and variances of some known discrete distributions The Poisson distribution Mean value: µ = λ Variance: σ2 = λ

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 34 / 38 R (R Note section 3 )

R (R Note section 3)

R Distribution binom Binomial pois Poisson d The density function f(x) (probability distribution). p The distribution function F(x) (cumulative distribution function). r Random number from the distribution. (More in Lecture 10) q Fractile (quantile) from distribution Example: B(5; 10, 0.6) pbinom(5,10,0.6)

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 36 / 38

slide-9
SLIDE 9

R (R Note section 3 )

Agenda

1 Stochastic Variables and Distributions

The definition of a Stochastic Variable Density function The distribution function

2 Specific Statistical distributions

The Binomial distribution

Example 1

The hypergeometric distribution

Example 2

The Poisson distribution

Example 3

3 Mean and Variance

Mean values and variances of some known discrete distributions

4 R (R Note section 3 )

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 37 / 38 R (R Note section 3 )

Next week Chapter 5 - Continuous distributions

Per Bruun Brockhoff (pbb@imm.dtu.dk) Introduction to Statistics, Lecture 2 Fall 2012 38 / 38