- #1
Duo Who Ow
- 4
- 0
Homework Statement
I have the following data which I would like to model using an exponential function of the form y = A + Becx.
Using wolfram mathematica, solving for these coefficients was computed easily using the findfit function. I was tasked however to implement this using java and have come to this forum for help.
Data
X Y
10 88.822
20 45.607
30 26.407
40 18.004
50 12.504
60 10.878
70 8.229
80 8.032
90 6.674
100 6.927
110 6.146
120 6.18
130 6.19
140 5.454
150 5.698
160 5.249
Homework Equations
y = A + Becx
The Attempt at a Solution
[/B]
https://www.physicsforums.com/threads/exponential-least-squares-method.845240/
https://commons.apache.org/proper/commons-math/userguide/leastsquares.html
http://math.stackexchange.com/questions/1337601/fit-exponential-with-constant
From the information provided in the three links above, to solve my problem I would need to solve the three partial derivatives using an appropriate initial guess. From my limited understanding, I could potentially use a number around 5.5 as an initial guess for c which would reduce the iterations required to find an optimal solution.
However, I do not understand how to generate the 'model function' which is used by the least squares engine to evaluate the components. I have seen a few examples of generating the model function however I do not fully grasp how it is generated. A link below are additional examples. Hoping I can obtain assistance from you wonderful people. Thank you.
http://www.programcreek.com/java-ap...ath3.fitting.leastsquares.LeastSquaresProblem
PS - Sorry for the formatting, I could not find the relevant options to insert a table.