1 of 101

PSLP

4rd SEMESTER

BS-202

Department of Applied Science, BVCOE New Delhi Subject: PSLP

1

2 of 101

UNIT-2

Department of Applied Science, BVCOE New Delhi Subject: PSLP

2

3 of 101

Moment Generating Functions

Department of Applied Science, BVCOE New Delhi Subject: PSLP

3

4 of 101

Continuous Distributions

The Uniform distribution from a to b

Department of Applied Science, BVCOE New Delhi Subject: PSLP

4

5 of 101

The Normal distribution �(mean μ, standard deviation σ)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

5

6 of 101

The Exponential distribution

Department of Applied Science, BVCOE New Delhi Subject: PSLP

6

7 of 101

Weibull distribution with parameters α and β.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

7

8 of 101

The Weibull density, f(x)

(α = 0.5, β = 2)

(α = 0.7, β = 2)

(α = 0.9, β = 2)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

8

9 of 101

The Gamma distribution

Let the continuous random variable X have density function:

Then X is said to have a Gamma distribution with parameters α and λ.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

9

10 of 101

Expectation of functions of Random Variables

Department of Applied Science, BVCOE New Delhi Subject: PSLP

10

11 of 101

X is discrete

X is continuous

Department of Applied Science, BVCOE New Delhi Subject: PSLP

11

12 of 101

Moments of Random Variables

Department of Applied Science, BVCOE New Delhi Subject: PSLP

12

13 of 101

The kth moment of X.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

13

14 of 101

the kth central moment of X

where μ = μ1 = E(X) = the first moment of X .

Department of Applied Science, BVCOE New Delhi Subject: PSLP

14

15 of 101

Some Rules:

Department of Applied Science, BVCOE New Delhi Subject: PSLP

15

16 of 101

Moment generating functions

Department of Applied Science, BVCOE New Delhi Subject: PSLP

16

17 of 101

Moment Generating function of a R.V. X

Department of Applied Science, BVCOE New Delhi Subject: PSLP

17

18 of 101

Examples

  1. The Binomial distribution (parameters p, n)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

18

19 of 101

The moment generating function of X , mX(t) is:

  1. The Poisson distribution (parameter λ)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

19

20 of 101

The moment generating function of X , mX(t) is:

  1. The Exponential distribution (parameter λ)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

20

21 of 101

The moment generating function of X , mX(t) is:

  1. The Standard Normal distribution (μ = 0, σ = 1)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

21

22 of 101

We will now use the fact that

We have completed the square

This is 1

Department of Applied Science, BVCOE New Delhi Subject: PSLP

22

23 of 101

The moment generating function of X , mX(t) is:

  1. The Gamma distribution (parameters α, λ)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

23

24 of 101

We use the fact

Equal to 1

Department of Applied Science, BVCOE New Delhi Subject: PSLP

24

25 of 101

Properties of� Moment Generating Functions

Department of Applied Science, BVCOE New Delhi Subject: PSLP

25

26 of 101

  1. mX(0) = 1

Note: the moment generating functions of the following distributions satisfy the property mX(0) = 1

Department of Applied Science, BVCOE New Delhi Subject: PSLP

26

27 of 101

We use the expansion of the exponential function:

Department of Applied Science, BVCOE New Delhi Subject: PSLP

27

28 of 101

Now

Department of Applied Science, BVCOE New Delhi Subject: PSLP

28

29 of 101

Property 3 is very useful in determining the moments of a random variable X.

Examples

Department of Applied Science, BVCOE New Delhi Subject: PSLP

29

30 of 101

Department of Applied Science, BVCOE New Delhi Subject: PSLP

30

31 of 101

To find the moments we set t = 0.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

31

32 of 101

Department of Applied Science, BVCOE New Delhi Subject: PSLP

32

33 of 101

Department of Applied Science, BVCOE New Delhi Subject: PSLP

33

34 of 101

The moments for the exponential distribution can be calculated in an alternative way. This is note by expanding mX(t) in powers of t and equating the coefficients of tk to the coefficients in:

Equating the coefficients of tk we get:

Department of Applied Science, BVCOE New Delhi Subject: PSLP

34

35 of 101

The moments for the standard normal distribution

We use the expansion of eu.

We now equate the coefficients tk in:

