You are on page 1of 14

4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

Maths (/maths/) > Math Article (/maths/articles/) > Least Square Method (/maths/least-square-method/)

(https://byjus.com/byjus-classes-book-a-free-60-minutes-class/registration/?
utm_source=byjus.com&utm_medium=maths-topbanner&utm_campaign=byjus-classes-right-tuitions)

Least Square Method

The least square method is the process of finding the best-fitting curve or line of best fit for a set of data
points by reducing the sum of the squares of the offsets (residual part) of the points from the curve.
During the process of finding the relation between two variables, the trend of outcomes are estimated
quantitatively. This process is termed as regression analysis. The method of curve fitting is an approach
to regression analysis. This method of fitting equations which approximates the curves to given raw data
is the least squares.

It is quite obvious that the fitting of curves for a particular data set are not always unique. Thus, it is
required to find a curve having a minimal deviation from all the measured data points. This is known as
the best-fitting curve and is found by using the least-squares method.

Also, read:

Correlation and Regression (https://byjus.com/maths/correlation-and-regression/)


Linear Regression Formula (https://byjus.com/linear-regression-formula/)
R squared Formula in Linear Regression (https://byjus.com/r-squared-formula/)

Least Square Method Definition


The least-squares method is a crucial statistical method that is practised to find a regression line or a
best-fit line for the given pattern. This method is described by an equation with specific parameters. The
method of least squares is generously used in evaluation and regression. In regression analysis, this
method is said to be a standard approach for the approximation of sets of equations having more
equations than the number of unknowns.

The method of least squares actually defines the solution for the minimization of the sum of squares of
deviations or the errors in the result of each equation. Find the formula for sum of squares of errors
(https://byjus.com/regression-sum-of-squares-formula/), which help to find the variation in observed data.
(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 1/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

The least-squares method is often applied in data fitting. The best fit result is assumed to reduce the sum
of squared errors or residuals which are stated to be the differences between the observed or
experimental value and corresponding fitted value given in the model.

There are two basic categories of least-squares problems:

Ordinary or linear least squares


Nonlinear least squares

These depend upon linearity or nonlinearity of the residuals. The linear problems are often seen in
regression analysis in statistics. On the other hand, the non-linear problems are generally used in the
iterative method of refinement in which the model is approximated to the linear one with each iteration.

Least Square Method Graph


In linear regression, the line of best fit is a straight line as shown in the following diagram:

The given data points are to be minimized by the method of reducing residuals or offsets of each point
from the line. The vertical offsets are generally used in surface, polynomial and hyperplane problems,
while perpendicular offsets are utilized in common practice.

(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 2/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

Least Square Method Formula


The least-square method states that the curve that best fits a given set of observations, is said to be a
curve having a minimum sum of the squared residuals (or deviations or errors) from the given data points.
Let us assume that the given points of data are (x1, y1), (x2, y2), (x3, y3), …, (xn, yn) in which all x’s are
independent variables, while all y’s are dependent ones. Also, suppose that f(x) is the fitting curve and d
represents error or deviation from each given point.

Now, we can write:

d1 = y1 − f(x1)

d2 = y2 − f(x2)

d3 = y3 − f(x3)

…..

dn = yn – f(xn)

The least-squares explain that the curve that best fits is represented by the property that the sum of
squares of all the deviations from given values must be minimum, i.e:

Sum = Minimum Quantity

Suppose when we have to determine the equation of line of best fit for the given data, then we first use the
(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
following formula.
DOWNLOAD
App NOW
The equation of least square line is given by Y = a + bX

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 3/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

Normal equation for ‘a’:

∑Y = na + b∑X

Normal equation for ‘b’:

∑XY = a∑X + b∑X2

Solving these two normal equations we can get the required trend line equation.

Thus, we can get the line of best fit with formula y = ax + b

Solved Example
The Least Squares Model for a set of data (x1, y1), (x2, y2), (x3, y3), …, (xn, yn) passes through the point (xa,
ya) where xa is the average of the xi‘s and ya is the average of the yi‘s. The below example explains how to
find the equation of a straight line or a least square line using the least square method.

Question:

Consider the time series data given below:

xi 8 3 2 10 11 3 6 5 6 8

yi 4 12 1 12 9 4 9 6 1 14

Use the least square method to determine the equation of line of best fit for the data. Then plot the line.

Solution:

Mean of xi values = (8 + 3 + 2 + 10 + 11 + 3 + 6 + 5 + 6 + 8)/10 = 62/10 = 6.2

Mean of yi values = (4 + 12 + 1 + 12 + 9 + 4 + 9 + 6 + 1 + 14)/10 = 72/10 = 7.2

Straight line equation is y = a + bx.

The normal equations are

∑y = an + b∑x

∑xy = a∑x + b∑x2

x y x2 xy

8 4 64 32

3 12 9 36

2 1 4 2

10 12 100 120

11 9 121 99

3 4 9 12

6 9 36 54
(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
5
App NOW 6 25 30

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 4/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

6 1 36 6

8 14 64 112

∑x = 62 ∑y = 72 ∑x2 = 468 ∑xy = 503

Substituting these values in the normal equations,

10a + 62b = 72….(1)

62a + 468b = 503….(2)

(1) × 62 – (2) × 10,

620a + 3844b – (620a + 4680b) = 4464 – 5030

-836b = -566

b = 566/836

b = 283/418

b = 0.677

Substituting b = 0.677 in equation (1),

10a + 62(0.677) = 72

10a + 41.974 = 72

10a = 72 – 41.974

10a = 30.026

a = 30.026/10

a = 3.0026

Therefore, the equation becomes,

y = a + bx

y = 3.0026 + 0.677x

(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 5/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

This is the required trend line equation.

Now, we can find the sum of squares of deviations from the obtained values as:

d1 = [4 – (3.0026 + 0.677*8)] = (-4.4186)

d2 = [12 – (3.0026 + 0.677*3)] = (6.9664)

d3 = [1 – (3.0026 + 0.677*2)] = (-3.3566)

d4 = [12 – (3.0026 + 0.677*10)] = (2.2274)

d5 = [9 – (3.0026 + 0.677*11)] =(-1.4496)

d6 = [4 – (3.0026 + 0.677*3)] = (-1.0336)

d7 = [9 – (3.0026 + 0.677*6)] = (1.9354)

d8 = [6 – (3.0026 + 0.677*5)] = (-0.3876)

d9 = [1 – (3.0026 + 0.677*6)] = (-6.0646)

d10 = [14 – (3.0026 + 0.677*8)] = (5.5814)

∑d2 = (-4.4186)2 + (6.9664)2 + (-3.3566)2 + (2.2274)2 + (-1.4496)2 + (-1.0336)2 + (1.9354)2 + (-0.3876)2 +


(-6.0646)2 + (5.5814)2 = 159.27990

Limitations for Least-Square Method


The least-squares method is a very beneficial method of curve fitting. Despite many benefits, it has a few
shortcomings too. One of the main limitations is discussed here.

In the process of regression analysis, which utilizes the least-square method for curve fitting, it is
inevitably assumed that the errors in the independent variable are negligible or zero. In such cases, when
(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
independent variable errors are non-negligible, the models are subjected to measurement errors.
DOWNLOAD
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 6/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

Therefore, here, the least square method may even lead to hypothesis testing, where parameter estimates
and confidence intervals are taken into consideration due to the presence of errors occurring in the
independent variables.

Frequently Asked Questions – FAQs


Q1 How do you calculate least squares?

Let us assume that the given points of data are (x_1, y_1), (x_2, y_2), …, (x_n, y_n) in
which all x’s are independent variables, while all y’s are dependent ones. Also, suppose
that f(x) be the fitting curve and d represents error or deviation from each given point.
The least-squares explain that the curve that best fits is represented by the property that
the sum of squares of all the deviations from given values must be minimum.

Q2 How many methods are available for the Least Square?

There are two primary categories of least-squares method problems:


Ordinary or linear least squares
Nonlinear least squares

Q3 What is the principle of least squares?

The least squares principle states that by getting the sum of the squares of the errors a
minimum value, the most probable values of a system of unknown quantities can be
obtained upon which observations have been made.

Q4 What does the least square mean?


The least square method is the process of obtaining the best-fitting curve or line of best
fit for the given data set by reducing the sum of the squares of the offsets (residual part)
of the points from the curve.

Q5 What is least square curve fitting?


The least-squares method is a generally used method of the fitting curve for a given
data set. It is the most prevalent method used to determine the trend line for the given
time series data.

MATHS Related Links

HCF And LCM Problems


Roman Numbers 1 To 100
(https://byjus.com/maths/properties-of-hcf-and-
(https://byjus.com/maths/roman-numerals/)
lcm/)
(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 7/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

MATHS Related Links

Statistics For Class 10


Square Root Tricks
(https://byjus.com/maths/statistics-for-class-
(https://byjus.com/maths/square-root-tricks/)
10/)

Nets Of Solids (https://byjus.com/maths/3d- Partial Fraction Method


shapes/) (https://byjus.com/maths/partial-fractions/)

Laws Of Exponents Square Root Of 3


(https://byjus.com/maths/laws-of-exponents/) (https://byjus.com/maths/square-root-of-3/)

Height Of Equilateral Triangle Independent Events Examples


(https://byjus.com/maths/altitude-of-a-triangle/) (https://byjus.com/maths/independent-events/)

(https://byjus.com/byjus-classes-book-a-free-60-

minutes-class/registration/?utm_source=byjus.com&utm_medium=maths-
sidebanner&utm_campaign=byjus-classes-right-tuitions)

(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 8/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

(https://byjus.com/byjus-classes-book-a-free-60-

minutes-class/registration/?utm_source=byjus.com&utm_medium=maths-
sidebanner&utm_campaign=byjus-classes-right-tuitions)

CBSE Sample Papers


CBSE Sample Papers Class 8 Maths (Https://Byjus.Com/Cbse-Sample-Papers-For-Class-8-Maths/)

CBSE Sample Papers Class 9 Maths (Https://Byjus.Com/Cbse-Sample-Papers-For-Class-9-Maths/)

CBSE Sample Papers Class 10 Maths (Https://Byjus.Com/Cbse-Class-10-Sample-Papers-For-


Maths/)

CBSE Sample Papers Class 11 Maths (Https://Byjus.Com/Cbse-Sample-Papers-For-Class-11-


Maths/)

CBSE Sample Papers Class 12 Maths (Https://Byjus.Com/Cbse-Class-12-Maths-Sample-Paper/)

CBSE Previous Year Question Papers


CBSE Previous Year Question Papers Class 12 Maths (Https://Byjus.Com/Cbse-Study-
Material/Last-Year-Question-Paper-Cbse-Class-12-Maths/)

CBSE Previous Year Question Papers Class 10 Maths (Https://Byjus.Com/Cbse-Study-


Material/Class-10-Maths-Previous-Year-Papers/)

(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
ICSE Sample Papers
DOWNLOAD
App NOW
ICSE Sample Papers Class 8 Maths (Https://Byjus.Com/Icse-Sample-Papers-For-Class-8-Maths/)

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 9/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

ICSE Sample Papers Class 9 Maths (Https://Byjus.Com/Icse-Sample-Paper-For-Class-9-Maths/)

ICSE Sample Papers Class 10 Maths (Https://Byjus.Com/Icse-Class-10-Maths-Sample-Papers/)

ISC Sample Papers Class 11 Maths (Https://Byjus.Com/Isc-Sample-Paper-Class-11-Maths/)

ISC Sample Papers Class 12 Maths (Https://Byjus.Com/Isc-Sample-Papers-For-Class-12-Maths/)

ICSE Previous Year Question Papers


ICSE Previous Year Question Papers Class 10 (Https://Byjus.Com/Icse-Class-10-Maths-Previous-
Year-Question-Papers/)

ISC Previous Year Question Papers Class 12 Maths (Https://Byjus.Com/Isc-Class-12-Maths-


Previous-Year-Question-Papers/)

BYJU'S Tuition Centre for Class 4 to 10


Class 10 Tuition Centre (Https://Byjus.Com/Btc/Class-10-Tuition/)

Class 9 Tuition Centre (Https://Byjus.Com/Btc/Class-9-Tuition/)

Class 8 Tuition Centre (Https://Byjus.Com/Btc/Class-8-Tuition/)

Class 7 Tuition Centre (Https://Byjus.Com/Btc/Class-7-Tuition/)

Class 6 Tuition Centre (Https://Byjus.Com/Btc/Class-6-Tuition/)

Class 5 Tuition Centre (Https://Byjus.Com/Btc/Class-5-Tuition/)

Class 4 Tuition Centre (Https://Byjus.Com/Btc/Class-4-Tuition/)

(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 10/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

(https://byjus.com/learn/home?utm_source=byjus.com&utm_medium=maths-
askadoubt&utm_campaign=Ask_A_Doubt)

Join BYJU'S Learning Program

Name

Mobile Number

(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
City
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 11/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

Grade/Exam

Email Address

Submit

Comments
Leave a Comment
Your Mobile number and Email id will not be published. Required fields are marked *
*

Mobile Number Send OTP

Type your message or doubt here...

Post My Comment

COURSES EXAMS

CBSE (/cbse/) CAT Exam (/cat/exam-info/)

ICSE (/icse/) CAT 2023 (/cat/cat-2023/)

CAT (/cat/) GATE Exam (/gate/gate-exam/)

IAS (/ias/) IAS Exam (/ias-exam/)

JEE (/jee/) UPSC Exam (/free-ias-prep/upsc-exam/)

NEET (/neet/) UPSC Syllabus (/ias/upsc-syllabus/)

Commerce (/commerce/) UPSC 2023 (/free-ias-prep/upsc-2023/)


(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
JEE
App Main
NOW (/jee/jee-main/) Bank Exam (/bank-exam/)

NCERT (/ncert/) Government Exams (/govt-exams/)

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 12/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

JEE Advanced (/jee-advanced/) Education News (/news/)

UPSC Prelims 2022 Question Paper (/free-ias-prep/upsc-prelims-2022-


question-papers-pdf/) CLASSES
UPSC Prelims 2022 Answer Key (/free-ias-prep/upsc-prelims-answer-
Kids Learning (/kids-learning/)
key-2022/)
Class 1st - 3rd (/disney-byjus-early-learn/)
IAS Coaching (/ias-coaching/)
Class 4th - 5th (/class-4-5/)
CBSE Sample Papers (/cbse/cbse-sample-papers/)
Class 6th - 10th (/class-6-10/)
CBSE Question Papers (/cbse-study-material/cbse-previous-year-
question-paper/) Class 11th - 12th (/class-11-12/)

BYJU'S Tuition Centre (/btc/)

EXAM PREPARATION COMPANY

Free CAT Prep (/free-cat-prep/) About Us (/about-us/)

Free IAS Prep (/free-ias-prep/) Contact Us (/contact-us/)

Maths (/maths/) Contact our Financial Partners


(https://byjus.com/our-financial-partners/)
Physics (/physics/)
Investors (/our-investors/)
Chemistry (/chemistry/)
Careers (/careers-at-byjus/)
Biology (/biology/)
BYJU'S in Media (/press/)
JEE 2023 (/jee/jee-2023/)
Social Initiative - Education for All
JEE Main Mock Test (/jee/jee-main-mock-test/)
(/educationforall/)
JEE Main 2023 Question Papers with Answers (/jee/jee-main-2023-
BYJU'S APP (/byjus-the-learning-app/)
question-papers/)
FAQ (/faq/)
JEE Main 2022 Question Papers with Answers (/jee/jee-main-2022-
question-papers/) Students Stories - The Learning Tree
(https://blog.byjus.com/the-learning-tree/)
JEE Advanced 2022 Question Paper with Answers (/jee/jee-advanced-
2022-question-paper/) Support (/customer-care/)

NEET 2022 Answer Key (/neet/neet-2022-answer-key/) Faces of BYJU'S – Life at BYJU'S


(https://blog.byjus.com/life-at-byjus/)

RESOURCES Blog (https://blog.byjus.com/)

BYJU'S Give (/give/)


Worksheets (/worksheets/)

BYJU'S Answer (/question-answer/)

DSSL (/about-dssl/)

Home Tuition (/home-tuition/)

All Products (https://shop.byjus.com)

Calculators (/calculators/)

Formulas (/formulas/)

FREE TEXTBOOK SOLUTIONS STATE BOARDS

(/textbook-solutions/) Maharashtra (/msbshse/)


(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
NCERT Solutions (/ncert-solutions/)
App NOW Gujarat (/gseb/)
NCERT Exemplar (/ncert-exemplar/)
Tamil Nadu (/tn-board/)

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 13/14
4/24/23, 1:35 PM Least Square Method - Definition, Graph and Formula

NCERT Solutions for Class 6 (/ncert-solutions-class-6/) Karnataka (/kseeb/)

NCERT Solutions for Class 7 (/ncert-solutions-class-7/) Kerala (/kbpe/)

NCERT Solutions for Class 8 (/ncert-solutions-class-8/) Andhra Pradesh (/ap-board/)

NCERT Solutions for Class 9 (/ncert-solutions-class-9/) Telangana (/telangana-board/)

NCERT Solutions for Class 10 (/ncert-solutions-class-10/) Uttar Pradesh (/upmsp/)

NCERT Solutions for Class 11 (/ncert-solutions-class-11/) Bihar (/bihar-board/)

NCERT Solutions for Class 11 English (/ncert-solutions-class-11- Rajasthan (/rajasthan-board/)


english/)
Madhya Pradesh (/mp-board/)
NCERT Solutions for Class 12 English (/ncert-solutions-class-12-
West Bengal (/west-bengal-board/)
english/)

NCERT Solutions for Class 12 (/ncert-solutions-class-12/)

RD Sharma Solutions (/rd-sharma-solutions/)

RD Sharma Class 10 Solutions (/rd-sharma-class-10-solutions/)

ICSE Selina Solutions (/icse/selina-solutions/)

FOLLOW US

(https://www.facebook.com/byjuslearningapp/) (https://in.linkedin.com/company/byjus)

(https://www.kidsafeseal.com/certifiedproducts/byjus_india.html)

Disclaimer (/disclaimer/) Privacy Policy (/tnc_app/#privacydesc) Terms of Services (/tnc_app/#tncdesc)


Sitemap (/sitemap.xml)

© 2023, BYJU'S. All rights reserved.

(https://btla-androidk12.onelink.me/8UMP/aba9d0ff)
DOWNLOAD
App NOW

https://byjus.com/maths/least-square-method/#:~:text=The least square method is,the points from the curve. 14/14

You might also like