You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/1_models-quick-fit.html
+33-35Lines changed: 33 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -197,8 +197,6 @@
197
197
<ulclass="current nav bd-sidenav">
198
198
<liclass="toctree-l1 current active"><aclass="current reference internal" href="#">Modeling 1: Make a quick fit using astropy.modeling</a></li>
199
199
<liclass="toctree-l1"><aclass="reference internal" href="2_user-defined-model.html">Modeling 2: Create a User Defined Model using astropy.modeling</a></li>
200
-
201
-
202
200
</ul>
203
201
204
202
</div>
@@ -690,7 +688,7 @@ <h2>2) Fit a Polynomial model: Choose fitter wisely<a class="headerlink" href="#
@@ -788,7 +786,7 @@ <h3>Compare results<a class="headerlink" href="#compare-results" title="Link to
788
786
</div>
789
787
</div>
790
788
<divclass="cell_output docutils container">
791
-
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared with LinearLSQFitter: 1.976453546686968
789
+
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared with LinearLSQFitter: 1.7254506507627694
792
790
</pre></div>
793
791
</div>
794
792
</div>
@@ -801,7 +799,7 @@ <h3>Compare results<a class="headerlink" href="#compare-results" title="Link to
801
799
</div>
802
800
</div>
803
801
<divclass="cell_output docutils container">
804
-
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared with SimplexLSQFitter: 3.6404719596242217
802
+
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared with SimplexLSQFitter: 4.580753153741815
805
803
</pre></div>
806
804
</div>
807
805
</div>
@@ -820,10 +818,10 @@ <h3>Compare results<a class="headerlink" href="#compare-results" title="Link to
820
818
</div>
821
819
</div>
822
820
<divclass="cell_output docutils container">
823
-
<divclass="output text_plain highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span><matplotlib.legend.Legend at 0x7f043d6b6c60>
821
+
<divclass="output text_plain highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span><matplotlib.legend.Legend at 0x7ff08227ba10>
<p>Let’s do our three steps to make the fit we want. For this fit we’re going to use a non-linear fitter, <codeclass="docutils literal notranslate"><spanclass="pre">LevMarLSQFitter</span></code>, because the model we need (<codeclass="docutils literal notranslate"><spanclass="pre">Gaussian1D</span></code>) is non-linear in the parameters.</p>
@@ -885,9 +883,9 @@ <h2>3) Fit a Gaussian: Let’s compare to scipy<a class="headerlink" href="#fit-
@@ -1025,7 +1023,7 @@ <h3>Compare results<a class="headerlink" href="#id1" title="Link to this heading
1025
1023
</div>
1026
1024
</div>
1027
1025
<divclass="cell_output docutils container">
1028
-
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared using astropy.modeling: 0.8677576541316718
1026
+
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared using astropy.modeling: 0.9258750059366527
1029
1027
</pre></div>
1030
1028
</div>
1031
1029
</div>
@@ -1038,7 +1036,7 @@ <h3>Compare results<a class="headerlink" href="#id1" title="Link to this heading
1038
1036
</div>
1039
1037
</div>
1040
1038
<divclass="cell_output docutils container">
1041
-
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared using scipy: 0.8677576541512168
1039
+
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared using scipy: 0.9258750059343416
1042
1040
</pre></div>
1043
1041
</div>
1044
1042
</div>
@@ -1056,10 +1054,10 @@ <h3>Compare results<a class="headerlink" href="#id1" title="Link to this heading
1056
1054
</div>
1057
1055
</div>
1058
1056
<divclass="cell_output docutils container">
1059
-
<divclass="output text_plain highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span><matplotlib.legend.Legend at 0x7f043df28680>
1057
+
<divclass="output text_plain highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span><matplotlib.legend.Legend at 0x7ff0821b5cd0>
<p><strong>Conclusion:</strong> Choose the method most convenient for every case you need to fit. We recomend <codeclass="docutils literal notranslate"><spanclass="pre">astropy.modeling</span></code> because is easier to write the name of the function you want to fit than to remember the expression every time we want to use it. Also, <codeclass="docutils literal notranslate"><spanclass="pre">astropy.modeling</span></code> becomes useful with more complicated models like <aclass="reference external" href="http://docs.astropy.org/en/stable/modeling/#compound-models">two gaussians</a> plus a <aclass="reference external" href="http://docs.astropy.org/en/stable/modeling/#blackbody-radiation">black body</a>, but that is another tutorial.</p>
@@ -1111,7 +1109,7 @@ <h2>4) Exercise: Your turn to choose<a class="headerlink" href="#exercise-your-t
0 commit comments