linear regression -凯发k8网页登录

what is linear regression?

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\]

simple linear regression example showing how to predict the number of fatal traffic accidents in a state (response variable, \(y\)) compared to the population of the state (predictor variable, \(x\).). (see and how to use the mldivide operator to estimate the coefficients for a simple linear regression.)

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\]

multiple linear regression example, which predicts the miles per gallon (mpg) of different cars (response variable, \(y\)) based on weight and horsepower (predictor variables, \(x_j\)). (see , how to use the regress function and determine significance of the multiple linear regression relationship.)

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 linear regression example showing how to predict the flu estimates for 9 regions (response variables, \(y_i\)), based on the week of the year (predictor variable, \(x\)). (see and how to use the mvregress function to determine the estimated coefficients for a multivariate linear regression.)

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:

multivariate multiple linear regression example that calculates the city and highway mpg (as response variables, \(y_1\) and \(y_2\)) from three variables: wheel base, curb weight, and fuel type (predictor variables, \(x_1\), \(x_2\) and \(x_3\)). (see .

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

网站地图