Power Curve fitting SLope and intercept different than Excel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Power Curve fitting SLope and intercept different than Excel

Sharad Bansal
Hi,
    We are using the ij Curvefitrter class and using it for fitting curve using linear and power options. While linear fitting gives back the slope and intercept values same as when we add trendline to same set of data in Excel and get equation nfrom excel for slope and intercept, in case of power fitting, the values are different than the ones coming from trendline equation generated in Excel for same set of data.

Is this a known issue in CurveFitter or Excel? I need an answer quickly for this,kindly help.

Thanks,
Sharad
Reply | Threaded
Open this post in threaded view
|

Re: Power Curve fitting SLope and intercept different than Excel

Cammer, Michael
Years ago, when trying to fit time correlated FLIM data, we found that Excel was really, really wrong. [For single exponential decay, ImageJ was great.]
 
And even if you dismiss my judgment as really really wrong, certainly Excel's algorithms are different.

-Michael

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Sharad Bansal
Sent: Thursday, May 19, 2011 12:49 PM
To: [hidden email]
Subject: Power Curve fitting SLope and intercept different than Excel

Hi,
    We are using the ij Curvefitrter class and using it for fitting curve using linear and power options. While linear fitting gives back the slope and intercept values same as when we add trendline to same set of data in Excel and get equation nfrom excel for slope and intercept, in case of power fitting, the values are different than the ones coming from trendline equation generated in Excel for same set of data.

Is this a known issue in CurveFitter or Excel? I need an answer quickly for this,kindly help.

Thanks,
Sharad

------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================
Reply | Threaded
Open this post in threaded view
|

Re: Power Curve fitting SLope and intercept different than Excel

Nathaniel Ryckman
In reply to this post by Sharad Bansal
Here is a little tip.

If you go to a doctor and the doctor makes a diagnosis that is severe, might you not seek a second opinion just in case? This is an easy way you can test the reliability of computer software that you use.

Also, the general rule of thumb is that software that is more widely used is going to have gone through more testing than obscure software.

So, in this case, here are a couple things you can do:
1) Compare excel with TI-89 (if it's just curve fitting) or use Mathematica/Matlab/Maple
2) Google "imagej CurveFitter error" and "excel trendline error"

In this case, I would guess that the rule of thumb is wrong because of this discussion I found by Googling:

http://www.pcreview.co.uk/forums/error-trendline-equation-3rd-order-and-higher-polynomials-t3830270.html

"As I recall, there are some issues with graph trendlines in 2007, but another
common problem is failure to display enough figures to have any chance of
calculating effectively with them. I'm not sure about 2007, but in previous
versions, you could right click on the equation and format to display in
scientific notation with 14 decimal places.

Also note that you can fit polynomials with LINEST. For example, to fit a
cubic with intercept forced to be 0, you would select 3 adjacent cells and
array enter the formula
=LINEST(y,x^{1,2,3},FALSE)

Jerry"
Reply | Threaded
Open this post in threaded view
|

Re: Power Curve fitting SLope and intercept different than Excel

Michael Schmid
In reply to this post by Cammer, Michael
Hi Sharad, Michael,

when fitting an exponential y=a*exp(b*x), you have two options:

(1) Minimize least squares between the experimental y values and those
from the equation. That's what ImageJ does.

(2) Take the logarithm of y, then fit a straight line, minimizing the
square deviation of the logarithms:
  ln y = ln a + b*x
Many programs do it this way. If you want to get this result from ImageJ,
simply calculate the logarithm of your y values, do a linear fit, and take
exp of the intercept as 'a' value.

Similar for power laws, y = a x^b: Many programs do a linear regression of
the logarithms, i.e., minimizing the mean square deviation of the
logarithms:
ln y = ln a + b ln x

Michael
___________________________________________________________


On Thu, May 19, 2011 20:11, Cammer, Michael wrote:

> Years ago, when trying to fit time correlated FLIM data, we found that
> Excel was really, really wrong. [For single exponential decay, ImageJ was
> great.]
>
> And even if you dismiss my judgment as really really wrong, certainly
> Excel's algorithms are different.
>
> -Michael
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Sharad Bansal
> Sent: Thursday, May 19, 2011 12:49 PM
> To: [hidden email]
> Subject: Power Curve fitting SLope and intercept different than Excel
>
> Hi,
>     We are using the ij Curvefitrter class and using it for fitting curve
> using linear and power options. While linear fitting gives back the
> slope and intercept values same as when we add trendline to same set
> of data in Excel and get equation nfrom excel for slope and intercept,
> in case of power fitting, the values are different than the ones
> coming from trendline equation generated in Excel for same set of
> data.
>
> Is this a known issue in CurveFitter or Excel? I need an answer quickly
> for this,kindly help.
>
> Thanks,
> Sharad
>
Reply | Threaded
Open this post in threaded view
|

Re: Power Curve fitting SLope and intercept different than Excel

Prodanov Dimiter
In reply to this post by Sharad Bansal
Dear Sharad,

The IJ curve fitter uses the Simplex algorithm. You can also try using the Levenberg–Marquardt algorithm (LMA package)
http://imagejdocu.tudor.lu/doku.php?id=plugin:filter:mri_processor:start

best regards,

D Prodanov

-----Original Message-----
From: Sharad Bansal [mailto:[hidden email]]
Sent: Thursday 19 May 2011 18:49
Subject: Power Curve fitting SLope and intercept different than Excel

Hi,
    We are using the ij Curvefitrter class and using it for fitting curve using linear and power options. While linear fitting gives back the slope and intercept values same as when we add trendline to same set of data in Excel and get equation nfrom excel for slope and intercept, in case of power fitting, the values are different than the ones coming from trendline equation generated in Excel for same set of data.

