/usr/share/doc/pyxplot/html/sect0110.html is in pyxplot-doc 0.9.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="generator" content="plasTeX" />
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<title>PyXPlot Users' Guide: fit</title>
<link href="sect0111.html" title="for" rel="next" />
<link href="sect0109.html" title="fft" rel="prev" />
<link href="ch-reference.html" title="Command reference" rel="up" />
<link rel="stylesheet" href="styles/styles.css" />
</head>
<body>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0109.html" title="fft"><img alt="Previous: fft" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="ch-reference.html" title="Command reference"><img alt="Up: Command reference" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0111.html" title="for"><img alt="Next: for" border="0" src="icons/next.gif" width="32" height="32" /></a></td>
<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>
<td><a href="sect0288.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>
<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>
<div class="breadcrumbs">
<span>
<span>
<a href="index.html">PyXPlot Users' Guide</a> <b>:</b>
</span>
</span><span>
<span>
<a href="sect0089.html">Reference Manual</a> <b>:</b>
</span>
</span><span>
<span>
<a href="ch-reference.html">Command reference</a> <b>:</b>
</span>
</span><span>
<span>
<b class="current">fit</b>
</span>
</span>
<hr />
</div>
<div><h1 id="a0000000111">1.21 fit</h1>
<p><a name="a0000001064" id="a0000001064"></a> </p><pre>
fit [ { <range> } ] <function name>() [ withouterrors ]
( <filename> | { <expression> } | { <vector obj> } )
[ index <value> ] [ using { <expression> } ]
via { <variable> }
</pre><p>The <tt class="tt">fit</tt> command<a name="a0000001065" id="a0000001065"></a> can be used to fit arbitrary functional forms to data points read from files. It can be used to produce best-fit lines for datasets or to determine gradients and other mathematical properties of data by looking at the parameters associated with the best-fitting functional form. The following simple example fits a straight line to data in a file called <tt class="tt">data.dat</tt>: </p><pre>
f(x) = a*x+b
fit f() 'data.dat' index 1 using 2:3 via a,b
</pre><p>The first line specifies the functional form which is to be used. The coefficients within this function, <tt class="tt">a</tt> and <tt class="tt">b</tt>, which are to be varied during the fitting process are listed after the keyword <tt class="tt">via</tt><a name="a0000001066" id="a0000001066"></a> in the <tt class="tt">fit</tt> command. The modifiers <tt class="tt">index</tt><a name="a0000001067" id="a0000001067"></a>, <tt class="tt">every</tt><a name="a0000001068" id="a0000001068"></a>, <tt class="tt">select</tt><a name="a0000001069" id="a0000001069"></a> and <tt class="tt">using</tt><a name="a0000001070" id="a0000001070"></a> have the same meanings in the <tt class="tt">fit</tt> command as in the <tt class="tt">plot</tt> command. When fitting a function of <img src="images/img-0025.png" alt="$n$" style="vertical-align:0px;
width:11px;
height:8px" class="math gen" /> variables, at least <img src="images/img-0164.png" alt="$n+1$" style="vertical-align:-1px;
width:41px;
height:13px" class="math gen" /> columns (or rows – see Section <a href="sec-horizontal_datafiles.html">3.9.1</a>) of data must be specified after the <tt class="tt">using</tt> modifier. By default, the first <img src="images/img-0164.png" alt="$n+1$" style="vertical-align:-1px;
width:41px;
height:13px" class="math gen" /> columns are used. These correspond to the values of each of the <img src="images/img-0025.png" alt="$n$" style="vertical-align:0px;
width:11px;
height:8px" class="math gen" /> arguments to the function, plus finally the value which the output from the function is aiming to match. If an additional column is specified, then this is taken to contain the standard error in the value that the output from the function is aiming to match, and can be used to weight the data points which are being used to constrain the fit. </p><p>As the <tt class="tt">fit</tt> command works, it displays statistics including the best-fit values of each of the fitting parameters, the uncertainties in each of them, and the covariance matrix. These can be useful for analysing the security of the fit achieved, but calculating the uncertainties in the best-fit parameters and the covariance matrix can be time consuming, especially when many parameters are being fitted simultaneously. The optional keyword <tt class="tt">withouterrors</tt> can be included immediately before the filename of the data file to be fitted to substantially speed up cases where this information is not required. </p><p>By default, the starting values for each of the fitting parameters is <img src="images/img-0168.png" alt="$1.0$" style="vertical-align:0px;
width:22px;
height:12px" class="math gen" />. However, if the variables to be used in the fitting process are already set before the <tt class="tt">fit</tt> command is called, these initial values are used instead. For example, the following would use the initial values <img src="images/img-0169.png" alt="$\{ a=100,b=50\} $" style="vertical-align:-5px;
width:135px;
height:19px" class="math gen" />: </p><pre>
f(x) = a*x+b
a = 100
b = 50
fit f() 'data.dat' index 1 using 2:3 via a,b
</pre><p>More details can be found in Section <a href="sec-fit_command.html">5.6</a>. </p></div>
<div class="navigation">
<table cellspacing="2" cellpadding="0" width="100%">
<tr>
<td><a href="sect0109.html" title="fft"><img alt="Previous: fft" border="0" src="icons/previous.gif" width="32" height="32" /></a></td>
<td><a href="ch-reference.html" title="Command reference"><img alt="Up: Command reference" border="0" src="icons/up.gif" width="32" height="32" /></a></td>
<td><a href="sect0111.html" title="for"><img alt="Next: for" border="0" src="icons/next.gif" width="32" height="32" /></a></td>
<td class="navtitle" align="center">PyXPlot Users' Guide</td>
<td><a href="index.html" title="Table of Contents"><img border="0" alt="" src="icons/contents.gif" width="32" height="32" /></a></td>
<td><a href="sect0288.html" title="Index"><img border="0" alt="" src="icons/index.gif" width="32" height="32" /></a></td>
<td><img border="0" alt="" src="icons/blank.gif" width="32" height="32" /></td>
</tr>
</table>
</div>
<script language="javascript" src="icons/imgadjust.js" type="text/javascript"></script>
</body>
</html>
|