Institut für Astronomie und AstrophysikAbteilung AstronomieWaldhäuser Str. 64, D-72076 Tübingen, Germany |
SPLINE_SMOOTH
Compute a cubic smoothing spline to (weighted) data
Construct cubic smoothing spline (or give regression solution) to given data with minimum "roughness" (measured by the energy in the second derivatives) while restricting the weighted mean square distance of the approximation from the data. The results may be written to the screen or a file or both and are optionally returned in the parameters. The results may be optionally displayed graphically.
SPLINE_SMOOTH,X,Y,Yerr,distance, [coefficients,smoothness,xplot,yplot [ XTITLE= ,YTITLE=, INTERP=, TEXTOUT=,/SILENT,/PLOT,/ERRBAR]
X - N_POINT element vector containing the data abcissae Y - N_POINT element vector containing the data ordinates Yerr - estimated uncertainty in ordinates ( positive scalar) distance - upper bound on the weighted mean square distance of the approximation from the data (non-negative scalar)
xplot - vector of spline evaluation abcissae
TEXTOUT - Controls print output device, defaults to !TEXTOUT textout=1 TERMINAL using /more option textout=2 TERMINAL without /more option textout=3.prt textout=4 laser.tmp textout=5 user must open file textout = filename (default extension of .prt)
coefficients - N_POINT x 4 element array containing the sequence of spline coefficients including the smoothed ordinates. smoothness - N_POINT element vector containing the energy in second derivatives of approximated function. yplot - vector of evaluated spline ordinates.
/SILENT - suppress all printing. /PLOT - display smooth curve, data ordinates and error bars /ERRBAR - display error bars XTITLE - optional title for X-axis YTITLE - optional title for Y-axis INTERP - optionally returned interpolated smooth spline
This procedure constructs a smoothing spline according to the method described in "Fundamentals of Image Processing" by A. Jain [Prentice- Hall : New Jersey 1989]. If the distance parameter is sufficiently large a linear regression is performed, otherwise a cubic smoothing spline is constructed. This procedure assumes regular sampling and independent identically distributed normal errors without missing data. The data are sorted. SPLINE_SMOOTH uses the non-standard system variables !TEXTOUT and !TEXTUNIT. These can be added to one's session using the procedure ASTROLIB.
None.
Obtain coefficients of a univariate smoothing spline fitted to data X,Y assuming normally distributed errors Yerr and write the results to a file. IDL> SPLINE_SMOOTH, X, Y, Yerr, distance, coefficients, smoothness, t='spline.dat' Fit a smoothing spline to observational data. Suppress all printing and save the smoothed ordinates in output variables. Display results. IDL> SPLINE_SMOOTH, X, Y, Yerr, distance, coefficients, /SILENT, /PLOT
Procedures TEXTOPEN, TEXTCLOSE, PLOT, PLOTERROR
This procedure is damn slow and should probably be rewritten using the Cholesky decomposition.
Immanuel Freedman (after A. Jain). December, 1993 REVISIONS January 12, 1994 I. Freedman (HSTX) Adjusted formats March 14, 1994 I. Freedman (HSTX) Improved convergence March 15, 1994 I. Freedman (HSTX) User-specified interpolates Converted to IDL V5.0 W. Landsman September 1997 Call PLOTERROR instead of PLOTERR W. Landsman February 1999
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]