In order to understand the way in which we can extract the average of a distribution, let us go through the following scenario.
Computing the average, standard deviation, and higher moments of a distribution
How to do it...
We will initialize a normal distribution with a given average and standard deviation. Once initialized, we will consider the output that we should be expecting.
Initializing a normal distribution
A normal variable with a given mean and standard deviation can be initialized by using the rvs function in scipy.stats.norm:
- Import the relevant packages:
from scipy import stats
- Initialize a variable with a given mean and standard distribution:
x = stats.norm.rvs(loc=3, scale=2, size=(1000))
In the preceding...