Generalized linear models currently supports estimation using the one-parameter exponential families
>>> import scikits.statsmodels as sm >>> data = sm.datasets.scotland.Load() >>> data.exog = sm.add_constant(data.exog)Instantiate a gamma family model with the default link function.
>>> gamma_model = sm.GLM(data.endog, data.exog, family=sm.family.Gamma()) >>> gamma_results = gamma_model.fit()
see also the examples and the tests folders
| GLM(endog, exog[, family]) | Generalized Linear Models class |
| GLMResults(model, params, ...) | Class to contain GLM results. |
The distribution families currently implemented are
| Family(link, variance) | The parent class for one-parameter exponential families. |
| Binomial([link]) | Binomial exponential family distribution. |
| Gamma([link]) | Gamma exponential family distribution. |
| Gaussian([link]) | Gaussian exponential family distribution. |
| InverseGaussian([link]) | InverseGaussian exponential family. |
| NegativeBinomial([link, alpha]) | Negative Binomial exponential family. |
| Poisson([link]) | Poisson exponential family. |
The link functions currently implemented are the following. Not all link functions are available for each distribution family. The list of available link functions can be obtained by
>>> ssm.family.family.<familyname>.available ?
| Link | A generic link function for one-parameter exponential family. |
| CDFLink([dbn]) | The use the CDF of a scipy.stats distribution |
| CLogLog | The complementary log-log transform |
| Log | The log transform .. |
| Logit | The logit transform .. |
| NegativeBinomial([alpha]) | The negative binomial link function |
| Power([power]) | The power transform |
| cauchy | The Cauchy (standard Cauchy CDF) transform |
| cloglog | The CLogLog transform link function. |
| identity | The identity transform .. |
| inverse | The inverse transform .. |
| inverse_squared | The inverse squared transform .. |
| log | The log transform .. |
| logit | The logit transform .. |
| nbinom | The negative binomial link function. |
| probit | The probit (standard normal CDF) transform |