Conteúdo do Curso
Probability Theory
Probability Theory
Poisson Distribution
Here, we are going to make the task more complicated; let's talk about Poisson distribution.
To work with this distribution, we should import the poisson
object from scipy.stats
, and we you can apply numerous functions to this distribution like pmf
, sf
, and cdf
that were already learned.
Key characteristics:
It measures the frequency over a specific time interval.
Example:
The data on how often your application had a certain number of users during its entire existence.
Explanation:
It seems to me that you know a lot now, so in this chapter, we are going to create and explain the Poisson distribution. Here is the code:
from scipy.stats import poisson import matplotlib.pyplot as plt fig, ax = plt.subplots() dist = poisson.rvs(mu = 50, size = 10000) plt.xlabel("The Amount of User") plt.ylabel("Frequency") plt.title("Poisson Distribution") ax.hist(dist, bins = 60) plt.show()
We are going to talk about it a little bit, you already know the .rvs()
function, but let's clarify something for this case poisson.rvs(mu = 50, size = 10000)
:
mu
means mean (here, it was defined randomly).size
is the number inverted by the sum of all values of the frequencies of the columns
Let's recall some functions, but for Poisson distribution (they are a little bit different):
For calculating the probability of receiving exactly k
events: norm.pmf(k, mu)
.
For calculating the probability of receiving k
or more events: norm.sf(k, mu)
.
For calculating the probability of receiving k
or less events: norm.cdf(k, mu)
.
mu
is the mean value of the distribution.
Tarefa
You are going to work with the same distribution as you can see in the theory. As you know, the mean, in this case, is equal to 50
, but let's figure out two probabilities. Follow the algorithm:
- Import
poisson
object. - Calculate the probability that your site has more than
80
visitors with the mean value50
. - Calculate the probability that your site has less than
20
visitors with the mean50
. - Calculate the whole probability - the probability that your site has more than
80
or less than20
visitors.
This task is a real-life challenge due to the reason that you calculate the probability of coping with a small or large amount of users.
Note
So, the probability that your app will visit an extremely small or large amount of people is extremely small. By the way, if the probability is too small, you can just drop it :)
Obrigado pelo seu feedback!
Poisson Distribution
Here, we are going to make the task more complicated; let's talk about Poisson distribution.
To work with this distribution, we should import the poisson
object from scipy.stats
, and we you can apply numerous functions to this distribution like pmf
, sf
, and cdf
that were already learned.
Key characteristics:
It measures the frequency over a specific time interval.
Example:
The data on how often your application had a certain number of users during its entire existence.
Explanation:
It seems to me that you know a lot now, so in this chapter, we are going to create and explain the Poisson distribution. Here is the code:
from scipy.stats import poisson import matplotlib.pyplot as plt fig, ax = plt.subplots() dist = poisson.rvs(mu = 50, size = 10000) plt.xlabel("The Amount of User") plt.ylabel("Frequency") plt.title("Poisson Distribution") ax.hist(dist, bins = 60) plt.show()
We are going to talk about it a little bit, you already know the .rvs()
function, but let's clarify something for this case poisson.rvs(mu = 50, size = 10000)
:
mu
means mean (here, it was defined randomly).size
is the number inverted by the sum of all values of the frequencies of the columns
Let's recall some functions, but for Poisson distribution (they are a little bit different):
For calculating the probability of receiving exactly k
events: norm.pmf(k, mu)
.
For calculating the probability of receiving k
or more events: norm.sf(k, mu)
.
For calculating the probability of receiving k
or less events: norm.cdf(k, mu)
.
mu
is the mean value of the distribution.
Tarefa
You are going to work with the same distribution as you can see in the theory. As you know, the mean, in this case, is equal to 50
, but let's figure out two probabilities. Follow the algorithm:
- Import
poisson
object. - Calculate the probability that your site has more than
80
visitors with the mean value50
. - Calculate the probability that your site has less than
20
visitors with the mean50
. - Calculate the whole probability - the probability that your site has more than
80
or less than20
visitors.
This task is a real-life challenge due to the reason that you calculate the probability of coping with a small or large amount of users.
Note
So, the probability that your app will visit an extremely small or large amount of people is extremely small. By the way, if the probability is too small, you can just drop it :)
Obrigado pelo seu feedback!
Poisson Distribution
Here, we are going to make the task more complicated; let's talk about Poisson distribution.
To work with this distribution, we should import the poisson
object from scipy.stats
, and we you can apply numerous functions to this distribution like pmf
, sf
, and cdf
that were already learned.
Key characteristics:
It measures the frequency over a specific time interval.
Example:
The data on how often your application had a certain number of users during its entire existence.
Explanation:
It seems to me that you know a lot now, so in this chapter, we are going to create and explain the Poisson distribution. Here is the code:
from scipy.stats import poisson import matplotlib.pyplot as plt fig, ax = plt.subplots() dist = poisson.rvs(mu = 50, size = 10000) plt.xlabel("The Amount of User") plt.ylabel("Frequency") plt.title("Poisson Distribution") ax.hist(dist, bins = 60) plt.show()
We are going to talk about it a little bit, you already know the .rvs()
function, but let's clarify something for this case poisson.rvs(mu = 50, size = 10000)
:
mu
means mean (here, it was defined randomly).size
is the number inverted by the sum of all values of the frequencies of the columns
Let's recall some functions, but for Poisson distribution (they are a little bit different):
For calculating the probability of receiving exactly k
events: norm.pmf(k, mu)
.
For calculating the probability of receiving k
or more events: norm.sf(k, mu)
.
For calculating the probability of receiving k
or less events: norm.cdf(k, mu)
.
mu
is the mean value of the distribution.
Tarefa
You are going to work with the same distribution as you can see in the theory. As you know, the mean, in this case, is equal to 50
, but let's figure out two probabilities. Follow the algorithm:
- Import
poisson
object. - Calculate the probability that your site has more than
80
visitors with the mean value50
. - Calculate the probability that your site has less than
20
visitors with the mean50
. - Calculate the whole probability - the probability that your site has more than
80
or less than20
visitors.
This task is a real-life challenge due to the reason that you calculate the probability of coping with a small or large amount of users.
Note
So, the probability that your app will visit an extremely small or large amount of people is extremely small. By the way, if the probability is too small, you can just drop it :)
Obrigado pelo seu feedback!
Here, we are going to make the task more complicated; let's talk about Poisson distribution.
To work with this distribution, we should import the poisson
object from scipy.stats
, and we you can apply numerous functions to this distribution like pmf
, sf
, and cdf
that were already learned.
Key characteristics:
It measures the frequency over a specific time interval.
Example:
The data on how often your application had a certain number of users during its entire existence.
Explanation:
It seems to me that you know a lot now, so in this chapter, we are going to create and explain the Poisson distribution. Here is the code:
from scipy.stats import poisson import matplotlib.pyplot as plt fig, ax = plt.subplots() dist = poisson.rvs(mu = 50, size = 10000) plt.xlabel("The Amount of User") plt.ylabel("Frequency") plt.title("Poisson Distribution") ax.hist(dist, bins = 60) plt.show()
We are going to talk about it a little bit, you already know the .rvs()
function, but let's clarify something for this case poisson.rvs(mu = 50, size = 10000)
:
mu
means mean (here, it was defined randomly).size
is the number inverted by the sum of all values of the frequencies of the columns
Let's recall some functions, but for Poisson distribution (they are a little bit different):
For calculating the probability of receiving exactly k
events: norm.pmf(k, mu)
.
For calculating the probability of receiving k
or more events: norm.sf(k, mu)
.
For calculating the probability of receiving k
or less events: norm.cdf(k, mu)
.
mu
is the mean value of the distribution.
Tarefa
You are going to work with the same distribution as you can see in the theory. As you know, the mean, in this case, is equal to 50
, but let's figure out two probabilities. Follow the algorithm:
- Import
poisson
object. - Calculate the probability that your site has more than
80
visitors with the mean value50
. - Calculate the probability that your site has less than
20
visitors with the mean50
. - Calculate the whole probability - the probability that your site has more than
80
or less than20
visitors.
This task is a real-life challenge due to the reason that you calculate the probability of coping with a small or large amount of users.
Note
So, the probability that your app will visit an extremely small or large amount of people is extremely small. By the way, if the probability is too small, you can just drop it :)