• Support PF! Buy your school textbooks, materials and every day products Here!

Find the least squares approximation

  • Thread starter hsong9
  • Start date
  • #1
80
1

Homework Statement


Suppose a set of N data points {(xk,yk)}Nk=1 appears to satisfy the relationship for some constants a and b. Find the least squares approximations for a and b.


Homework Equations





The Attempt at a Solution


I really have no idea about this problem.
 

Answers and Replies

  • #2
fzero
Science Advisor
Homework Helper
Gold Member
3,119
289
You don't say what the relationship is, but let's say it's some function that we'll call [tex]y=f(x,a,b)[/tex]. The object of a least squares fit is to find [tex]a[/tex] and [tex]b[/tex] such that the sum of squares

[tex] S = \sum_{k-1}^N (y_k - f(x_k,a,b))^2[/tex]

is minimized.
 
  • #3
80
1
Thanks!
the relationship is y = ax + b/x.
Thus, S = Sigma ( y_k - (ax + b/x))^2, right?
and that's it?
 
  • #4
fzero
Science Advisor
Homework Helper
Gold Member
3,119
289
Thanks!
the relationship is y = ax + b/x.
Thus, S = Sigma ( y_k - (ax + b/x))^2, right?
and that's it?
S = Sigma ( y_k - (a x_k + b/x_k))^2

and you must minimize this as a function of a and b.
 
  • #5
80
1
Thanks!
So, to minimize S, set partial derivative for a and b equals to zero.
right?
Thanks again.
 

Related Threads on Find the least squares approximation

  • Last Post
Replies
7
Views
709
  • Last Post
Replies
1
Views
1K
Replies
2
Views
671
  • Last Post
Replies
3
Views
1K
Replies
1
Views
801
  • Last Post
Replies
4
Views
983
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
3
Views
948
  • Last Post
Replies
8
Views
2K
  • Last Post
Replies
1
Views
1K
Top