I have the following problem for my homework. So far, I have calculated the average and standard deviation, created a histogram for the averages and the density fit. Unfortunately, I have no idea how to solve the problem regarding the gamma distribution. How can I fit the Gamma distribution to the histogram? I am new to Python and appreciate all kind of support.
P.S. we are working with logreturns of S&P stocks.
Compute the averages and standard deviations for each stock. Properly treat any missing values. Plot a frequency histogram for the averages with a density fit. Add a fit based on normal distribution. Do the same for the standard deviations, but
use a fit to gamma distribution.