Skip to Content
Regression Analysis with R
book

Regression Analysis with R

by Giuseppe Ciaburro, Pierre Paquay, Manoj Kumar, Shaikh Salamatullah
January 2018
Beginner to intermediate
422 pages
9h 47m
English
Packt Publishing
Content preview from Regression Analysis with R

Gradient Descent

To perform OLS regression using the GD algorithm, we have to minimize the cost function that measures how good a given regression line is.

This cost function will take in an (α , β) pair and return an error value based on how well the line fits our data. To compute this error for a given line, we'll iterate through each (x,y) point in our dataset and sum the square distances between each point's y value and the candidate line's y value (computed at α x + β).

The cost function looks like the following:

If we plot the loss function (z axis) with respect to the coefficients of linear regression (α and β), the 3D plot looks like ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Quantitative Finance with R

Learning Quantitative Finance with R

PRASHANT VATS, Dr. Param Jeet
R: Data Analysis and Visualization

R: Data Analysis and Visualization

Tony Fischetti, Brett Lantz, Jaynal Abedin, Hrishi V. Mittal, Bater Makhabel, Edina Berlinger, Ferenc Illés, Milán Badics, Ádám Banai, Gergely Daróczi, Barbara Dömötör, Gergely Gabler, Dániel Havran, Péter Juhász, István Margitai, Balázs Márkus, Péter Medvegyev, Julia Molnár, Balázs Árpád Szucs, Ágnes Tuza, Tamás Vadász, Kata Váradi, Ágnes Vidovics-Dancs
Regression Analysis by Example, 4th Edition

Regression Analysis by Example, 4th Edition

Samprit Chatterjee, Ali S. Hadi

Publisher Resources

ISBN: 9781788627306Supplemental Content