My question is part statistical and part coding.
Say I have fitted a gamma log-link GLM. doc example
# Instantiate a gamma family model with the default link function.
gamma_model = sm.GLM(y, X, family=sm.families.Gamma())
gamma_results = gamma_model.fit()
The gamma is a two parameter distribution of shape and scale.
My understanding is that, as in OLS regression, the fitted GLM predicts values y that are the estimates of the mean and shape of the gamma distribution for a combination of X inputs. Therefore I can use the GLM to estimate the shape parameter values for a given Xi. But how do I obtain the scale?
What I would like to achieve is to make predictions on Xi and to then sample the resulting distribution as per doc example.
# sample gamma distribution
shape, scale = 2., 2.
s = np.random.gamma(shape, scale, 1000)