Files
pylib/docs/build/html/pylib.numerical.fit.html

189 lines
8.0 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>pylib.numerical.fit module &#8212; pylib 2019.12.21 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pylib.numerical.integration module" href="pylib.numerical.integration.html" />
<link rel="prev" title="pylib.numerical package" href="pylib.numerical.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-pylib.numerical.fit">
<span id="pylib-numerical-fit-module"></span><h1>pylib.numerical.fit module<a class="headerlink" href="#module-pylib.numerical.fit" title="Permalink to this headline"></a></h1>
<p>Function and approximation.</p>
<dl class="field-list simple">
<dt class="field-odd">Date</dt>
<dd class="field-odd"><p>2019-10-15</p>
</dd>
</dl>
<span class="target" id="module-fit"></span><dl class="function">
<dt id="pylib.numerical.fit.gauss">
<code class="sig-name descname">gauss</code><span class="sig-paren">(</span><em class="sig-param">x</em>, <em class="sig-param">*p</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/numerical/fit.html#gauss"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.numerical.fit.gauss" title="Permalink to this definition"></a></dt>
<dd><p>Gauss distribution function.</p>
<div class="math notranslate nohighlight">
\[f(x)=ae^{-(x-b)^{2}/(2c^{2})}\]</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>int</em><em> or </em><em>float</em><em> or </em><em>list</em><em> or </em><em>numpy.ndarray</em>) positions where the gauss function will be calculated</p></li>
<li><p><strong>p</strong> (<em>list</em>) <p>gauss parameters [a, b, c, d]:</p>
<ul>
<li><p>a amplitude (<span class="math notranslate nohighlight">\(\int y \,\mathrm{d}x=1 \Leftrightarrow a=1/(c\sqrt{2\pi})\)</span> )</p></li>
<li><p>b expected value <span class="math notranslate nohighlight">\(\mu\)</span> (position of maximum, default = 0)</p></li>
<li><p>c standard deviation <span class="math notranslate nohighlight">\(\sigma\)</span> (variance <span class="math notranslate nohighlight">\(\sigma^2=c^2\)</span>)</p></li>
<li><p>d vertical offset (default = 0)</p></li>
</ul>
</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>gauss values at given positions x</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pylib.numerical.fit.gauss_fit">
<code class="sig-name descname">gauss_fit</code><span class="sig-paren">(</span><em class="sig-param">x</em>, <em class="sig-param">y</em>, <em class="sig-param">e=None</em>, <em class="sig-param">x_fit=None</em>, <em class="sig-param">verbose=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/numerical/fit.html#gauss_fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.numerical.fit.gauss_fit" title="Permalink to this definition"></a></dt>
<dd><p>Fit Gauss distribution function to data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>int</em><em> or </em><em>float</em><em> or </em><em>list</em><em> or </em><em>numpy.ndarray</em>) positions</p></li>
<li><p><strong>y</strong> (<em>int</em><em> or </em><em>float</em><em> or </em><em>list</em><em> or </em><em>numpy.ndarray</em>) values</p></li>
<li><p><strong>e</strong> (<em>int</em><em> or </em><em>float</em><em> or </em><em>list</em><em> or </em><em>numpy.ndarray</em>) error values (default = None)</p></li>
<li><p><strong>x_fit</strong> (<em>int</em><em> or </em><em>float</em><em> or </em><em>list</em><em> or </em><em>numpy.ndarray</em>) positions of fitted function (default = None, if None then x
is used)</p></li>
<li><p><strong>verbose</strong> (<em>bool</em>) verbose information (default = False)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><ul class="simple">
<li><p>numpy.ndarray fitted values (y_fit)</p></li>
<li><p>numpy.ndarray parameters of gauss distribution function (popt:
amplitude a, expected value <span class="math notranslate nohighlight">\(\mu\)</span>, standard deviation
<span class="math notranslate nohighlight">\(\sigma\)</span>, vertical offset d)</p></li>
<li><p>numpy.float64 full width at half maximum (FWHM)</p></li>
</ul>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#pylib.numerical.fit.gauss" title="pylib.numerical.fit.gauss"><code class="xref py py-meth docutils literal notranslate"><span class="pre">gauss()</span></code></a></p>
</div>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">pylib</a></h1>
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">pylib</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="pylib.html">pylib package</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li><a href="modules.html">pylib</a><ul>
<li><a href="pylib.html">pylib package</a><ul>
<li><a href="pylib.numerical.html">pylib.numerical package</a><ul>
<li>Previous: <a href="pylib.numerical.html" title="previous chapter">pylib.numerical package</a></li>
<li>Next: <a href="pylib.numerical.integration.html" title="next chapter">pylib.numerical.integration module</a></li>
</ul></li>
</ul></li>
</ul></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, Daniel Weschke.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.2.1</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/pylib.numerical.fit.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>