Chat with us, powered by LiveChat Least Squares Method 1 - Writeedu

Least Squares Method 1

Least Squares Method

1

Goals: To determine the best linear approximation to a set of data pairs (x,y) using the Least Squares Method.

Requirements: Basic algebra and some knowledge of graphing, plotting data, and straight lines and slopes.

Questions: Total of 10 questions in this Lab. Background: Often in physics, data follows a linear trend that if all the data were measured

correctly, the data would lie on a straight line. In real life, however, measuring data can involve uncertainties due to the measuring process causing a scattering in the data. A line of best fit can be roughly determined using an eyeball method by drawing a straight line through as many points as possible, as shown below1.

 

 

The red line is said to model the data – it is the best fit that represents all the data, that is, the trend of the data. A straight line follows the linear equation

? = ?? + ? [1]

Where x is the independent variable, m is the slope of the line, and b is the y- intercept (where the line intercepts the y axis when x = 0). For the line above, we see clearly that b = 5.0, and the slope m is approximately 0.14, calculated from

? = ?2 − ?1 ?2 − ?1

 

For example, selecting two points on the line, say (0,5) and (35,10), we see the slope is

? = 10 − 5

35 − 0 = 0.14

Equation 1 for the data becomes

? = 0.14? + 5

 

 

Least Squares Method

2

Rather than use the eyeball method, a better approximation can be obtained using analytical methods. Analytical methods are useful when the dataset is large, and the methods provide a more accurate and consistent approximation. The following procedure is called the Least Square Method and can be applied to any number of n ordered (x,y) data pairs:

? = ∑ ?? −

(∑ ?)(∑ ?) ?

∑ ?2 − (∑ ?)2

?

[2]

 

? = �̅� − ?�̅� = ∑ ?

? − ?

∑ ?

? [3]

For example, consider the following n = 4 (x,y) data pairs:

 

x y

1 1.2

2 2.5

3 3.4

4 4.1

n = 4 ∑ ? = 1 + 2 + 3 + 4 = 10 ∑ ? = 1.2 + 2.5 + 3.4 + 4.1 = 11.2 ∑ ?? = (1)(1.2) + (2)(2.5) + (3)(3.4) + (4)(4.1) = 32.8 ∑ ?2 = 12 + 22 + 32 + 42 = 30

(∑ ?) 2

= 102 = 100

And we see from Equation 2 that

? = 32.8 −

(10)(11.2) 4

30 − 100

4

= 0.96

And from Equation 3 that

 

? = 11.2

4 − (0.96)

10

4 = 0.4

 

We can now model our data using Equation 1 that is the best fit for the data

 

? = 0.96? + 0.4

Below is a graph of the data along with fitted line

 

 

Least Squares Method

3

 

We see from the graph that when x = 0, y =0.4. Our model allows us to predict values beyond our dataset if we know the data will follow the trend of the first four data pairs.

1. Setup:

Consider the following dataset consisting of n = 10 (x,y) pairs:

x y xy x2

8 3

2 10

11 3

6 6

5 8

4 12

12 1

9 4

6 9

1 14

?? = ?? = ??? = ??? =

a. Fill in the table (white cells) calculating for each data pair xy and x2 values. b. Finally, sum each column and fill in the yellow cells.

 

 

 

 

Least Squares Method

4

2. Exercises: a. Question # 1: What is your answer for ?? ? b. Question # 2: What is your answer for ?? ? c. Question # 3: What is your answer for ??? ? d. Question # 4: What is your answer for ??? ?

Given the results in questions #1 through #4 and n = 10, we can now model the data

e. Question # 5: Using Equation 2, what is the slope m ? f. Question # 6: Using Equation 3, what is the y-intercept b ?

At this point knowing m and b, we have modeled the data and have determined Equation 1:

? = ?? + ?

Let’s now, plot the data and compare/check our results

Click here to bring up the laboratory Activity in another window

If the above link does not work, please copy the following URL into a browser: https://phet.colorado.edu/sims/html/least-squares-regression/latest/least-squares-regression_en.html

You should see this:

 

3. Setup: a. Ensure all options are selected and checked as shown below (Custom and additional grid

lines checked).

 

b. Drag all 10 data points from the bucket of points (bottom left) on to the graph, estimating

as best as possible the position of the (x,y) pair on the graph.

 

 

Least Squares Method

5

Your plot of the data should look similar to the following:

 

c. Click on Best-Fit Line button (left top). d. Select Best-Fit Line as show below to see the slope m and y-intercept b

 

 

4. Exercises: a. Question # 7: What value of slope m did the graphing program return? b. Question # 8: What value of y-intercept b did the graphing program return?

Calculate the percent difference in the slope from your value found in Question 5 to the value computed by the graphing program:

??????? ?????????? = ???????? #7 ????? − ???????? #5 ?????

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteEdu. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

Do you need help with this question?

Get assignment help from WriteEdu.com Paper Writing Website and forget about your problems.

WriteEdu provides custom & cheap essay writing 100% original, plagiarism free essays, assignments & dissertations.

With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.

Chat with us today! We are always waiting to answer all your questions.

Click here to Place your Order Now