Difference between revisions of "Página de pruebas"

From Sinfronteras
Jump to: navigation, search
(Simple Linear Regression)
Line 13: Line 13:
  
 
<br />
 
<br />
: '''Using '''Least-squares''' to fit a line to the data'''
+
: '''Using Least-squares to fit a line to the data'''
 
<blockquote>
 
<blockquote>
  
Line 27: Line 27:
 
:* Then, the line that represents the linear regression is the one corresponding to the rotation that has the least RSS. The regression equation:
 
:* Then, the line that represents the linear regression is the one corresponding to the rotation that has the least RSS. The regression equation:
  
: <math> y = a + bx </math>
+
:: <math> y = a + bx </math>
  
: The equation is composed by 2 parameters:  
+
:: The equation is composed by 2 parameters:  
  
 
::* Slope: <math> b = r \frac{S_y}{S_x}</math>  
 
::* Slope: <math> b = r \frac{S_y}{S_x}</math>  

Revision as of 20:43, 27 December 2020

Simple Linear Regression

https://www.youtube.com/watch?v=nk2CQITm_eo&t=267s


In general, there are 3 main stages in Linear regression:

1. Using Least-squares to fit a line to the data
2. Calculating
3. Calculating a for



Using Least-squares to fit a line to the data
  • First, draw a line through the data.
  • Second, calculate the Residual sum of squares: Measure the distance from the line to each data point (residual), square each distance, and then add them up.
The distance from a line to a data point is called a residual
  • Then, we rotate the line a little bit and calculate the RSS
  • ...
  • ...
  • Then, the line that represents the linear regression is the one corresponding to the rotation that has the least RSS. The regression equation:
The equation is composed by 2 parameters:
  • Slope:
The slope is the amount of change in units of for each unitchange in .
  • The intercept.





SimpleLinearRegression2.png


The regression equation:

  • Dependent variable: :
  • Independent variable: :
  • Slope:
The slope is the amount of change in units of for each unitchange in .
  • intercept: :