comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » routine for geometric mean regression
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
routine for geometric mean regression [message #28278] Fri, 30 November 2001 13:40 Go to next message
john.b.miller is currently offline  john.b.miller
Messages: 2
Registered: November 2001
Junior Member
I've searched the various online libraries to no avail...
Does anyone know of or have a geometric mean regression routine?

I have the routine 'fitexy.pro' and am aware of the IDL version of
ODRpack. These do what I need (fit a line with errors in y AND x), but
I'd like to compare these with the geometric mean approach.

Thanks
Re: routine for geometric mean regression [message #28368 is a reply to message #28278] Sun, 02 December 2001 21:47 Go to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
John Miller wrote:

> Does anyone know of or have a geometric mean regression routine?
>
> I have the routine 'fitexy.pro' and am aware of the IDL version of
> ODRpack. These do what I need (fit a line with errors in y AND x), but
> I'd like to compare these with the geometric mean approach.

If I understand what you mean by "geometric mean" correctly, then the
following 3 lines of IDL should do it. I assume you have data (X,Y)
with corresponding error bars SIGX and SIGY

resulty = linfit(x,y,sdev = sigy) ;Fit Y vs. X using Y error
bars
resultx = linfit(y,x,sdev = sigx) ;Fit X vs. Y using X error
bars
slope = sqrt(resulty[1]/resultx[1]) ;Take geometric mean of two slope
determinations

But, as you note, the correct way to fit a straight line with errors in
both coordinates is given by the procedure
http://idlastro.gsfc.nasa.gov/ftp/pro/math/fitexy.pro

Wayne Landsman landsman@mpb.gsfc.nasa.gov
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Humble request
Next Topic: Setting history size in idlwave

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 10:57:08 PDT 2025

Total time taken to generate the page: 0.12790 seconds