File: minuitcommand.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (113 lines) | stat: -rw-r--r-- 5,527 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<HTML>
<HEAD>
<TITLE>MINUIT command</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<P><font size="+3" color="green"><B>MINUIT command</B></font></P>

<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%" valign="top"><CODE>
MINUIT y=expression<br />
MINUIT expression<br />
MINUIT\UPDATE yf</CODE>
</TD></TR>
<TR>
<TD valign="top"><B>Qualifiers</B>:</TD>
<TD valign="top"><CODE>
\MINIMIZE, \MIGRAD, \SIMPLEX, \UPDATE, \WEIGHTS, \CHISQ, \VARNAMES, \MESSAGES</CODE></TD>
</TR><TR>
<TD valign="top"><B>Defaults:</B></TD>
<TD valign="top"><CODE>
\MINIMIZE, \-WEIGHTS, \-CHISQ, \-VARNAMES, \MESSAGES</CODE></TD>
</TR><TR>
<TD valign="top"><B>Examples:</B></TD>
<TD valign="top"><CODE>
MINUIT Y=A*X+B<br />
MINUIT\WEIGHTS W Y=A*EXP(-B*X)+C<br />
MINUIT\UPDATE YF</CODE></TD>
</TR></TABLE>
<P>
 This command accesses the CERN Minuit package for function minimization
 and error analysis.  The command is very similar to the
 <CODE><a href="../FitCommand/fitcommand.htm">FIT</a></code>command.  The variable
 parameters are defined with the <CODE><a href="../ScalarCommand/fitparameters.htm">SCALAR\FIT</a></code>
 command.  The expression to be fitted must result in a vector with the same length as the
 data variable <code>y</code>.</P>
<P>
 For detailed information on Minuit, please refer to the Minuit Home Page at
 <font color="red">http://seal.web.cern.ch/seal/work-packages/mathlibs/minuit/home.html</font></p>
<p>
 <I>This implementation is open to suggestions from users for enhancements.</I></p>
<P>
 If your expression calculates the chi-square value, you can just enter the
 <CODE>expression</code>, instead of the usual <CODE>y=expression</code>.</P>
<p>
 <font size="+1" color="green">Method</font></p>
<p>
 By default, or with the <CODE>\MINIMIZE</code> qualifier, the 
 MIGRAD method is tried first, and if that fails to converge, the SIMPLEX method will be
 tried and then the MIGRAD method again.</P>
<P>
 If the <CODE>\MIGRAD</code> qualifier is used, the MIGRAD method is used, which "is the best minimizer
 for nearly all functions. It is a variable-metric method with inexact line search, a stable
 metric updating scheme, and checks for positive-definiteness.... Its main weakness is that
 it depends heavily on knowledge of the first derivatives, and fails miserably if they are
 very inaccurate."</P>
<P>
 If the <CODE>\SIMPLEX</code> qualifier is used, the SIMPLEX method is used.  "This genuine multidimensional
 minimization routine is uusually much slower than MIGRAD, but it does not use first derivatives".</P>
<p>
 <font size="+1" color="green">Fitting parameters</font></p>
<P>
 There is no maximum number of fitting parameters allowed in the expression, but
 fifteen (15) parameters is probably a practical limit. Variable fitting parameters are
 created with the <CODE>SCALAR\FIT</code> command, and can be converted to fixed value scalar
 variables with the <CODE>SCALAR</code> command.  
 If the <CODE>\VARNAMES</code> qualifier is used, an array text variable named
 <CODE><font color="orange">FIT$VAR</font></code> will be made which will contain the names of the
 fitting parameter variables.  The array length of <CODE><font color="orange">FIT$VAR</font></code>
 will be equal to the number of fitting parameters.</P>
<P>
 The <CODE>SCALAR</code> command allows for limits to be placed on a fitting parameter.  Use the
 <CODE>a[amin:amax]</code> syntax to create fit parameter <CODE>a</code> with lower limit
 <CODE>amin</code> and upper limit <CODE>amax</code>. To set an upper limit only, use
 <CODE>a[:amax]</code>, and to set a lower limit only, use <CODE>a[amin:]</code>. These limits are
 only used by the <CODE>MINUIT</code> command and are ignored by the <CODE>FIT</code> command.</P>
<p>
 <font size="+1" color="green">Weights</font></p>
<P>
 The <CODE>\WEIGHTS</code> qualifier must be used if you want to enter a vector of weights.
 The optional weight vector will then be expected.  The weights are assigned
 to the dependent variable in a one-to-one fashion, so the length of the weight
 vector must be the same as the length of the data vectors.</P>
<p>
 <font size="+1" color="green">&chi;<sup>2</sup></font></p>
<P>
 If the <CODE>\CHISQ</code> qualifier is used, a scalar named
 <CODE><font color="orange">FIT$CHISQ</font></code> will be made with value
 equal to the total chi-square.  The chi-square is calculated as <code>sum(w*(y-expression)^2)</code>
 where <CODE>w</code> is the weight vector, <CODE>y</code> is the data vector, and
 <CODE>expression</code> contains the variable parameters to be fitted.</p>
<p>
 <font size="+1" color="green">Output messages</font></p>
<P>
 If the <CODE>\-MESSAGES</code> qualifier is used, then there will be no
 informational messages output to the display window.</P>
<p>
 <font size="+1" color="green">Update after a fit</font></p>
<P>
 The <CODE>MINUIT\UPDATE yout</CODE> command evaluates
 the previously fitted expression, that is, the expression
 in the last <CODE>MINUIT</CODE> command, for the current
 parameter values, and stores this result in the vector <CODE>yout</CODE>.</P>
<P>
 This is exactly equivalent to entering: <TT>yout=</TT>previously_fitted_expression <BR />
 and is provided only to obviate the necessity of re-entering a complicated expression.</P>
<P>
 <EM>Note</EM>: The vector name <TT>yout</TT> usually differs from the name of the vector
 being fitted to avoid destroying the original data.</P>
</BODY>
</HTML>