\item The Hubble's law provides a relation between the luminosity distance $d_L$ and cosmological redshift $z$ that is valid in the local universe ($z \lesssim0.1$).
\begin{equation}
d_L = \frac{c}{H_0} z,
\label{eq:Hubble_law}
\end{equation}
where $c$ is the speed of light and $H_0$ is the Hubble constant. Here~\cite{sndata} you are given a dataset from the Supernova Cosmology project~\cite{SNCosmology}. This contains the redshift $z$, the distance modulus $\mu$, and the error on the distance modulus $\delta\mu$ measured from several Type 1a supernovae. The distance modulus is related to the luminosity distance (in parsecs) by $\mu=5\left(\log_{10} d_L -1\right)$. Use the linear regression method to fit the distance and redshift data to estimate the Hubble constant and the associated error. Note that the data contain redshifts above the range where the simple Hubble law is valid. Please select the samples with $z \leq0.1$.
\end{enumerate}
...
...
@@ -26,6 +27,7 @@ where $c$ is the speed of light and $H_0$ is the Hubble constant. Here~\cite{snd
In the flat $\Lambda$CDM model of cosmology, the general relation between he luminosity distance $d_L$ and cosmological redshift $z$ is given by
where $\Omega_M$ is the energy density of matter and $\Omega_\Lambda$ is the energy density of the cosmological constant. Since we are assuming spatially flat universe: $\Omega_M +\Omega_\Lambda=1$. Thus the only free parameters of the model are $H_0$ and $\Omega_M$.
...
...
@@ -34,5 +36,3 @@ where $\Omega_M$ is the energy density of matter and $\Omega_\Lambda$ is the ene
\begin{enumerate}
\item Use the supernova data from the entire redshift to estimate $H_0$ and $\Omega_M$ and the corresponding covariance. This is a non-linear least square problem. You can use SciPy's \href{https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html}{\texttt{curve\_fit}} function.
\item The area of a circle of radius $r$ is $A_c =\pi r^2$. The area of the smallest square that encloses this circle is $A_s =4 r^2$. Measure the areas of the circle and square using a Monte-Carlo simulation and estimate the value of $\pi=4 A_c/A_s$.
\item Repeat the problems 3 and 4 from Sec.~\ref{sec:statinf} by stochastically sampling the posterior using Markov-Chain Monte Carlo and then computing the evidence using Monte-Carlo integration. You can either code up the Metropolis-Hastings algorithm or use an existing sampler such as \href{https://dynesty.readthedocs.io/en/stable/}{dynesty.}