Least Squares Fit for h(x)=ae^x+be^(-x) Homework

Click For Summary

Homework Help Overview

The discussion centers around finding the least squares fit for the function h(x) = ae^x + be^(-x) based on provided data points. The data consists of x values {1, 2, 3, 4, 6} and corresponding y values {14, 10, 8, 6, 5}.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation

Approaches and Questions Raised

  • The original poster attempts to linearize the equation by taking the natural logarithm, but questions whether this is the correct approach. Other participants clarify that linearization may not be necessary and suggest focusing on the least squares method directly.

Discussion Status

Participants are exploring different methods to approach the least squares fitting problem. Some guidance has been provided regarding the formulation of the error terms and the sum of squared errors, but there is no explicit consensus on the best method to proceed.

Contextual Notes

There is a discussion about the appropriateness of linearization and the method of finding the coefficients a and b, with some participants questioning the assumptions made in the original poster's approach.

rey242
Messages
40
Reaction score
0

Homework Statement


For the following data, find the least squares fit of the given form
x=1,2,3,4,6
y=14,10,8,6,5
h(x)=ae^x+be^(-x)

Homework Equations





The Attempt at a Solution


So I tried to linearize the equation by taking the natural log of everything
ln(h)=ln(ae^-x)+ln(be^ex)
ln(h)=ln(a)+ln(b)+x-x

that when I run into a problem, I eliminate the x's.
My question is, is there another way to linearize the equation or should I continue though?
 
Physics news on Phys.org
That's not right. In particular,
\ln (ae^{-x} + be^x) \neq \ln (ae^{-x}) + \ln (be^x)
 
There is no reason to linearize anything. Nor are you trying to fit the curve to those points- just the "least squares" fit.

If h(x)= ae^{x}+ be^{-x} then h(1)= ae+ be^{-1}. Since you are told that y= 14 when x= 1, the "error" is ae+ be^{-1}- 14 and the "error squared" is (ae+ be^{-1})^2. Similarly, for x= 2, y= 10, the "error squared" is (ae^2+ be^{-2}- 10)^2.

For all 5 x,y pairs, the sum of errors squared is (ae+ be^{-1}- 14)^2+ (ae^2+ be^{-2}- 10)^2+ (ae^3+ be^{-3}- 8)^2+ (ae^4+ be^{-4}- 6)^2+ (ae^6+ be^{-6}-5)^2. Find a and b to minimize that.
 
What procedure would I use to find a and b? I know about the error...would I convert the sum of the errors squared into normal equations?
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
4K
Replies
6
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
11
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
11K