statsmodels.gam.generalized_additive_model.LogitGam#

class statsmodels.gam.generalized_additive_model.LogitGam(endog, smoother, alpha, *args, **kwargs)[source]#

Generalized Additive model for discrete Logit

This subclasses discrete_model Logit.

Parameters:
endogarray_like

The response variable.

smootherinstance of additive smoother class

Examples of smoother instances include Bsplines or CyclicCubicSplines.

alphafloat or list of floats

Penalization weights for smooth terms. The length of the list needs to be the same as the number of smooth terms in the smoother.

*args

Extra positional arguments used in call to the super classes.

**kwargs

Extra keywords used in call to the super classes.

Attributes:
endog_names

Names of endogenous variables

exog_names

Names of exogenous variables

family
link

Methods

cdf(X)

The logistic cumulative distribution function

cov_params_func_l1(likelihood_model, xopt, ...)

Computes cov_params on a reduced parameter space corresponding to the nonzero parameters resulting from the l1 regularized fit.

fit([method, trim])

Minimize negative penalized log-likelihood

fit_constrained(constraints[, start_params])

Fit a constrained model and return a results instance

fit_regularized([start_params, method, ...])

Fit the model using a regularized maximum likelihood.

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

Create a Model from a formula and dataframe

get_distribution(params[, exog, offset])

Get frozen instance of distribution based on predicted parameters

hessian(params[, pen_weight])

Hessian of model at params

hessian_factor(params)

Logit model Hessian factor

hessian_numdiff(params[, pen_weight])

Hessian based on finite difference derivative

information(params)

Fisher information matrix of model

initialize()

Initialize is called by statsmodels.model.LikelihoodModel.__init__ and should contain any preprocessing that needs to be done for a model.

loglike(params[, pen_weight])

Log-likelihood of model at params

loglikeobs(params[, pen_weight])

Log-likelihood of model observations at params

pdf(X)

The logistic probability density function

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

Predict response variable of a model given exogenous variables.

score(params[, pen_weight])

Gradient of model at params

score_factor(params)

Logit model derivative of the log-likelihood with respect to linpred.

score_numdiff(params[, pen_weight, method])

Score based on finite difference derivative

score_obs(params[, pen_weight])

Gradient of model observations at params

Notes

Warning: not all inherited methods might take correctly account of the penalization, and this class has not been verified yet.

Methods

cdf(X)

The logistic cumulative distribution function

cov_params_func_l1(likelihood_model, xopt, ...)

Computes cov_params on a reduced parameter space corresponding to the nonzero parameters resulting from the l1 regularized fit.

fit([method, trim])

Minimize negative penalized log-likelihood

fit_constrained(constraints[, start_params])

Fit a constrained model and return a results instance

fit_regularized([start_params, method, ...])

Fit the model using a regularized maximum likelihood.

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

Create a Model from a formula and dataframe

get_distribution(params[, exog, offset])

Get frozen instance of distribution based on predicted parameters

hessian(params[, pen_weight])

Hessian of model at params

hessian_factor(params)

Logit model Hessian factor

hessian_numdiff(params[, pen_weight])

Hessian based on finite difference derivative

information(params)

Fisher information matrix of model

initialize()

Initialize is called by statsmodels.model.LikelihoodModel.__init__ and should contain any preprocessing that needs to be done for a model.

loglike(params[, pen_weight])

Log-likelihood of model at params

loglikeobs(params[, pen_weight])

Log-likelihood of model observations at params

pdf(X)

The logistic probability density function

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

Predict response variable of a model given exogenous variables.

score(params[, pen_weight])

Gradient of model at params

score_factor(params)

Logit model derivative of the log-likelihood with respect to linpred.

score_numdiff(params[, pen_weight, method])

Score based on finite difference derivative

score_obs(params[, pen_weight])

Gradient of model observations at params

Properties

endog_names

Names of endogenous variables

exog_names

Names of exogenous variables

family

link