last day (15 days later) » 

11:32 AM
2
A: How do I fit $f(x) = \exp(a+bx+cx^2 +dx^3)$ to two points? $x, f(x)$ and $f'(x)$ are known.

Claude LeiboviciYou have $$y = \exp(a+bx+cx^2 +dx^3)$$ $$y'=(b+2cx+3dx^2)\,\exp(a+bx+cx^2 +dx^3)$$ and you know ($x_1,y_1,y'_1$), ($x_2,y_2,y'_2$) so the four equations are $$y_1 = \exp(a+bx_1+cx_1^2 +dx_1^3)$$ $$y_1'=(b+2cx_1+3dx_1^2)\,\exp(a+bx_1+cx_1^2 +dx_1^3)$$ $$y_2 = \exp(a+bx_2+cx_2^2 +dx_2^3)$$ $$y_2'=(...

 
Hi Claude, thank you for that. I should have spotted the y' there myself. I've implemented your method in fortran and I'll try to post that here. Thank you again!
 
You are very welcome ! If you see what I added, you have the analytical formulae for $d,c,b,a$ in a cascaded manner. Glad to know you code in Fortran (I started in 1960 and this is my only programming language). Cheers.
 
Hi Claude, that's great thank you. I've used a few languages, but I have to say I really enjoy Fortran. I can't paste the code here, but I've put a link to my website and I've credited you for your help. [link] (benblogging.co.uk/…)
 
Hi Ben ! Thanks for that. Let me confess : I speak in Fortran, I dream in Fortran ! When it was presented to me in 1960 by IBM trainers, it was supposed to be a curiosity ... with no future !
Hi Ben ! I visited your website. Interesting material, for sure. If I may suggest, there are much simpler ways to solve the double decay problem.
 
Hi Claude, I'd definitely be interested to know any other ways. Can the other methods be extended to three or more exponential terms? I was only born in 1983, but even with the other languages available I really enjoy using Fortran.
 
11:32 AM
Do you want to go to the chat room ?
 
Hi Claude
If I don't reply straight away, it's because my 2 year old has dragged me away from the computer! :)
 
OK, I am here ! Can we start ?
 
Sure
 
Let us speak about the fit of y=a Exp[b x]+c Exp[d x]. Fix b and d at a given value and perform the linear regression (which gives a and c. So, perform the grid only over b and d and keep the best point (at the same time, keep the correponding values of a and c). Now, start the nonlinear regression.d
 
Ok
 
11:47 AM
There are interesting stuff by JJAcquelin at MSE. He provides good approximative methods for this problem with no need of initial estimates. Do you know that ? He has books on line (in French). By the way, where are you ?
 
I'm in the UK. I can do a google search? In my latest attempt, I used LMA to fit it, but it is faster with a good starting point.
 
Search on MSE users and look at his answers on the topics of curve fit. Quite often we answer the same questions with different approaches.
 
I'm on his MSE page now :)
 
I'm just reading through them now, thank you :) I'll just open the second link
If I have some time tonight, I might have a go at rewriting my fortran function to include the regression part then lma part.
If I can write the code to match the method it'll help me to understand it more. Hopefully I'll be able to send a link to it if I'm successful
thank you for your help and the links, and I hope to speak to you again shortly
 
12:09 PM
In any case, I am very concerned by data regression (or curve fit). You can contact me at any time (my email address is in my profile). Cheers :-)
 
I haven't been working on it very long, but it is very satisfying to see a curve begin to fit data well. :)
 
I have to go now ! See you soon on the site.
 
Thank you, take care :)
 

last day (15 days later) »