linear regression is a statistical modeling technique used to describe a continuous response variable as a function of one or more predictor variables. it can help you understand and predict the behavior of complex systems or analyze experimental, financial, and biological data.
linear regression techniques are used to create a linear model. the model describes the relationship between a dependent variable \(y\) (also called the response) as a function of one or more independent variables \(x_i\) (called the predictors). the general equation for a linear regression model is:
\[y = \beta_0 \sum \ \beta_k x_k \epsilon_i\]
where \(\beta\) represents linear parameter estimates to be computed and \(\epsilon\) represents the error terms.
types of linear regression
simple linear regression (models using only one predictor): the general equation is:
\[y = \beta_0 \beta_1 x \epsilon\]
multiple linear regression (models using multiple predictors): this regression has multiple \(x_i\) to predict the response, \(y\). an example of this equation is:
\[y = \beta_0 \beta_1 x_1 \beta_2 x_2 \epsilon\]
multivariate linear regression (models for multiple response variables): this regression has multiple \(y_i\)derived from the same data \(x\). they are expressed in different formulae. an example of this system with 2 equations is:
\[y_1 = \beta_{01} \beta_{11} x_1 \epsilon_1\]
\[y_2 = \beta_{02} \beta_{1 2}x_1 \epsilon_2\]
multivariate multiple linear regression (models using multiple predictors for multiple response variables): this regression has multiple \(x_i\) to predict multiple responses \(y_i\). a generalization of the equations is:
applications of linear regression
linear regressions have some properties that make them very interesting for the following applications:
- prediction or forecasting: use a regression model to build a forecast model for a specific data set. from the model, you can use regression to predict response values where only the predictors are known.
- strength of the regression: use a regression model to determine if there is a relationship between a variable and a predictor, and how strong this relationship is.
linear regression with matlab
engineers commonly create simple linear regression models with matlab. for multiple and multivariate linear regression, you can use the statistics and machine learning toolbox™ from matlab. it enables stepwise, robust, and multivariate regression to:
- generate predictions
- compare linear model fits
- plot residuals
- evaluate goodness-of-fit
- detect outliers
to create a linear model that fits curves and surfaces to your data, see curve fitting toolbox™.
keep exploring this topic
resources
expand your knowledge through documentation, examples, videos, and more.
documentation
examples
discover more
- - function
- - video
- - video
- - video
- machine learning with matlab overview (3:02) - video