Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

多重线性回归

具有多个预测变量的线性回归

在一个多重线性回归模型中,响应变量取决于多个预测变量。您可以使用或不使用 LinearModel 对象来执行多重线性回归,也可以使用回归学习器来执行多重线性回归。

为了提高在中低维数据集上的准确度,可以使用 fitlm 拟合线性回归模型。

为了减少在高维数据集上的计算时间,可以使用 fitrlinear 拟合线性回归模型。

App

回归学习器使用有监督机器学习训练回归模型来预测数据

模块

RegressionLinear Predict使用线性回归模型预测响应 (自 R2023a 起)
IncrementalRegressionLinear PredictPredict responses using incremental linear regression model (自 R2023b 起)
IncrementalRegressionLinear FitFit incremental linear regression model (自 R2023b 起)
Update MetricsUpdate performance metrics in incremental learning model given new data (自 R2023b 起)

函数

全部展开

创建 LinearModel 对象

fitlm拟合线性回归模型
stepwiselmPerform stepwise regression

创建 CompactLinearModel 对象

compactCompact linear regression model

添加或删除线性模型中的项

addTermsAdd terms to linear regression model
removeTermsRemove terms from linear regression model
stepImprove linear regression model by adding or removing terms

预测响应

fevalPredict responses of linear regression model using one input for each predictor
predictPredict responses of linear regression model
randomSimulate responses with random noise for linear regression model

计算线性模型

anovaAnalysis of variance for linear regression model
coefCIConfidence intervals of coefficient estimates of linear regression model
coefTestLinear hypothesis test on linear regression model coefficients
dwtestDurbin-Watson test with linear regression model object
partialDependenceCompute partial dependence (自 R2020b 起)

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

plotScatter plot or added variable plot of linear regression model
plotAddedAdded variable plot of linear regression model
plotAdjustedResponseAdjusted response plot of linear regression model
plotDiagnosticsPlot observation diagnostics of linear regression model
plotEffectsPlot main effects of predictors in linear regression model
plotInteractionPlot interaction effects of two predictors in linear regression model
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
plotResidualsPlot residuals of linear regression model
plotSlicePlot of slices through fitted linear regression surface

收集线性模型的属性

gatherGather properties of Statistics and Machine Learning Toolbox object from GPU (自 R2020b 起)

创建对象

fitrlinearFit linear regression model to high-dimensional data

使用 RegressionLinear 对象

predictPredict response of linear regression model
limeLocal interpretable model-agnostic explanations (LIME) (自 R2020b 起)
lossRegression loss for linear regression models
partialDependenceCompute partial dependence (自 R2020b 起)
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
shapleyShapley values (自 R2021a 起)
selectModelsSelect fitted regularized linear regression models

使用 RegressionPartitionedLinear 对象

kfoldLossRegression loss for observations not used in training
kfoldPredictPredict responses for observations not used for training

拟合和计算线性回归

dwtestDurbin-Watson test with residual inputs
invpredInverse prediction
linhyptestLinear hypothesis test
plsregressPartial least-squares (PLS) regression
regress多重线性回归
regstatsRegression diagnostics
relieffRank importance of predictors using ReliefF or RReliefF algorithm
robustfitFit robust linear regression
stepwisefitFit linear regression model using stepwise regression

多项式曲线拟合

polyconfPolynomial confidence intervals
polyfit多项式曲线拟合

准备数据

x2fxConvert predictor matrix to design matrix
dummyvarCreate dummy variables

交互式工具

polytoolInteractive polynomial fitting
robustdemoInteractive robust regression
rsmdemoInteractive response surface demonstration
rstoolInteractive response surface modeling
stepwiseInteractive stepwise regression

对象

LinearModelLinear regression model
CompactLinearModelCompact linear regression model
RegressionLinearLinear regression model for high-dimensional data
RegressionPartitionedLinearCross-validated linear regression model for high-dimensional data

主题

线性回归简介

线性回归工作流

偏最小二乘回归

  • 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),并研究这两种方法的有效性。