Math and Statistics pro/math March 2002 _________ This directory contains IDL mathematics and statistics procedures thought to be of interest in astronomy. Fifteen of the procedures, are adapted from algorithms in "Numerical Recipes 2nd Edition" by Press, Flannery,Teukolsky, and Vetterling (1992, Cambridge University Press). These procedures are marked below with an "NR" The FORTRAN procedure names in "Numerical Recipes" are limited to 6 characters, and in some cases (e.g. MINF_PARABOLIC for BRENT) we have chosen more descriptive names for the equivalent IDL procedure. Additional IDL mathematics and statistics procedures developed by Henry Freudenreich (Hughes STX) are available in the contrib/freudenreich directory. These include procedures for LOWESS smoothing, robust fitting, bootstrap errors, and fitting to a plane. Also note the following mathematics procedures available at Craig Markwardt's site ( http://astrog.physics.wisc.edu/~craigm/idl/math.html ) CHEBFIT - Fit Chebyshev polynomial coefficients to a tabulated function CHEBEVAL - Evaluate a Chebyshev polynomial on an interval, given the coefficients CHEBCOEF - Estimate Chebyshev polynomial coefficients of a function on an interval MCHOLDC - Modified Cholesky Factorization of a Symmetric Matrix QPINT1D - One dimensional numerical adaptive integration of IDL function or expression --------- AVG() - Return the average value of an array or 1 dimension of an array. ASINH() - Return the inverse hyperbolic sine of its argument CIC - Cloud in Cell interpolation of irregularly gridded data onto a regular grid CSPLINE() - Interpolate using Numerical Recipes natural cubic spline FACTOR - Find the prime factors of a given number (in /jhuapl) FITEXY - Straight-line fit to data with errors in both coordinates FLEGENDRE() - Compute the first M terms in a Legendre polynomial expansion (FLEG in NR) GAUSSIAN() - Evaluate a 1-d Gaussian, and optionally its derivative HERMITE() - Interpolate a tabulated function using a Hermite spline KSONE - Compute the one-sided Kolmogorov statistic (NR) KSTWO - Compute the two-sided Kolmogorov statistic (NR) LINTERP - Linearly interpolate X,Y vectors onto a new X gri MEANCLIP - Compute an iteratively sigma-clipped mean on a data set MINF_BRACKET - Find 3 points which bracket a function minimum (MNBRAK in NR) MINF_PARABOLIC - Minimize a function using Brent's method with parabolic interpolation (BRENT in NR) MINF_PARABOL_D - Minimize a function using a modification of Brent's method which uses derivatives (DBRENT in NR) MINF_CONJ_GRAD - Find local minimum of a scalar valued function of several variables using conjugate gradient method (FRPRMN in NR) NGP - Nearest Grid Point interpolation of irregularly gridded data onto a regular grid PCA - Perform a principal component analysis PENT() - Return the information entropy S of time-series data for a set of trial periods POIDEV() - Generate a Poisson random deviate POLINT - Polynomial interpolation of an (X,Y) pair (NR) POLYLEG() - Evaluate a Legendre polynomial with specified coefficients POLY_SMOOTH() - Apply a least-squares (Savitzky-Golay) polynomial smoothing filter (SAVGOL in NR; also see SAVGOL introduced in IDL V5.4 ) PROB_KS - Return the significance of the K-S statistic (PROBKS in NR) RANDOMP - Create a vector of random numbers distributed as a power law QSIMP - Integrate using Simpson's rule to specified accuracy (NR) QTRAP - Integrate using trapezoidal rule to specified accuracy (NR) QUADTERP - Quadratic interpolation of X,Y vectors onto a new X grid SIXLIN - Compute linear regression by 6 different methods. SPLINE_SMOOTH - Compute cubic smoothing spline to weighted data TABINV - Find the effective index of a function value. TRAPZD - Compute Nth iteration of trapezoidal rule. Called by QSIMP, QTRAP (NR) TSC - Triangular Shaped Cloud interpolation of irregularly gridded data onto a regular grid TSUM() - Trapezoidal integration of the area under a curve VALUE_LOCATE() - find effective index of a function value (NR, locate) This emulates the intrinsic function available since V5.3 ZBRENT() - Find the root of a function known to lie between X1 and X2 (NR) ---------------------- Intrinsic "Numerical Recipes" procedures available in IDL V5.5 AMOEBA - Multidimensional minimization of a function via downhill simplex method BETA - beta function BROYDEN - Solve a system of n nonlinear equations in n dimensions (broydn) CHOLDC - Cholesky decomposition CHOLSOL - Cholesky backsubstitution (cholsl) DFPMIN - minimize a user-written function of two or more independent variables ELMHES - Reduce a matrix to upper Hessenberg form EXPINT - exponential integral En FULSTR - Restore a row-indexed sparse matrix to full storage mode FZ_ROOTS - Roots of a polynomial by Laguerre's method with deflation (zroots) HQR - eigenvalue of an Hessenberg matrix INVERT - Invert a matrix using Gaussian elimination methods LADFIT - Fit a straight line by minimizing absolute deviation (medfit) LEGENDRE - Return the value of the associated Legendre polynomial (V5.4, plgndr) LINBCG - Solve N linear equation in N unknowns using biconjugate gradient method LMFIT - Nonlinear least-squares fit using Levenberg-Marquardt algorithm (mrqmin) LNP_TEST - Lomb Normalized Periodogram of two sample populations (fasper) LUSOL - linear equation solution, backsubstitution (lubksb) LUDC - linear equation solution, LU decomposition (ludcmp) LUMPROVE - linear equation solution, iterative improvement (mprove) MACHAR - diagnose computer's floating arithmetic NEWTON - globally convergent multi-dimensional Newton's method (newt) POWELL - minimize a function of N variables using the Powell method QROMB - integrate using Romberg adaptive method QROMO - integrate using open Romberg adaptive method QSIMP - integrate using Simpson's rule R_CORRELATE - compute Spearman's (rho) or Kendalls's (tau) rank correlation (spear & kendl1) RK4 - integrate one step of ODEs, fourth-order Runge-Kutta SAVGOL - Compute Savitsky-Golay polynomial smoothing coefficients (V5.4) SIMPLEX - Use the Simplex method to solve linear programming problems (V5.5) SPL_INIT - construct a cubic spline (spline) SPL_INTERP - cubic spline interpolation (splint) SPRSAB - Multiply two row-indexed sparse matrices (sprstm) SPRSAX - Multiply a row-indexed sparse matrix by an N-element vector SPRSIN - Convert a matrix to row-indexed sparse matrix mode SVDC - singular value decomposition of a matrix (svdcmp) SVDFIT - General least-square fit with optional error estimates SVSOL - Solve simultaneous linear equations via back-substitution (svbksb) TRIQL - eigensolution of a symmetric tridiagonal matrix (tqli) TRIRED - Householder reduction of a real, symmetric matrix (tred2) TRISOL - solution of tridiagonal systems (tridag) VALUE_LOCATE - find effective index of a function value (V5.3, locate) WTN - multi-dimensional discrete wavelet transform