Department of Applied Science, BVCOE New Delhi Subject: PSLP

35

36 of 101

If k is odd: μk = 0.

For even 2k:

Department of Applied Science, BVCOE New Delhi Subject: PSLP

36

37 of 101

Summary

Moments

Moment generating functions

Department of Applied Science, BVCOE New Delhi Subject: PSLP

37

38 of 101

Moments of Random Variables

The moment generating function

Department of Applied Science, BVCOE New Delhi Subject: PSLP

38

39 of 101

Examples

  1. The Binomial distribution (parameters p, n)
  1. The Poisson distribution (parameter λ)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

39

40 of 101

  1. The Exponential distribution (parameter λ)
  1. The Standard Normal distribution (μ = 0, σ = 1)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

40

41 of 101

  1. The Gamma distribution (parameters α, λ)
  1. The Chi-square distribution (degrees of freedom ν)

(α = ν/2, λ = 1/2)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

41

42 of 101

  1. mX(0) = 1

Properties of Moment Generating Functions

Department of Applied Science, BVCOE New Delhi Subject: PSLP

42

43 of 101

Let lX (t) = ln mX(t) = the log of the moment generating function

The log of Moment Generating Functions

Department of Applied Science, BVCOE New Delhi Subject: PSLP

43

44 of 101

Thus lX (t) = ln mX(t) is very useful for calculating the mean and variance of a random variable

Department of Applied Science, BVCOE New Delhi Subject: PSLP

44

45 of 101

Examples

  1. The Binomial distribution (parameters p, n)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

45

46 of 101

  1. The Poisson distribution (parameter λ)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

46

47 of 101

  1. The Exponential distribution (parameter λ)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

47

48 of 101

  1. The Standard Normal distribution (μ = 0, σ = 1)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

48

49 of 101

  1. The Gamma distribution (parameters α, λ)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

49

50 of 101

  1. The Chi-square distribution (degrees of freedom ν)

Department of Applied Science, BVCOE New Delhi Subject: PSLP

50

51 of 101

Department of Applied Science, BVCOE New Delhi Subject: PSLP

51

52 of 101

Department of Applied Science, BVCOE New Delhi Subject: PSLP

52

53 of 101

Box and Whisker Plots

Department of Applied Science, BVCOE New Delhi Subject: PSLP

53

54 of 101

Order numbers

3, 5, 4, 2, 1, 6, 8, 11, 14, 13, 6, 9, 10, 7

  • First, order your numbers from least to greatest:

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

54

55 of 101

Median

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Then find the median (from the ordered list):

  • Cross off one number from each side until you reach the middle number (or numbers).

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

55

56 of 101

Median (continued):

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • If there are two numbers in the middle,

Add those 2 middle numbers together:

6 + 7 = 13

  • Then divide by 2:

13 ÷ 2 = 6.5

  • The median is 6.5.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

56

57 of 101

Quartiles (page 1)

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Then split the numbers on left and right sides of the median:

1, 2, 3, 4, 5, 6, 6, │7, 8, 9, 10, 11, 13, 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

57

58 of 101

Quartiles (page 2)

1, 2, 3, 4, 5, 6, 6, │7, 8, 9, 10, 11, 13, 14

  • Find the median for each half:

1, 2, 3, 4, 5, 6, 6 │ 7, 8, 9, 10, 11, 13, 14

1, 2, 3, 4, 5, 6, 67, 8, 9, 10, 11, 13, 14

Left Right

Median = 4 Median = 10

Department of Applied Science, BVCOE New Delhi Subject: PSLP

58

59 of 101

Quartiles (page 3)

1, 2, 3, 4, 5, 6, 67, 8, 9, 10, 11, 13, 14

Left Right

Median = 4 Median = 10

  • The left median is called the LOWER QUARTILE.
  • The right median is called the UPPER QUARTILE.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

59

60 of 101

Number line

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Draw a number line from the smallest to the largest number without skipping any numbers.

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

60

61 of 101

Quartiles on number line

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Put circles at the LOWER and UPPER Quartiles.

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

61

62 of 101

Box on Quartiles on number line

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Draw a box connecting the circles at the LOWER and UPPER Quartiles.

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

62

63 of 101

Median on number line

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Put a circle at the median (6.5).

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

