Skip to content

Commit

Permalink
fixed typo in reduced chi^2 in hw03.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kravtsov authored and Andrey Kravtsov committed Feb 21, 2020
1 parent 29629bb commit d672784
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hw03.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
"\n",
"**Reduced $\\chi^2$:** once we estimate $\\chi^2$ as a function of parameter values, we can find its minimum value within the specified model parameter ranges: $\\chi^2_{\\rm min}$. Finding this minimum is an example of the *optimization problem*. In this exercise, you will do this in two ways: \"brute-force\" search that is quite feasible in 3D space of 3 parameters and using one of the SciPy's optimization routines. \n",
"\n",
"Once $\\chi^2_{\\rm min}$ is estimated, we can evaluate how well or three parameter model describes supernova measurements using the \"goodness-of-fit\" statistic called <a href=\"https://en.wikipedia.org/wiki/Reduced_chi-squared_statistic\">*reduced $\\chi^2$*</a> or $\\chi^2_\\nu=\\chi^2/\\nu$, where $\\nu$ is the number of model parameters, or $\\nu=3$ in our case. \n"
"Once $\\chi^2_{\\rm min}$ is estimated, we can evaluate how well or three parameter model describes supernova measurements using the \"goodness-of-fit\" statistic called <a href=\"https://en.wikipedia.org/wiki/Reduced_chi-squared_statistic\">*reduced $\\chi^2$*</a> or $\\chi^2_\\nu=\\chi^2/(N_{\\rm SN}-\\nu)$, where $\\nu$ is the number of model parameters, or $\\nu=3$ in our case, and $N_{\\rm SN}=740$ for this sample. \n"
]
},
{
Expand Down Expand Up @@ -577,7 +577,7 @@
"source": [
"**Task 2c (5 points).** Use examples in the <a href=\"05_optimization.ipynb\"><tt>05_optimization.ipynb</tt></a> notebook for the use of <a href=\"https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize\"><tt>scipy.optimize.minimize</tt></a> routine and use <tt>Nelder-Mead</tt> or <tt>SLSQP</tt> methods or <a href=\"https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.differential_evolution.html#scipy.optimize.differential_evolution\"><tt>scipy.optimize.differential_evolution</tt></a> routine to find the minimum of $\\chi^2_\\nu$ using your <tt>chi2</tt> function. Compare to the minimum you obtained in the Task 2b and make sure they agree (that is the values obtained using these two methods are close). \n",
"\n",
"The values of reduced-$\\chi^2$ estimated from the minimum value of $\\chi^2$, $\\chi^2_\\nu = \\chi^2_{\\rm min}/\\nu$, where $\\nu=3$ in this 3-parameter model can be used to judge how well the model describes supernova data. Good description corresponds to $\\chi^2_\\nu\\approx 1-2$, values $\\chi^2_\\nu$ much smaller than 1 indicate that model \"overfits\" the data (it has too many parameters), while values of $\\chi^2_\\nu$ much larger than 1 indicate that model does not describe the data sufficiently well, either because it is incorrect or because the number of parameters is insufficient. \n",
"The values of reduced-$\\chi^2$ estimated from the minimum value of $\\chi^2$, $\\chi^2_\\nu = \\chi^2_{\\rm min}/(N_{\\rm SN}-\\nu)$, where $\\nu=3$ in this 3-parameter model can be used to judge how well the model describes supernova data. Good description corresponds to $\\chi^2_\\nu\\approx 1-2$, values $\\chi^2_\\nu$ much smaller than 1 indicate that model \"overfits\" the data (it has too many parameters), while values of $\\chi^2_\\nu$ much larger than 1 indicate that model does not describe the data sufficiently well, either because it is incorrect or because the number of parameters is insufficient. \n",
"\n",
"Based on this information and the $\\chi^2_\\nu$ value you estimated, report what you conclude about how well the 3-parameter model describes the data."
]
Expand All @@ -588,7 +588,7 @@
"source": [
"**Task 2d. (10 points)** Extract a 2D slice of your 3D grid that corresponds to the value of $\\tilde{M}_0$ for which the minimum of $\\chi^2_\\nu$ was identified. In other words,the slice should contain the values of $\\chi^2$ as a function of $\\Omega_{\\rm m0}$ and $\\Omega_\\Lambda$ for the value of $\\tilde{M}_0$ for which $\\chi^2_\\nu$ has minimum value. \n",
"\n",
"Plot the $\\chi^2=\\nu\\chi^2_\\nu$ (again $\\nu=3$ here) in that slice as a 2D color map using routine and plot two contours that corresponds to $\\chi^2_{\\rm min}+\\Delta\\chi^2$, where $\\chi^2_{\\rm min}=3\\chi^2_{\\nu,\\rm min}$ and $\\Delta\\chi^2$ have values of $3.53$ and $8.03$. These numbers correspond to $1\\sigma$ and $2\\sigma$ contours of the $\\chi^2$ distribution it had a Gaussian form (see Table 28.2 <a href=\"http://pdg.lbl.gov/2014/reviews/rpp2014-rev-statistics.pdf\">here</a> and associated material for more details). \n",
"Plot the $\\chi^2$ in that slice as a 2D color map using routine and plot two contours that corresponds to $\\chi^2_{\\rm min}+\\Delta\\chi^2$, where $\\chi^2_{\\rm min}=(N_{\\rm SN}-\\nu)\\chi^2_{\\nu,\\rm min}$ and $\\Delta\\chi^2$ have values of $3.53$ and $8.03$. These numbers correspond to $1\\sigma$ and $2\\sigma$ contours of the $\\chi^2$ distribution it had a Gaussian form (see Table 28.2 <a href=\"http://pdg.lbl.gov/2014/reviews/rpp2014-rev-statistics.pdf\">here</a> and associated material for more details). \n",
"\n",
"Example of how to plot contours with the color map routine was provided in the <a href=\"05_optimization.ipynb\"><tt>05_optimization.ipynb</tt></a> routine and is included below. \n",
"\n",
Expand Down
Binary file added img/Enrico_Fermi_1943-49.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/Stan_Ulam_Holding_the_FERMIAC.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/fermiac.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/nicholas_metropolis_maniac_board.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d672784

Please sign in to comment.