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
@@ -788,7 +788,7 @@ <h3>Compare results<a class="headerlink" href="#compare-results" title="Link to
788
788
</div>
789
789
</div>
790
790
<divclass="cell_output docutils container">
791
-
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared with LinearLSQFitter: 2.0380848248340815
791
+
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared with LinearLSQFitter: 1.5151632695641253
792
792
</pre></div>
793
793
</div>
794
794
</div>
@@ -801,7 +801,7 @@ <h3>Compare results<a class="headerlink" href="#compare-results" title="Link to
801
801
</div>
802
802
</div>
803
803
<divclass="cell_output docutils container">
804
-
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared with SimplexLSQFitter: 4.645859203398919
804
+
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared with SimplexLSQFitter: 5.108396459855349
805
805
</pre></div>
806
806
</div>
807
807
</div>
@@ -820,10 +820,10 @@ <h3>Compare results<a class="headerlink" href="#compare-results" title="Link to
820
820
</div>
821
821
</div>
822
822
<divclass="cell_output docutils container">
823
-
<divclass="output text_plain highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span><matplotlib.legend.Legend at 0x7f5ca2a27e30>
823
+
<divclass="output text_plain highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span><matplotlib.legend.Legend at 0x7f6f6fc23b90>
<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 +885,9 @@ <h2>3) Fit a Gaussian: Let’s compare to scipy<a class="headerlink" href="#fit-
@@ -1025,7 +1025,7 @@ <h3>Compare results<a class="headerlink" href="#id1" title="Link to this heading
1025
1025
</div>
1026
1026
</div>
1027
1027
<divclass="cell_output docutils container">
1028
-
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared using astropy.modeling: 1.034573985888868
1028
+
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared using astropy.modeling: 0.9636990281912249
1029
1029
</pre></div>
1030
1030
</div>
1031
1031
</div>
@@ -1038,7 +1038,7 @@ <h3>Compare results<a class="headerlink" href="#id1" title="Link to this heading
1038
1038
</div>
1039
1039
</div>
1040
1040
<divclass="cell_output docutils container">
1041
-
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared using scipy: 1.0345739858891707
1041
+
<divclass="output stream highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span>Reduced Chi Squared using scipy: 0.9636990281913128
1042
1042
</pre></div>
1043
1043
</div>
1044
1044
</div>
@@ -1056,10 +1056,10 @@ <h3>Compare results<a class="headerlink" href="#id1" title="Link to this heading
1056
1056
</div>
1057
1057
</div>
1058
1058
<divclass="cell_output docutils container">
1059
-
<divclass="output text_plain highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span><matplotlib.legend.Legend at 0x7f5ca286fef0>
1059
+
<divclass="output text_plain highlight-myst-ansi notranslate"><divclass="highlight"><pre><span></span><matplotlib.legend.Legend at 0x7f6f6f9d6c00>
<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 +1111,7 @@ <h2>4) Exercise: Your turn to choose<a class="headerlink" href="#exercise-your-t
0 commit comments