Commit 2ed0873a authored by Ole Streicher's avatar Ole Streicher

New upstream version 1.84

parent ffebf678
......@@ -27,17 +27,17 @@
<!--
Copyright (c) 1997-2000 Craig B. Markwardt
Author: Craig Markwardt (craigm@cow.physics.wisc.edu)
Modified: 2013-08-14 10:55:11.
Modified: 2014-08-22 11:51:29.
Generated from ``fitqa.wml'' via WML 2.0.11 (19-Aug-2006).
by Craig Markwardt (craigm@cow.physics.wisc.edu)
on 2013-08-14 10:55:24.
on 2016-05-19 15:49:40.
DO NOT EDIT THIS FILE DIRECTLY! INSTEAD EDIT ``fitqa.wml''.
-->
<meta name="Copyright" content="1997-2000 Craig B. Markwardt">
<meta name="Author" content="Craig Markwardt, craigm@cow.physics.wisc.edu">
<meta name="Generator" content="WML 2.0.11 (19-Aug-2006)">
<meta name="Modified" content="2013-08-14 10:55:11">
<meta name="Modified" content="2014-08-22 11:51:29">
<title>%body</title>
<define-container title>
</define-container>
......@@ -121,7 +121,7 @@ first listed citation below.
<li>
Mor&eacute;, J. &amp; Wright, S. 1993, "Optimization Software Guide,"
SIAM, <i>Frontiers in Applied Mathematics</i>, Number 14.<br>
(ISBN: 978-0-898713-22-0; <a href="http://www.ec-securehost.com/SIAM/FR14.html">Link to SIAM title listing</a>)
(ISBN: 978-0-898713-22-0; <a href="http://epubs.siam.org/doi/book/10.1137/1.9781611970951">Link to SIAM title listing</a>)
</li>
<li>
MINPACK-1, Jorge More', available from netlib.
......@@ -324,7 +324,7 @@ global optimizer.</p>
<br><hr align="center" noshade>
<font size="-2"><i>Copyright &copy; 1997-2001 Craig B. Markwardt<br>
Last Modified on 2013-08-14 10:55:24 by Craig Markwardt<br>
Last Modified on 2016-05-19 15:49:40 by Craig Markwardt<br>
</i></font><br>
</body>
</html>
......
......@@ -396,8 +396,9 @@
; QUIET - set this keyword when no textual output should be printed
; by MPFIT
;
; STATUS - an integer status code is returned. All values other
; than zero can represent success. It can have one of the
; STATUS - an integer status code is returned. All values greater
; than zero can represent success (however STATUS EQ 5 may
; indicate failure to converge). It can have one of the
; following values:
;
; 0 improper input parameters.
......@@ -500,10 +501,11 @@
; (the weights were not being applied), CM, 2012-07-22
; Add more documentation on calling interface for user function and
; parameter derivatives, CM, 2012-07-22
; Better documentation for STATUS, CM, 2016-04-29
;
; $Id: mpcurvefit.pro,v 1.11 2012/07/22 21:08:58 cmarkwar Exp $
; $Id: mpcurvefit.pro,v 1.12 2016/05/19 16:08:49 cmarkwar Exp $
;-
; Copyright (C) 1997-2000, 2002, 2003, 2004, 2005, 2012, Craig Markwardt
; Copyright (C) 1997-2000, 2002, 2003, 2004, 2005, 2012, 2016 Craig Markwardt
; This software is provided as is without any warranty whatsoever.
; Permission to use, copy, modify, and distribute modified or
; unmodified copies is granted, provided this copyright and disclaimer
......
......@@ -1305,12 +1305,14 @@
; 1.79 - Documentation corrections. CM, 2011-08-26
; 1.81 - Fix bug in interaction of AUTODERIVATIVE=0 and .MPSIDE=3;
; Document FJAC_MASK. CM, 2012-05-08
; 1.83 - Trap more overflow conditions (ref. Nirmal Iyer), CM 2013-12-23
; 1.84 - More robust handling of FNORM, CM 2016-05-19
;
; $Id: mpfit.pro,v 1.82 2012/09/27 23:59:44 cmarkwar Exp $
; $Id: mpfit.pro,v 1.84 2016/05/19 16:07:44 cmarkwar Exp $
;-
; Original MINPACK by More' Garbow and Hillstrom, translated with permission
; Modifications and enhancements are:
; Copyright (C) 1997-2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Craig Markwardt
; Copyright (C) 1997-2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Craig Markwardt
; This software is provided as is without any warranty whatsoever.
; Permission to use, copy, modify, and distribute modified or
; unmodified copies is granted, provided this copyright and disclaimer
......@@ -2589,7 +2591,7 @@ end
;; Parse the RCSID revision number
function mpfit_revision
;; NOTE: this string is changed every time an RCS check-in occurs
revision = '$Revision: 1.82 $'
revision = '$Revision: 1.84 $'
;; Parse just the version number portion
revision = stregex(revision,'\$'+'Revision: *([0-9.]+) *'+'\$',/extract,/sub)
......@@ -3232,6 +3234,7 @@ function mpfit, fcn, xall, FUNCTARGS=fcnargs, SCALE_FCN=scalfcn, $
endif
fnorm = mpfit_enorm(fvec)
if finite(fnorm) EQ 0 then goto, FAIL_OVERFLOW
;; Initialize Levelberg-Marquardt parameter and iteration counter
......@@ -3510,6 +3513,7 @@ function mpfit, fcn, xall, FUNCTARGS=fcnargs, SCALE_FCN=scalfcn, $
endif
RESUME_FIT:
fnorm1 = mpfit_enorm(wa4)
if finite(fnorm1) EQ 0 then goto, FAIL_OVERFLOW
;; Compute the scaled actual reduction
catch_msg = 'computing convergence criteria'
......@@ -3647,10 +3651,8 @@ TERMINATE:
fnorm = mpfit_enorm(fvec)
endif
if n_elements(fnorm) GT 0 AND n_elements(fnorm1) GT 0 then begin
fnorm = max([fnorm, fnorm1])
fnorm = fnorm^2.
endif
if n_elements(fnorm) EQ 0 AND n_elements(fnorm1) GT 0 then fnorm = fnorm1
if n_elements(fnorm) GT 0 then fnorm = fnorm^2.
covar = !values.d_nan
;; (very carefully) set the covariance matrix COVAR
......
......@@ -281,6 +281,21 @@
; BESTNORM - the value of the summed, squared, weighted residuals
; for the returned parameter values, i.e. the chi-square value.
;
; BEST_FJAC - upon return, BEST_FJAC contains the Jacobian, or
; partial derivative, matrix for the best-fit model.
; The values are an array,
; ARRAY(N_ELEMENTS(DEVIATES),NFREE) where NFREE is the
; number of free parameters. This array is only
; computed if /CALC_FJAC is set, otherwise BEST_FJAC is
; undefined.
;
; The returned array is such that BEST_FJAC[I,J] is the
; partial derivative of the model with respect to
; parameter PARMS[PFREE_INDEX[J]].
;
; BEST_RESID - upon return, an array of best-fit deviates,
; normalized by the weights or errors.
;
; COVAR - the covariance matrix for the set of parameters returned
; by MPFIT. The matrix is NxN where N is the number of
; parameters. The square root of the diagonal elements
......@@ -412,11 +427,17 @@
; DOF = N_ELEMENTS(Z) - N_ELEMENTS(PARMS) ; deg of freedom
; PCERROR = PERROR * SQRT(BESTNORM / DOF) ; scaled uncertainties
;
; PFREE_INDEX - upon return, PFREE_INDEX contains an index array
; which indicates which parameter were allowed to
; vary. I.e. of all the parameters PARMS, only
; PARMS[PFREE_INDEX] were varied.
;
; QUIET - set this keyword when no textual output should be printed
; by MPFIT
;
; STATUS - an integer status code is returned. All values other
; than zero can represent success. It can have one of the
; STATUS - an integer status code is returned. All values greater
; than zero can represent success (however STATUS EQ 5 may
; indicate failure to converge). It can have one of the
; following values:
;
; 0 improper input parameters.
......@@ -531,10 +552,13 @@
; Convert to IDL 5 array syntax (!), 16 Jul 2006, CM
; Move STRICTARR compile option inside each function/procedure, 9 Oct 2006
; Add COMPATIBILITY section, CM, 13 Dec 2007
; Add keywords BEST_RESIDS, CALC_FJAC, BEST_FJAC, PFREE_INDEX;
; update some documentation that had become stale, CM, 2010-10-28
; Better documentation for STATUS, CM, 2016-04-29
;
; $Id: mpfit2dfun.pro,v 1.11 2010/04/09 04:58:35 craigm Exp $
; $Id: mpfit2dfun.pro,v 1.13 2016/05/19 16:08:49 cmarkwar Exp $
;-
; Copyright (C) 1997-2000, 2002, 2003, 2004, 2005, Craig Markwardt
; Copyright (C) 1997-2000, 2002, 2003, 2004, 2005, 2013, 2016 Craig Markwardt
; This software is provided as is without any warranty whatsoever.
; Permission to use, copy, modify, and distribute modified or
; unmodified copies is granted, provided this copyright and disclaimer
......@@ -580,6 +604,8 @@ end
function mpfit2dfun, fcn, x, y, z, err, p, WEIGHTS=wts, FUNCTARGS=fa, $
BESTNORM=bestnorm, nfev=nfev, STATUS=status, $
best_resid=best_resid, pfree_index=ifree, $
calc_fjac=calc_fjac, best_fjac=best_fjac, $
parinfo=parinfo, query=query, $
npegged=npegged, nfree=nfree, dof=dof, $
covar=covar, perror=perror, niter=iter, yfit=yfit, $
......@@ -635,6 +661,8 @@ function mpfit2dfun, fcn, x, y, z, err, p, WEIGHTS=wts, FUNCTARGS=fa, $
result = mpfit('mpfit2dfun_eval', p, $
parinfo=parinfo, STATUS=status, nfev=nfev, BESTNORM=bestnorm,$
covar=covar, perror=perror, niter=iter, $
best_resid=best_resid, pfree_index=ifree, $
calc_fjac=calc_fjac, best_fjac=best_fjac, $
nfree=nfree, npegged=npegged, dof=dof, $
ERRMSG=errmsg, quiet=quiet, _EXTRA=extra)
......
......@@ -67,6 +67,18 @@
; GAUSS2DFIT. The author has tested cases of strong peaks, noisy
; peaks and broad peaks, all with success.
;
; Note that if PARINFO is supplied, PARINFO(*).VALUES is ignored.
; If you wish to supply starting values, use the ESTIMATES keyword.
;
; MPFIT2DPEAK works in two steps. First, it computes initial
; ESTIMATES if none are provided, not using MPFIT. Second, it uses
; the initial ESTIMATES to fit a refined solution using MPFIT. The
; first step, initial estimates, is not required to match any
; constraints supplied with the PARINFO keyword parameter. Thus, if
; you don't supply ESTIMATES but do supply PARINFO, it is possible
; for MPFIT to fail with an error that parameters exceed their
; PARINFO limits. To avoid this situation, call MPFIT2DPEAK with
; ESTIMATES explicitly.
;
; COMPATIBILITY
;
......@@ -243,10 +255,12 @@
; Add COMPATIBILITY section, CM, 13 Dec 2007
; Clarify documentation regarding what happens when ESTIMATES is not
; set, CM, 14 Dec 2008
; Add more documentation about the interaction of ESTIMATES and
; PARINFO, CM, 2013-05-28
;
; $Id: mpfit2dpeak.pro,v 1.10 2008/12/14 20:05:44 craigm Exp $
; $Id: mpfit2dpeak.pro,v 1.11 2013/07/18 03:25:40 cmarkwar Exp $
;-
; Copyright (C) 1997-2000, 2002, 2003, 2005, 2006, 2007, 2008 Craig Markwardt
; Copyright (C) 1997-2000, 2002, 2003, 2005, 2006, 2007, 2008, 2013 Craig Markwardt
; This software is provided as is without any warranty whatsoever.
; Permission to use, copy, modify, and distribute modified or
; unmodified copies is granted, provided this copyright and disclaimer
......
......@@ -410,8 +410,9 @@
; QUIET - set this keyword when no textual output should be printed
; by MPFIT
;
; STATUS - an integer status code is returned. All values other
; than zero can represent success. It can have one of the
; STATUS - an integer status code is returned. All values greater
; than zero can represent success (however STATUS EQ 5 may
; indicate failure to converge). It can have one of the
; following values:
;
; 0 improper input parameters.
......@@ -544,10 +545,12 @@
; Clarify documentation on user-function, derivatives, and PARINFO,
; 27 May 2007
; Add COMPATIBILITY section, CM, 13 Dec 2007
; Remove obsolete STR_SEP in favor of STRSPLIT, CM, 2015-03-18
; Better documentation for STATUS, CM, 2016-04-29
;
; $Id: mpfitexpr.pro,v 1.15 2007/12/15 14:28:27 craigm Exp $
; $Id: mpfitexpr.pro,v 1.16 2016/05/19 16:08:49 cmarkwar Exp $
;-
; Copyright (C) 1997-2001, 2002, 2003, 2004, 2007, Craig Markwardt
; Copyright (C) 1997-2001, 2002, 2003, 2004, 2007, 2015, 2016 Craig Markwardt
; This software is provided as is without any warranty whatsoever.
; Permission to use, copy, modify, and distribute modified or
; unmodified copies is granted, provided this copyright and disclaimer
......@@ -672,7 +675,7 @@ function mpfitexpr, expr, x, y, err, p, WEIGHTS=wts, $
;; If we found one, then strip out the value inside the
;; parentheses.
rest = strmid(ee, i+2, ll-i-2)
next = str_sep(rest, ')', /trim)
next = strtrim(strsplit(rest,')',/extract),2)
next = next[0]
pnames = [pnames, next]
endif
......
......@@ -367,11 +367,11 @@
; -15 to -1
; these are error codes that either MYFUNCT or ITERPROC
; may return to terminate the fitting process (see
; description of MPFIT_ERROR common below). If either
; description of TNMIN_ERROR common below). If either
; MYFUNCT or ITERPROC set ERROR_CODE to a negative number,
; then that number is returned in STATUS. Values from -15
; to -1 are reserved for the user functions and will not
; clash with MPFIT.
; clash with TNMIN.
;
; 0 improper input parameters.
;
......@@ -475,7 +475,7 @@
; - scale derivatives semi-automatically;
; - ability to scale and offset parameters;
;
; $Id: tnmin.pro,v 1.19 2010/01/25 03:37:11 craigm Exp $
; $Id: tnmin.pro,v 1.20 2016/05/19 16:08:08 cmarkwar Exp $
;-
; Copyright (C) 1998-2001,2002,2003,2007,2008,2009 Craig Markwardt
; This software is provided as is without any warranty whatsoever.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment