# 广义线性回归

## 模块

 ClassificationLinear Predict Classify observations using linear classification model (自 R2023a 起)

## 函数

#### 创建 `GeneralizedLinearModel` 对象

 `fitglm` Create generalized linear regression model `stepwiseglm` Create generalized linear regression model by stepwise regression

#### 创建 `CompactGeneralizedLinearModel` 对象

 `compact` Compact generalized linear regression model

#### 在广义线性模型中添加或删除项

 `addTerms` Add terms to generalized linear regression model `removeTerms` Remove terms from generalized linear regression model `step` Improve generalized linear regression model by adding or removing terms

#### 预测响应

 `feval` Predict responses of generalized linear regression model using one input for each predictor `predict` Predict responses of generalized linear regression model `random` Simulate responses with random noise for generalized linear regression model

#### 计算广义线性模型

 `coefCI` Confidence intervals of coefficient estimates of generalized linear regression model `coefTest` Linear hypothesis test on generalized linear regression model coefficients `devianceTest` Analysis of deviance for generalized linear regression model `partialDependence` Compute partial dependence (自 R2020b 起)

#### 可视化广义线性模型和摘要统计量

 `plotDiagnostics` Plot observation diagnostics of generalized linear regression model `plotPartialDependence` Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots `plotResiduals` Plot residuals of generalized linear regression model `plotSlice` Plot of slices through fitted generalized linear regression surface

#### 收集广义线性模型的属性

 `gather` Gather properties of Statistics and Machine Learning Toolbox object from GPU (自 R2020b 起)

#### 创建 `MultinomialRegression` 对象

 `fitmnr` Fit multinomial regression model (自 R2023a 起)

#### 使用 `MultinomialRegression` 对象

 `coefCI` Confidence intervals for coefficient estimates of multinomial regression model (自 R2023a 起) `coefTest` Linear hypothesis test on multinomial regression model coefficients (自 R2023a 起) `feval` Predict responses of multinomial regression model using one input for each predictor (自 R2023a 起) `partialDependence` Compute partial dependence (自 R2020b 起) `plotPartialDependence` Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots `plotResiduals` Plot residuals of multinomial regression model (自 R2023a 起) `plotSlice` Plot of slices through fitted multinomial regression surface (自 R2023a 起) `predict` Predict responses of multinomial regression model (自 R2023a 起) `random` Generate random responses from fitted multinomial regression model (自 R2023a 起) `testDeviance` Deviance test for multinomial regression model (自 R2023a 起)

#### 创建对象

 `fitclinear` Fit binary linear classifier to high-dimensional data `fitcecoc` Fit multiclass models for support vector machines or other classifiers `fitckernel` Fit binary Gaussian kernel classifier using random feature expansion `templateLinear` Linear learner template

#### 预测标签

 `predict` Predict labels for linear classification models `predict` Classify observations using multiclass error-correcting output codes (ECOC) model `predict` Predict labels for Gaussian kernel classification model
 `glmfit` Fit generalized linear regression model `glmval` Generalized linear model values

## 对象

 `GeneralizedLinearModel` Generalized linear regression model class `CompactGeneralizedLinearModel` Compact generalized linear regression model class
 `MultinomialRegression` Multinomial regression model (自 R2023a 起)
 `ClassificationLinear` Linear model for binary classification of high-dimensional data `ClassificationECOC` Multiclass model for support vector machines (SVMs) and other classifiers `ClassificationKernel` Gaussian kernel classification model using random feature expansion `ClassificationPartitionedLinear` Cross-validated linear model for binary classification of high-dimensional data `ClassificationPartitionedLinearECOC` Cross-validated linear error-correcting output codes model for multiclass classification of high-dimensional data

## 主题

### 多项式逻辑回归

• Multinomial Models for Nominal Responses
A nominal response variable has a restricted set of possible values with no natural order between them. A nominal response model explains and predicts the probability that an observation is in each category of a categorical response variable.
• Multinomial Models for Ordinal Responses
An ordinal response variable has a restricted set of possible values that fall into a natural order. An ordinal response model describes the relationship between the cumulative probabilities of the categories and predictor variables.
• Multinomial Models for Hierarchical Responses
A hierarchical multinomial response variable (also known as a sequential or nested multinomial response) has a restricted set of possible values that fall into hierarchical categories. The hierarchical multinomial regression models are extensions of binary regression models based on conditional binary observations.