I want to fit a gamma distribution to my data, which I do using this
import scipy.stats as ss
import scipy as sp
import numpy as np
import os
import matplotlib.pyplot as plt
alpha = []
beta = []
loc = []
data = np.loadtxt(data)
fit_alpha, fit_loc, fit_beta = ss.gamma.fit(data, floc=0, fscale=1)
I want to keep one of the parameters to the gamma distribution as a variable (say the shape), and fix one of the parameters (say scale=1
). However, if I keep the loc variable as zero, I am not able to fix the scale at one. Is there some workaround for this? Can I not parametrize the gamma distribution using only the shape and scale?