63

64 of 101

Median on number line

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Draw a line connecting the median to the box.

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

64

65 of 101

Low and high numbers

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Put circles at the high and low points.

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

65

66 of 101

Low and high numbers

1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 13, 14

  • Draw lines that connect the high and low points to the box.

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Department of Applied Science, BVCOE New Delhi Subject: PSLP

66

67 of 101

Box and Whisker Plot

3, 5, 4, 2, 1, 6, 8, 11, 14, 13, 6, 9, 10, 7

1 2 3 4 5 6 7 8 9 10 11 12 13 14

Here is the completed Box and Whisker Plot!

Department of Applied Science, BVCOE New Delhi Subject: PSLP

67

68 of 101

Ques. The number of books taken out of the library per month by first year students from a sample of 15 is as follows: 3, 0, 12, 0, 2, 0, 26, 0, 7, 5, 5, 2, 1, 1, 2.

The number of books taken out of the library per month by third year students from a sample of 15 is as follows: 12, 0, 9, 4, 15, 2, 6, 10, 27, 15, 5, 9, 1, 14, 2.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

68

69 of 101

Question?

The number of books taken out of the library per month by first year students from a sample of 15 is as follows: 3, 0, 12, 0, 2, 0, 26, 0, 7, 5, 5, 2, 1, 1, 2.

The number of books taken out of the library per month by third year students from a sample of 15 is as follows: 12, 0, 9, 4, 15, 2, 6, 10, 27, 15, 5, 9, 1, 14, 2.

Solution:

First of all start by ordering the data.�The number of books taken out of the library per month by first year students from a sample of 15 is as follows:0, 0, 0, 0, 1, 1, 2, 2, 2, 3, 5, 5, 7, 12, 2.

The number of books taken out of the library per month by third year students from a sample of 15 is as follows:0, 1, 2, 2, 4, 5, 6, 9, 9, 10, 12, 14, 15, 15, 27.

For first year students the data is as follows:Sample size: 15Median: 2Minimum value: 0Maximum value: 26First quartile: 0Third quartile: 5Interquartile Range: 5Outliers: 26For third year students the data is as follows:Sample size: 15Median: 9Minimum value 0Maximum value: 27First quartile: 2Third quartile: 14Interquartile Range: 12Outliers: none.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

69

70 of 101

Solution:

For first year students the data is as follows:Sample size: 15Median: 2Minimum value: 0Maximum value: 26First quartile: 0Third quartile: 5Interquartile Range: 5Outliers: 26For third year students the data is as follows:Sample size: 15Median: 9Minimum value 0Maximum value: 27First quartile: 2Third quartile: 14Interquartile Range: 12Outliers: none.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

70

71 of 101

Covariance and Correlation

71

Department of Applied Science, BVCOE New Delhi Subject: PSLP

72 of 101

72

Department of Applied Science, BVCOE New Delhi Subject: PSLP

73 of 101

73

As an example, take g(x, y) = xy for discrete random variables X and Y with

the joint probability distribution given in the table. The expectation of XY is computed as follows:

Department of Applied Science, BVCOE New Delhi Subject: PSLP

74 of 101

74

Department of Applied Science, BVCOE New Delhi Subject: PSLP

75 of 101

75

Proof that E[X + Y] = E[X] + E[Y]:

Department of Applied Science, BVCOE New Delhi Subject: PSLP

76 of 101

Var(X + Y) is generally not equal to Var(X) + Var(Y)

76

Department of Applied Science, BVCOE New Delhi Subject: PSLP

77 of 101

Department of Applied Science, BVCOE New Delhi Subject: PSLP

77

If Cov(X,Y) > 0 , then X and Y are positively correlated.

If Cov(X,Y) < 0, then X and Y are negatively correlated.

If Cov(X,Y) =0, then X and Y are uncorrelated.

78 of 101

78

Department of Applied Science, BVCOE New Delhi Subject: PSLP

79 of 101

79

Now let X and Y be two independent random variables.

Then Cov(X, Y ) = E[XY ] − E[X]E[Y ] = 0.

Hence, then X and Y are uncorrelated.

We proved that if X and Y are two independent random variables,

then they are uncorrelated.

In general, E[XY] is NOT equal to E[X]E[Y].

