多重线性回归
具有多个预测变量的线性回归
在一个多重线性回归模型中,响应变量取决于多个预测变量。您可以使用或不使用 LinearModel 对象来执行多重线性回归,也可以使用回归学习器来执行多重线性回归。
为了提高在中低维数据集上的准确度,可以使用 fitlm 拟合线性回归模型。
为了减少在高维数据集上的计算时间,可以使用 fitrlinear 拟合线性回归模型。
App
| 回归学习器 | 使用有监督机器学习训练回归模型来预测数据 |
模块
| RegressionLinear Predict | 使用线性回归模型预测响应 (自 R2023a 起) |
| IncrementalRegressionLinear Predict | Predict responses using incremental linear regression model (自 R2023b 起) |
| IncrementalRegressionLinear Fit | Fit incremental linear regression model (自 R2023b 起) |
| Detect Drift | Update drift detector states and drift status with new data (自 R2024b 起) |
| Per Observation Loss | Per observation regression or classification error of incremental model (自 R2025a 起) |
| Update Metrics | Update performance metrics in incremental learning model given new data (自 R2023b 起) |
函数
对象
LinearModel | Linear regression model |
CompactLinearModel | Compact linear regression model |
CensoredLinearModel | Censored linear regression model (自 R2025a 起) |
CompactCensoredLinearModel | Compact censored linear regression model (自 R2025a 起) |
RegressionLinear | Linear regression model for high-dimensional data |
RegressionPartitionedLinear | Cross-validated linear regression model for high-dimensional data |
RegressionQuantileLinear | Quantile linear regression model (自 R2024b 起) |
CompactRegressionQuantileLinear | Compact quantile linear regression model (自 R2025a 起) |
RegressionPartitionedQuantileModel | Cross-validated quantile model for regression (自 R2025a 起) |
主题
线性回归简介
- What Is a Linear Regression Model?
Regression models describe the relationship between a dependent variable and one or more independent variables. - Linear Regression
Fit a linear regression model and examine the result. - Stepwise Regression
In stepwise regression, predictors are automatically added to or trimmed from a model. - Reduce Outlier Effects Using Robust Regression
Fit a robust model that is less sensitive than ordinary least squares to large changes in small parts of the data. - Choose a Regression Function
Choose a regression function depending on the type of regression problem, and update legacy code using new fitting functions. - Summary of Output and Diagnostic Statistics
Evaluate a fitted model by using model properties and object functions. - Wilkinson Notation
Wilkinson notation provides a way to describe regression and repeated measures models without specifying coefficient values.
线性回归工作流
- Linear Regression Workflow
Import and prepare data, fit a linear regression model, test and improve its quality, and share the model. - Interpret Linear Regression Results
Display and interpret linear regression output statistics. - Linear Regression with Interaction Effects
Construct and analyze a linear regression model with interaction effects and interpret the results. - Linear Regression Using Tables
This example shows how to perform linear and stepwise regression analyses using tables. - Linear Regression with Categorical Covariates
Perform a regression with categorical covariates using categorical arrays andfitlm. - Working with Quantile Regression Models
Estimate prediction intervals and create models that are robust to outliers by using quantile regression models. - Regularize Quantile Regression Model to Prevent Quantile Crossing
Use regularization to prevent quantile crossing in quantile regression models. - Analyze Time Series Data
This example shows how to visualize and analyze time series data using atimeseriesobject and theregressfunction. - Train Linear Regression Model
Train a linear regression model usingfitlmto analyze in-memory data and out-of-memory data. - Predict Responses Using RegressionLinear Predict Block
This example shows how to use the RegressionLinear Predict block for response prediction in Simulink®. (自 R2023a 起) - Accelerate Linear Model Fitting on GPU
This example shows how you can accelerate regression model fitting by running functions on a graphical processing unit (GPU). - Statistics and Machine Learning with Big Data Using Tall Arrays
This example shows how to perform statistical analysis and machine learning on out-of-memory data with MATLAB® and Statistics and Machine Learning Toolbox™.
偏最小二乘回归
- Partial Least Squares
Partial least squares (PLS) constructs new predictor variables as linear combinations of the original predictor variables, while considering the observed response values, leading to a parsimonious model with reliable predictive power. - 偏最小二乘回归和主成分回归
应用偏最小二乘回归 (PLSR) 和主成分回归 (PCR),并研究这两种方法的有效性。