### Navigation

- index
- modules |
- next |
- previous |
- statsmodels v0.2.0 documentation »
- Generalized Linear Models »
- scikits.statsmodels.glm.GLM »

# scikits.statsmodels.glm.GLM.fit

`GLM.``fit`(maxiter=100, method='IRLS', tol=1e-008, data_weights=1.0, scale=None)

  Fits a generalized linear model for a given family.

  Parameters: | data_weights : array-like or scalar, only used with Binomial Number of trials for each observation. Used for only for binomial data when endog is specified as a 2d array of (successes, failures). Note that this argument will be dropped in the future. maxiter : int, optional Default is 100. method : string Default is ‘IRLS’ for iteratively reweighted least squares. This is currently the only method available for GLM fit. scale : string or float, optional scale can be ‘X2’, ‘dev’, or a float The default value is None, which uses X2 for Gamma, Gaussian, and Inverse Gaussian. X2 is Pearson’s chi-square divided by df_resid. The default is 1 for the Binomial and Poisson families. dev is the deviance divided by df_resid tol : float Convergence tolerance. Default is 1e-8.

### Navigation

- index
- modules |
- next |
- previous |
- statsmodels v0.2.0 documentation »
- Generalized Linear Models »
- scikits.statsmodels.glm.GLM »