INDEPENDENT VERSUS UNCORRELATED.

If two random variables X and Y are independent, then X and Y are uncorrelated.

The converse is not true as we will see on the next slide.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

80 of 101

80

Here, Cov =0 but P (X, Y) not equals P(X). P(Y). Events are not independent.

Then Cov(X, Y ) = E[XY ] − E[X]E[Y ] = 0 and X and Y are uncorrelated,�but they are dependent.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

81 of 101

The variance of a random variable with a Bin(n,p) distribution:

81

Department of Applied Science, BVCOE New Delhi Subject: PSLP

82 of 101

The covariance changes under a change of units

The covariance Cov(X,Y) may not always be suitable to express the dependence between X and Y. For this reason, there is a standardized version of the covariance called the correlation coefficient of X and Y, which remains unaffected by a change of units and, therefore, is dimensionless.

82

Department of Applied Science, BVCOE New Delhi Subject: PSLP

83 of 101

83

Department of Applied Science, BVCOE New Delhi Subject: PSLP

84 of 101

84

Correlation coefficient is also called Pearson correlation coefficient.

(from Wikipedia) Examples of scatter diagrams with different values of correlation coefficient.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

85 of 101

85

(from Wikipedia) Several sets of (x, y) points, with the correlation coefficient of x and y for each set. Note that the correlation reflects the non-linearity and direction of a linear relationship (top row), but not the slope of that relationship (middle), nor many aspects of nonlinear relationships (bottom). N.B.: the figure in the center has a slope of 0 but in that case the correlation coefficient is undefined because the variance of Y is zero.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

86 of 101

SUMMARY:

  • Covariance and correlation are both measures used in statistics to describe the relationship between two variables. However, they serve slightly different purposes and have different properties.

86

Department of Applied Science, BVCOE New Delhi Subject: PSLP

87 of 101

Covariance:�

  • Covariance measures the degree to which two variables change together.
  • It indicates the direction of the linear relationship between two variables.
  • The sign of covariance (positive or negative) indicates the direction of the relationship: positive covariance means the variables tend to move in the same direction, while negative covariance means they tend to move in opposite directions.
  • The magnitude of covariance is not standardized, so it's difficult to interpret the strength of the relationship. It can be affected by the scale of the variables.

87

Department of Applied Science, BVCOE New Delhi Subject: PSLP

88 of 101

  • The formula for covariance between two variables X and Y is:
  • Cov(X, Y)=∑(Xi-a)(Y-b)/(N-1)

Where Xi​ and Yi​ are individual data points, a and b are the means of X and Y respectively, and

N is the number of data points.

88

Department of Applied Science, BVCOE New Delhi Subject: PSLP

89 of 101

Correlation

  • Correlation is a standardized measure of the relationship between two variables.
  • It not only indicates the direction of the relationship but also quantifies the strength of the relationship between variables.
  • Correlation always lies between -1 and 1.
  • A correlation coefficient of 1 indicates a perfect positive linear relationship, -1 indicates a perfect negative linear relationship, and 0 indicates no linear relationship.
  • Correlation is unaffected by changes in scale, making it easier to compare the strength of relationships between different pairs of variables.

89

Department of Applied Science, BVCOE New Delhi Subject: PSLP

90 of 101

  • The formula for the Pearson correlation coefficient (the most commonly used correlation coefficient) between two variables X and Y is:

cor(X,Y)=cov(X,Y)/σX​⋅σY

Where, cov(X,Y) is the covariance between X and Y, and σX​ and σY​ are the standard deviations of X and Y respectively.

σX= square root [(Xi-a)^2/n], a=mean of Xi

NOTE: While covariance and correlation both describe the relationship between variables, correlation is a more useful measure because it's standardized and provides a clear indication of the strength and direction of the relationship.

90

Department of Applied Science, BVCOE New Delhi Subject: PSLP

91 of 101

��CENTRAL LIMIT THEOREM

  • Central Limit Theorem plays a very central role in the study of statistics. It has relevance in hypothesis testing and confidence interval.
  • It characterizes the convergence towards normal distribution. As the sample size increases, the distribution of the sample mean (or sum) approaches a limiting distribution, called as normal distribution. This limiting behavior is the term "limit" refers to in the theorem's name.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

91

92 of 101

