statsmodels.distributions.discrete.DiscretizedModel

class statsmodels.distributions.discrete.DiscretizedModel(endog, exog=None, distr=None)[source]

experimental model to fit discretized distribution

Count models based on discretized distributions can be used to model data that is under- or over-dispersed relative to Poisson or that has heavier tails.

Parameters:
endogarray_like, 1-D

Univariate data for fitting the distribution.

exogNone

Explanatory variables are not supported. The exog argument is only included for consistency in the signature across models.

distrDiscretizedCount instance

(required) Instance of a DiscretizedCount distribution.

See also

DiscretizedCount

Examples

>>> from scipy import stats
>>> from statsmodels.distributions.discrete import (
        DiscretizedCount, DiscretizedModel)
>>> dd = DiscretizedCount(stats.gamma)
>>> mod = DiscretizedModel(y, distr=dd)
>>> res = mod.fit()
>>> probs = res.predict(which="probs", k_max=5)
Attributes:
endog_names

Names of endogenous variables.

exog_names

Names of exogenous variables.

Methods

expandparams(params)

expand to full parameter array when some parameters are fixed

fit([start_params, method, maxiter, ...])

Fit method for likelihood based models

from_formula(formula, data[, subset, drop_cols])

Create a Model from a formula and dataframe.

get_distr(params)

frozen distribution instance of the discrete distribution.

hessian(params)

Hessian of log-likelihood evaluated at params

hessian_factor(params[, scale, observed])

Weights for calculating Hessian

information(params)

Fisher information matrix of model.

initialize()

Initialize (possibly re-initialize) a Model instance.

loglike(params)

Log-likelihood of model at params

loglikeobs(params)

Log-likelihood of the model for all observations at params.

nloglike(params)

Negative log-likelihood of model at params

predict(params[, exog, which, k_max])

After a model has been fit predict returns the fitted values.

reduceparams(params)

Reduce parameters

score(params)

Gradient of log-likelihood evaluated at params

score_obs(params, **kwds)

Jacobian/Gradient of log-likelihood evaluated at params for each observation.

Properties

endog_names

Names of endogenous variables.

exog_names

Names of exogenous variables.


Last update: Dec 14, 2023