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

Home » Public Forums » archive » yband help
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
yband help [message #76998] Mon, 18 July 2011 16:30
Tim Bovaird is currently offline  Tim Bovaird
Messages: 4
Registered: March 2011
Junior Member
I'm trying to plot the 68% and 95% standard deviation bands for a fit
I have using poly_fit. In the example below my points form a
polynomial on a log-log plot. x, y and y_err are converted to log
before the fit is calculated then converted back to linear because the
plot is called with the /xlog and /ylog keywords.

xfitlog=findgen(80)/8
logfit=poly_fit(x, y, 3, MEASURE_ERRORS=y_err, YBAND=yband)
yfitlog=logfit[0]+logfit[1]*xfitlog
+logfit[2]*xfitlog^2+logfit[3]*xfitlog^3
yfitlog_errHi=yfitlog+yband
yfitlog_errLo=yfitlog-yband

plot, 10^x, 10^y, /xlog, /ylog
oplot, 10^xfitlog, 10^yfitlog, color=cgcolor('red4'), thick=3
oplot, 10^xfitlog, 10^yfitlog_errHi
oplot, 10^xfitlog, 10^yfitlog_errLo

From the definitions in poly_fit, the fit has a 1 standard deviation
error (68%) of + or - yband. However in my above example, the + and -
errors lie right on top of the fit. Is there something I have done
wrong? Is there a way to also get the 95% errors?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: List->toArray() with structures in IDL 8.1
Next Topic: percentile with dimension keyword

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

Current Time: Wed Oct 08 09:22:25 PDT 2025

Total time taken to generate the page: 0.00566 seconds