# Curve Fit.

• June 26th 2010, 06:13 PM
beezee99
Curve Fit.
Hi All
Thanks for your previous help Ackbeet. Now I have the following data.
Attachment 18006
I wish to fit a power law curve to it of the following type (first equation).
Attachment 18007
I am particularly interested in getting the exponent n. However, doing as in second and third equations above, I get variable n (y and x do not get linear even on log scale). I was expecting a constant value like in half life. Any suggestions?
Thanks.
• June 26th 2010, 06:21 PM
Ackbeet
Are you interested in doing a least squares regression?
• June 26th 2010, 06:33 PM
beezee99
I need the value of exponent "n" by any means. However, I must know the procedure so that I use the same method of getting n for future experiments. The best fit for the given data in Origin Pro comes in the form of
Attachment 18011
Which to me is not very helpful for my situation. Any clues?

Thanks.
• June 26th 2010, 06:51 PM
Ackbeet
Ok, here's what I would do. You've got yourself a data set $\{x_{j},y_{j}\}$. You assume a model of the form $y=kx^{-n}$. Your goal is to find k and n. You set up your square error as follows: let

$E=\sum_{j=1}^{N}(y_{j}-k x_{j}^{-n})^{2}.$

In general, for a model of the form $y=f(x)$, you'd let

$E=\sum_{j=1}^{N}(y_{j}-f(x_{j}))^{2}.$

Your goal is to minimize $E$ by varying $k$ and $n$. How do you do that? Basically, it's the ol' Calc 1 method: take the derivative and set it equal to zero. Only in this case, you've got two derivatives. So, set

$\frac{\partial E}{\partial k}=0$ and

$\frac{\partial E}{\partial n}=0$.

Use these two equations to solve for $k$ and $n$.

Then you'll have a formula you can plug into Excel or whatever. How does that sound? This method is known as the least squares method.
• June 27th 2010, 06:49 PM
beezee99
Hi. Thanks for the mathematics Ackbeet. Now may I know the physical reason behind the SIGMOID (DOSE-RESPONSE) type curve which best fits to my data. I mean how may I correlate it to some physical phenomenon in real so that I may be able to imagine the process evolution.
Thanks.
• June 28th 2010, 12:59 AM
Ackbeet
Question: is this a diffusion problem? Or can you model the physical situation with the heat/diffusion equation?
• July 4th 2010, 04:38 PM
beezee99
Question: is this a diffusion problem? Or can you model the physical situation with the heat/diffusion equation?

Answer: Although I am not applying typical differential equations to model the system, however, it may in principle be said that the problem is diffusion type as particles will diffuse from concentrated region to the dilute region. What if it were not a diffusion type problem?
• July 5th 2010, 04:39 AM
Ackbeet
If it is a diffusion type problem, then the diffusion equation does apply. Depending on how complicated the physical situation is, you can get an analytical solution to the diffusion equation for how fast the particles will diffuse into the dilute region. It will likely be an infinite series solution; if you take the first 20 terms of that solution, you will find that you have a sigmoid curve. So the physical explanation for the sigmoid curve is that it is the solution to the differential equation governing your physical process. Make sense?
• July 5th 2010, 03:38 PM
beezee99
Dear Ackbeet.
Thanks for the response. It makes sense that the sigmoid curve is the solution to the differential equation. However, I wanted to know the explanation in the sense given at 33. I mean when we look at the curve, it seems to grow slowly in the beginning, then grows very quickly and then slows down. That is what I am seeking when I say physical interpretation.
Thanks.
• July 6th 2010, 12:09 PM
Ackbeet
I don't know the exact physical process you're dealing with. The problem I solved was a skin patch with a drug in it (as nicotene). Initially, your patch has to get used to the idea of having a region of lower drug density. That's why you don't get an instantaneous jump in the time derivative of the concentration when you first apply the patch. Then there's a transition to a high-rate-of-transfer region, where the patch starts delivering drug at its capacity rate. Finally, the patch starts to deplete, and thus the difference between the patch concentration and the skin concentration lessens; this reduces the transfer rate.

This is not the most rigorous explanation, but perhaps it'll steer you in the right direction.