[Solved] Python – Statistical distribution


Some parts of your question are unclear. It might help to give the context of what you’re trying to achieve, rather than what are the specific steps you’re taking.

1) + 3) In a Normal distribution – fitting the distribution, and estimating the mean and standard deviation – are basically the same thing. The mean and standard deviation completely determine the distribution.

mu, std = norm.fit(data)

is tantamount to saying “find the mean and standard deviation which best fit the distribution”.

4) Calculating the Z score – you’ll have to explain what you’re trying to do. This usually means how much above (or below) the mean a data point is, in units of standard deviation. Is this what you need here? If so, then it is simply

(np.array(data) - mu) / std

2) Mixture of normal distribution – this is completely unclear. It usually means that the distribution is actually generated by more than a single Normal distribution. What do you mean by this?

5

solved Python – Statistical distribution