The Central Limit Theorem describes the properties of the following two quantities as n gets larger

The sample mean or average of a random sample of size n:

The sum or total of the sample of size n:

Department of Applied Science, BVCOE New Delhi Subject: PSLP

92

93 of 101

Let’s take an example:

  • Population of 65 children showing their marks

Department of Applied Science, BVCOE New Delhi Subject: PSLP

93

17 18 18 18 19 19 19 19

20 20 20 20 20 20 20 20

20 20 21 21 21 21 21 21

21 21 21 21 22 22 22 22

22 22 22 22 22 23 23 23

23 23 24 24 24 24 24 25

25 25 26 26 27 27 29 29

30 32 32 33 33 34 38 43

50

94 of 101

Samples

  • Taking a random sample of size n=1 from the population.
  • Sample mean of sample of size n=1 is number itself.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

94

17 18 18 18 19 19 19 19

20 20 20 20 20 20 20 20

20 20 21 21 21 21 21 21

21 21 21 21 22 22 22 22

22 22 22 22 22 23 23 23

23 23 24 24 24 24 24 25

25 25 26 26 27 27 29 29

30 32 32 33 33 34 38 43

50

95 of 101

Sample of Size 1

  • Take a random sample of size n=1 from the population.
  • Sample mean of sample of size n=1 is

Department of Applied Science, BVCOE New Delhi Subject: PSLP

95

17 18 18 18 19 19 19 19

20 20 20 20 20 20 20 20

20 20 21 21 21 21 21 21

21 21 21 21 22 22 22 22

22 22 22 22 22 23 23 23

23 23 24 24 24 24 24 25

25 25 26 26 27 27 29 29

30 32 32 33 33 34 38 43

50

96 of 101

Another Sample of Size 1

  • Take a random sample of size n=1 from the population.
  • Sample mean of sample of size n=1 is

Department of Applied Science, BVCOE New Delhi Subject: PSLP

96

17 18 18 18 19 19 19 19

20 20 20 20 20 20 20 20

20 20 21 21 21 21 21 21

21 21 21 21 22 22 22 22

22 22 22 22 22 23 23 23

23 23 24 24 24 24 24 25

25 25 26 26 27 27 29 29

30 32 32 33 33 34 38 43

50

97 of 101

Central Limit Theorem

Department of Applied Science, BVCOE New Delhi Subject: PSLP

No matter the shape of the population, the distribution of x-bars tends toward Normality

97

98 of 101

8-98

Example

Suppose that the mean time for an oil change at an oil change joint is 11.4 minutes with a standard deviation of 3.2 minutes.

  1. If a random sample of n = 35 oil changes is selected, describe the sampling distribution of the sample mean.

(b) If a random sample of n = 35 oil changes is selected, what is the probability the mean oil change time is less than 11 minutes?

Department of Applied Science, BVCOE New Delhi Subject: PSLP

99 of 101

8-99

Example

Suppose that the mean time for an oil change at a “10-minute oil change joint” is 11.4 minutes with a standard deviation of 3.2 minutes.

  1. If a random sample of n = 35 oil changes is selected, describe the sampling distribution of the sample mean.

Solution: is approximately normally distributed

with mean = 11.4 and std. dev. = .

Department of Applied Science, BVCOE New Delhi Subject: PSLP

100 of 101

8-100

Example

Suppose that the mean time for an oil change at a “10-minute oil change joint” is 11.4 minutes with a standard deviation of 3.2 minutes.

  1. If a random sample of n = 35 oil changes is selected, describe the sampling distribution of the sample mean.

(b) If a random sample of n = 35 oil changes is selected, what is the probability the mean oil change time is less than 11 minutes?

Solution: is approximately normally distributed

with mean = 11.4 and std. dev. = .

Solution: , P(Z < –0.74) = 0.23.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

101 of 101

Another Example:

  • Suppose we have a fair six-sided die. When rolled, each side has an equal probability of 1/6 of showing up. Let's denote the result of rolling this die as a random variable X.
  • Now, let's say we roll this die n times independently and record the sum of the outcomes. We can denote each outcome of rolling the die as X1​, X2​,…,Xn​, where each Xi​ represents the result of the ith roll.

Department of Applied Science, BVCOE New Delhi Subject: PSLP

101