Course Content

Probability Theory Mastering

## Probability Theory Mastering

1. Additional Statements From The Probability Theory

3. Estimation of Population Parameters

4. Testing of Statistical Hypotheses

# Challenge: Confidence Interval for Exponential Distribution Parameter

In the previous chapter, we considered how to build confidence intervals for the parameters of a **Gaussian distribution**. Now let's understand how we can use this to build confidence intervals for the parameters of **other distributions**.

For example, let's use **exponential distribution**. Earlier in this course, the exponential distribution has already been used in examples. Now, let's look at this distribution in more detail and consider its PDF and characteristics:

We have to build a confidence interval for the **lambda** parameter to solve this problem. Let's first consider not the lambda parameter itself but the inversed parameter **1/lambda**.

According to the method of moments, we can estimate this parameter using the sample mean, as we have shown earlier, such an estimate will be both non-biased and consistent.

Note

This estimate will also be effective You can verify this yourself based on the information in the previous chapter.

## Confidence interval for exponential distribution parameter

Firstly, let's find the expected value and variance of our estimation:

Now let's construct the following function and analyze it:

Since we have the sum of i.i.d. random variables with a finite mathematical expectation and variance, we can apply the **central limit theorem to our estimate**. Then we construct the function so that its distribution does not depend on the estimated parameters. Finally, we only have to specify the analytical confidence interval.

Note

Estimates for which the Central Limit Theorem holds are called

asymptotically normal. We can construct confidence intervals using the confidence intervals of the Gaussian distribution for such estimates.

Task

Thus, we analytically **derived a formula** by which we can calculate the confidence interval for the exponential distribution parameter, it remains to implement this in the code.
You have to:

- Import
`stats`

module from`scipy`

library to provide necessary calculations. - Use
`.ppf()`

method to calculate`z_value`

. - Use
`.mean()`

method to get estimation of 1 / lambda parameter.

Everything was clear?

# Challenge: Confidence Interval for Exponential Distribution Parameter

In the previous chapter, we considered how to build confidence intervals for the parameters of a **Gaussian distribution**. Now let's understand how we can use this to build confidence intervals for the parameters of **other distributions**.

For example, let's use **exponential distribution**. Earlier in this course, the exponential distribution has already been used in examples. Now, let's look at this distribution in more detail and consider its PDF and characteristics:

We have to build a confidence interval for the **lambda** parameter to solve this problem. Let's first consider not the lambda parameter itself but the inversed parameter **1/lambda**.

According to the method of moments, we can estimate this parameter using the sample mean, as we have shown earlier, such an estimate will be both non-biased and consistent.

Note

This estimate will also be effective You can verify this yourself based on the information in the previous chapter.

## Confidence interval for exponential distribution parameter

Firstly, let's find the expected value and variance of our estimation:

Now let's construct the following function and analyze it:

Since we have the sum of i.i.d. random variables with a finite mathematical expectation and variance, we can apply the **central limit theorem to our estimate**. Then we construct the function so that its distribution does not depend on the estimated parameters. Finally, we only have to specify the analytical confidence interval.

Note

Estimates for which the Central Limit Theorem holds are called

asymptotically normal. We can construct confidence intervals using the confidence intervals of the Gaussian distribution for such estimates.

Task

Thus, we analytically **derived a formula** by which we can calculate the confidence interval for the exponential distribution parameter, it remains to implement this in the code.
You have to:

- Import
`stats`

module from`scipy`

library to provide necessary calculations. - Use
`.ppf()`

method to calculate`z_value`

. - Use
`.mean()`

method to get estimation of 1 / lambda parameter.

Everything was clear?