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

Home » Public Forums » archive » Problem with REGRESS.PRO
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
Problem with REGRESS.PRO [message #56] Sat, 10 August 1991 21:51
landsman is currently offline  landsman
Messages: 93
Registered: August 1991
Member
We recently have been having trouble interpreting results using the REGRESS
function in the IDL User's Library. We found the culprit was that REGRESS
is not a faithful implementation of the Bevington function REGRES when one
is using relative weights. For example, the documentation to REGRESS says
that for no weighting one should set the weight vector W equal to 1 for all
points. This will give the correct function coefficients, but the incorrect
deviations of the coefficients (parameter SIGMA). The reason is that
REGRESS has to know that the input W vector contained relative weights, so
that it can estimate the "real" weights from the fitted data. This is done
with the MODE parameter in the Bevington routine.

As a tentative fix, we have added a keyword RELATIVE_WEIGHT to the function,
which one would include when the W vector contains relative weights. The
following line in the program

sigma = sqrt(array(indgen(nterm)*(nterm+1))/wmean/(nfree*sigmax^2))

is then changed to (c.f. Bevington p. 175)

IF KEYWORD_SET(relative_weight) then varnce = chisq $
else varnce = 1./wmean
sigma = sqrt(array(indgen(nterm)*(nterm+1))*varnce/(nfree*sigmax^2))

As a side remark, I wish the visual appearance and program comments of some
of the User Library routines were cleaned up. (FIX THOSE PROGRAMS WRITTEN IN
ALL CAPS.) It's not a big deal, but these program often serve as the
main examples while learning to program in IDL
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Defining system variables
Next Topic: idl and mac-xwindows

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

Current Time: Wed Oct 08 15:33:26 PDT 2025

Total time taken to generate the page: 0.00460 seconds