Is this a known issue in CurveFitter or Excel? I need an answer quickly for this,kindly help.

Thanks,
Sharad
Reply | Threaded
Open this post in threaded view
|

Re: Power Curve fitting SLope and intercept different than Excel

Sharad Bansal
In reply to this post by Michael Schmid
Thanks Michael,
     The second method method did the trick. It is same as excel if I follow the 2nd approach.

Thanks,

Sharad Bansal
     Development Manager, Servigistics India
 Servigistics Development India Pvt. Ltd.
     604-607, 6th Floor, Tower B, Unitech Cyber Park
     Sector 39, Gurgaon, Haryana - 122001
M: +91.9953758832
F: +91.124.4763555
www.servigistics.com


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Michael Schmid
Sent: Friday, May 20, 2011 2:18 AM
To: [hidden email]
Subject: Re: Power Curve fitting SLope and intercept different than Excel

Hi Sharad, Michael,

when fitting an exponential y=a*exp(b*x), you have two options:

(1) Minimize least squares between the experimental y values and those
from the equation. That's what ImageJ does.

(2) Take the logarithm of y, then fit a straight line, minimizing the
square deviation of the logarithms:
  ln y = ln a + b*x
Many programs do it this way. If you want to get this result from ImageJ,
simply calculate the logarithm of your y values, do a linear fit, and take
exp of the intercept as 'a' value.

Similar for power laws, y = a x^b: Many programs do a linear regression of
the logarithms, i.e., minimizing the mean square deviation of the
logarithms:
ln y = ln a + b ln x

Michael
___________________________________________________________


On Thu, May 19, 2011 20:11, Cammer, Michael wrote:

> Years ago, when trying to fit time correlated FLIM data, we found that
> Excel was really, really wrong. [For single exponential decay, ImageJ was
> great.]
>
> And even if you dismiss my judgment as really really wrong, certainly
> Excel's algorithms are different.
>
> -Michael
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Sharad Bansal
> Sent: Thursday, May 19, 2011 12:49 PM
> To: [hidden email]
> Subject: Power Curve fitting SLope and intercept different than Excel
>
> Hi,
>     We are using the ij Curvefitrter class and using it for fitting curve
> using linear and power options. While linear fitting gives back the
> slope and intercept values same as when we add trendline to same set
> of data in Excel and get equation nfrom excel for slope and intercept,
> in case of power fitting, the values are different than the ones
> coming from trendline equation generated in Excel for same set of
> data.
>
> Is this a known issue in CurveFitter or Excel? I need an answer quickly
> for this,kindly help.
>
> Thanks,
> Sharad
>
Reply | Threaded
Open this post in threaded view
|

Re: Power Curve fitting SLope and intercept different than Excel

Rodrigo Gonçalves-4
Just as a comment: As a general rule, I wouldn't assume that "different from Excel" means "incorrect", as there are many known errors in several Excel's calculations.

I would first check with other programs, such as Gnumeric.

Best regards,
________________________

Rodrigo J. Gonçalves

 ________________________

--- El vie, 5/20/11, Sharad Bansal <[hidden email]> escribió:

De: Sharad Bansal <[hidden email]>
Asunto: Re: Power Curve fitting SLope and intercept different than Excel
A: [hidden email]
Fecha: viernes, 20 de mayo de 2011, 03:02 pm

Thanks Michael,
     The second method method did the trick. It is same as excel if I follow the 2nd approach.

Thanks,

Sharad Bansal
     Development Manager, Servigistics India
 Servigistics Development India Pvt. Ltd.
     604-607, 6th Floor, Tower B, Unitech Cyber Park
     Sector 39, Gurgaon, Haryana - 122001
M: +91.9953758832
F: +91.124.4763555
www.servigistics.com


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Michael Schmid
Sent: Friday, May 20, 2011 2:18 AM
To: [hidden email]
Subject: Re: Power Curve fitting SLope and intercept different than Excel

Hi Sharad, Michael,

when fitting an exponential y=a*exp(b*x), you have two options:

(1) Minimize least squares between the experimental y values and those
from the equation. That's what ImageJ does.

(2) Take the logarithm of y, then fit a straight line, minimizing the
square deviation of the logarithms:
  ln y = ln a + b*x
Many programs do it this way. If you want to get this result from ImageJ,
simply calculate the logarithm of your y values, do a linear fit, and take
exp of the intercept as 'a' value.

Similar for power laws, y = a x^b: Many programs do a linear regression of
the logarithms, i.e., minimizing the mean square deviation of the
logarithms:
ln y = ln a + b ln x

Michael
___________________________________________________________


On Thu, May 19, 2011 20:11, Cammer, Michael wrote:

> Years ago, when trying to fit time correlated FLIM data, we found that
> Excel was really, really wrong. [For single exponential decay, ImageJ was
> great.]
>
> And even if you dismiss my judgment as really really wrong, certainly
> Excel's algorithms are different.
>
> -Michael
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Sharad Bansal
> Sent: Thursday, May 19, 2011 12:49 PM
> To: [hidden email]
> Subject: Power Curve fitting SLope and intercept different than Excel
>
> Hi,
>     We are using the ij Curvefitrter class and using it for fitting curve
> using linear and power options. While linear fitting gives back the
> slope and intercept values same as when we add trendline to same set
> of data in Excel and get equation nfrom excel for slope and intercept,
> in case of power fitting, the values are different than the ones
> coming from trendline equation generated in Excel for same set of
> data.
>
> Is this a known issue in CurveFitter or Excel? I need an answer quickly
> for this,kindly help.
>
> Thanks,
> Sharad
>