statsmodels.genmod.generalized_linear_model.GLM.get_distribution

method

GLM.get_distribution(params, scale=1, exog=None, exposure=None, offset=None)[source]

Returns a random number generator for the predictive distribution.

Parameters
paramsarray-like

The model parameters.

scalescalar

The scale parameter.

exogarray-like

The predictor variable matrix.

Returns
gen

Frozen random number generator object. Use the rvs method to generate random values.

Notes

Due to the behavior of scipy.stats.distributions objects, the returned random number generator must be called with gen.rvs(n) where n is the number of observations in the data set used to fit the model. If any other value is used for n, misleading results will be produced.