FUNCTION REFERENCE

fitglm

Fit a numeric generalized linear regression model by IRLS.

Fit a numeric generalized linear regression model by IRLS.

Syntax

mdl = fitglm(X,y,'Distribution',d); mdl = fitglm(...,'Link',link); mdl = fitglm(tbl,formula,...)

Returns a GeneralizedLinearModel with Coefficients, Deviance, Dispersion and the model statistics and residual properties provided by fitlm. Supported distributions are 'normal' (default identity link), 'binomial' (default logit link) and 'poisson' (default log link). Normal also supports the log link; binomial supports probit; poisson supports identity. Dispersion is estimated for normal and fixed to one for binomial and poisson. Binomial and poisson coefficient p-values use the standard normal distribution; normal uses Student's t. predict returns the mean response on the response scale. Model specifications, intercept control and numeric table input follow fitlm.

Example

mdl=fitglm([-2;-1;0;1;2;3],[0;1;0;1;0;1],'Distribution','binomial'); predict(mdl,[0;1])

Differences from MATLAB: no grouped binomial counts, trial sizes, weights, offsets, categorical predictors, custom links or other distributions. Unsupported links and incompatible combinations raise errors. IRLS uses at most 100 iterations with deviance step halving; separated data, singular weights or failure to converge raise errors. The fitlm design limits also apply. Normal likelihood uses the fitted dispersion. Normal dispersion uses residual degrees of freedom.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.