Function Reference: glmfit

statistics: b = glmfit (X, y, distribution)
statistics: b = glmfit (X, y, distribution, Name, Value)

Perform generalized linear model fitting.

This function fits a generalized linear model (GLM) to the given data using the specified link function and distribution of the response variable. The model is fitted using Iteratively Reweighted Least Squares (IRLS).

  • X is an n×p matrix of predictor variables with n observations and p predictors.
  • y is an n×1 vector of response variables.
  • distribution specifies the distribution of the response variable (e.g., ’poisson’).

b = glmfit (X, y, distribution, Name, Value) specifies additional options using Name-Value pair arguments.

NameValue
"link"A character vector specifying a lin function.

The function returns b, the estimated coefficients of the GLM, including the intercept term as the first element of b.

Currently, the function supports only the ’poisson’ distribution and ’log’ link function. Further expansion is required to support additional distributions and link functions.

Source Code: glmfit