From 612ef8be3893373b2d7b3579fbf9f9beec70166d Mon Sep 17 00:00:00 2001 From: Andy Casey Date: Sun, 24 Aug 2014 13:20:08 +0100 Subject: [PATCH] Updated manuscript --- document/{ => figures}/chains.pdf | Bin document/{ => figures}/clusters.pdf | Bin document/{ => figures}/corner.pdf | Bin document/{ => figures}/solar.pdf | Bin document/{ => figures}/spectrum.pdf | Bin document/manuscript.tex | 50 +++++++++++++++------------- 6 files changed, 27 insertions(+), 23 deletions(-) rename document/{ => figures}/chains.pdf (100%) rename document/{ => figures}/clusters.pdf (100%) rename document/{ => figures}/corner.pdf (100%) rename document/{ => figures}/solar.pdf (100%) rename document/{ => figures}/spectrum.pdf (100%) diff --git a/document/chains.pdf b/document/figures/chains.pdf similarity index 100% rename from document/chains.pdf rename to document/figures/chains.pdf diff --git a/document/clusters.pdf b/document/figures/clusters.pdf similarity index 100% rename from document/clusters.pdf rename to document/figures/clusters.pdf diff --git a/document/corner.pdf b/document/figures/corner.pdf similarity index 100% rename from document/corner.pdf rename to document/figures/corner.pdf diff --git a/document/solar.pdf b/document/figures/solar.pdf similarity index 100% rename from document/solar.pdf rename to document/figures/solar.pdf diff --git a/document/spectrum.pdf b/document/figures/spectrum.pdf similarity index 100% rename from document/spectrum.pdf rename to document/figures/spectrum.pdf diff --git a/document/manuscript.tex b/document/manuscript.tex index ced9aa1..b1b04da 100644 --- a/document/manuscript.tex +++ b/document/manuscript.tex @@ -279,25 +279,29 @@ \section{The Generative Model} informative, so conceptually a fit to the expected fluxes $E_{i}$ is generally preferred wherever possible. For brevity I define $\bm{\kappa} \equiv (\bm{\psi},\{z,\sigma_s,\{c_k\}_{k=0}^{m},f\}_{0}^{N_{c}})$, and the likelihood for the mixture model is given by - \begin{equation} -\mathcal{L} = \prod_{i=1}^{N}\,\left[\left(1 - P_{o}\right)\times{}p_{model}\left(F_i|\lambda_i,\sigma_{i},\bm{\kappa}\right) + P_{o}\times{}p_{outlier}\left(F_i|\lambda_i,\sigma_i,\bm{\kappa},V_{o},P_o\right)\right] -\end{equation} + \begin{multline} +\mathcal{L} = \prod_{i=1}^{N}\,\left[\left(1 - P_{o}\right)\times{}p_{model}\left(F_i|\lambda_i,\sigma_{i},\bm{\kappa}\right)\right. \\ ++ \left. P_{o}\times{}p_{outlier}\left(F_i|\lambda_i,\sigma_i,\bm{\kappa},V_{o},P_o\right)\right] +\end{multline} \noindent{}where $p_{model}$ refers to $p$ in Equation \ref{eq:p_model} and -\begin{equation} -p_{outlier}\left(F_i|\lambda_i,\sigma_i,\bm{\kappa},V_{o},P_o\right) = \frac{1}{\sqrt{2\pi\left(s_{i}^2 + V_{o}^2\right)}} \exp\left(-\frac{[F_i - C_i]^2}{2\left[s_{i}^2 + V_{o}^2\right]}\right) -\end{equation} +\begin{multline} +p_{outlier}\left(F_i|\lambda_i,\sigma_i,\bm{\kappa},V_{o},P_o\right) = \dots \\ + \frac{1}{\sqrt{2\pi\left(s_{i}^2 + V_{o}^2\right)}} \exp\left(-\frac{[F_i - C_i]^2}{2\left[s_{i}^2 + V_{o}^2\right]}\right) +\end{multline} \noindent{}such that the likelihood $\mathcal{L}$ becomes: -\begin{equation} -\mathcal{L} = \prod_{i=1}^{N} \left[ \frac{1-P_o}{\sqrt{2\pi{}s_{i}^2}}\,\exp\,\left(-\frac{[F_i - E_i]^2}{2s_{i}^{2}}\right) + \frac{P_o}{\sqrt{2\pi\left[s_{i}^2 + V_o\right]}}\,\exp\,\left(-\frac{[F_i - C_i]^2}{2\left[s_{i}^{2} + V_o\right]}\right)\right] +\begin{multline} +\mathcal{L} = \prod_{i=1}^{N} \left[ \frac{1-P_o}{\sqrt{2\pi{}s_{i}^2}}\exp\left(-\frac{[F_i - E_i]^2}{2s_{i}^{2}}\right) \right.\\ +\left. + \frac{P_o}{\sqrt{2\pi\left[s_{i}^2 + V_o\right]}}\exp\left(-\frac{[F_i - C_i]^2}{2\left[s_{i}^{2} + V_o\right]}\right)\right] \label{eq:full_likelihood} -\end{equation} +\end{multline} -I define the full parameter space with $\bm{\theta} \equiv \left(\bm{\psi},\{z,\sigma_s,\{c_{b_k}\}_{k=0}^{m},f\}_{b=0}^{N_{c}},V_o,P_o\right)$. From Bayes theorem the posterior probability +I define the full parameter space with ${\bm{\theta} \equiv \left(\bm{\psi},\{z,\sigma_s,\{c_{b_k}\}_{k=0}^{m},f\}_{b=0}^{N_{c}},V_o,P_o\right)}$. From Bayes theorem the posterior probability distribution for $\bm{\theta}$ (up to a constant) is given by + \begin{eqnarray} \mathcal{P} & \propto & likelihood \times prior \nonumber \\ p(\bm{\theta}|\{F_i\}_{i=1}^{N}) & \propto & p(\{F_i\}_{i=1}^{N}|\bm{\theta})\,\times\,p(\bm{\theta}) @@ -385,7 +389,7 @@ \subsection{Monte-Carlo Markov Chain Sampling} by \citet{goodman;weare}, and implemented by \citet{emcee}. The Metropolis-Hastings MCMC algorithm is employed by default. \sick{} allows for the model settings to be specified in a human-readable \textsc{yaml}- or \textsc{json}-formatted - configuration file\footnote{The reader is referred to the online documentation + configuration file\footnote{The reader is referred to the online documentation at http://astrowizici.st/sick/ for an example.}, where the number of Goodman \& Weare walkers can be specified, as well as the number of samples to perform. When the optimisation step is used, the initial points are taken from a small multi-dimensional ball around the @@ -400,15 +404,15 @@ \subsection{Monte-Carlo Markov Chain Sampling} uninformative prior distributions are assumed (for all channels, where appropriate): \begin{eqnarray} -p\left(\bm{\psi}_{dim}\right) &=& \mathcal{U}\left(\min\left[\bm{\psi}_{dim}\right], \max\left[\bm{\psi}_{dim}\right]\right) \\ -p\left(P_o\right) &=& \mathcal{U}\left(0, 1\right) \\ -p\left(\log{f}\right) &=& \mathcal{U}\left(-10, 1\right) \\ -p\left(V_o,\sigma_s\right) &=& \left\{ +p\left(\bm{\psi}_{dim}\right) &\,=\,& \mathcal{U}\left(\min\left[\bm{\psi}_{dim}\right], \max\left[\bm{\psi}_{dim}\right]\right) \\ +p\left(P_o\right) &\,=\,& \mathcal{U}\left(0, 1\right) \\ +p\left(\log{f}\right) &\,=\,& \mathcal{U}\left(-10, 1\right) \\ +p\left(V_o,\sigma_s\right) &\,=\,& \left\{ \begin{array}{c l} 1\,, &\mbox{for values greater than zero}\\ 0\,, &\mbox{otherwise} \end{array}\right. \\ -p\left(z,\{c_k\}_{k=0}^{m}\right) &=& 1 \\ +p\left(z,\{c_k\}_{k=0}^{m}\right) &\,=\,& 1 \\ \label{eq:default_priors} \end{eqnarray} @@ -449,7 +453,7 @@ \subsection{Self-consistent inference test} \begin{figure*} \label{fig:chains} -\includegraphics[height=\textheight]{chains.pdf} +\includegraphics[height=\textheight]{figures/chains.pdf} \caption{Points sampled by the 200 walkers at each step during the self-consistent inference test. The true values are marked in blue. The first 1250 steps are discarded as the burn-in period.} @@ -457,7 +461,7 @@ \subsection{Self-consistent inference test} \begin{figure*} \label{fig:corner-inference} -\includegraphics[width=\textwidth,height=\textwidth]{corner.pdf} +\includegraphics[width=\textwidth,height=\textwidth]{figures/corner.pdf} \caption{Marginalised posterior distributions for all parameters $\bm{\theta}$ from a faux observation with spectral resolution $\mathcal{R} \sim 10,000$ and S/N ratio $\sim{}7$\,pixel$^{-1}$. True values are marked in blue. This figure @@ -490,7 +494,7 @@ \subsection{Self-consistent inference test} \begin{figure*} \label{fig:spectrum-inference} -\includegraphics[width=\textwidth]{spectrum.pdf} +\includegraphics[width=\textwidth]{figures/spectrum.pdf} \caption{A faux observed spectrum (black) of $\mathcal{R} \sim 10000$ and S/N ratio of $\sim7$ with an underestimated variance by $\sim$10\% which was used for the self-consistent inference test. The recovered maximum likelihood model spectrum @@ -546,7 +550,7 @@ \subsection{Sol} \begin{figure*} \label{fig:solar} -\includegraphics[width=\textwidth,height=\textwidth]{solar.pdf} +\includegraphics[width=\textwidth,height=\textwidth]{figures/solar.pdf} \caption{Stellar parameter ($\bm{\psi}$: $T_{\rm eff}$, $\log{g}$, [Fe/H], [$\alpha$/Fe]) posterior distributions for the GIRAFFE/FLAMES twilight spectrum. Nuisance parameters are not shown. Maximum likelihood values for each parameter @@ -620,7 +624,7 @@ \subsection{Globular Clusters} \begin{figure}[h!] \label{fig:clusters} -\includegraphics[width=0.5\textwidth]{clusters.pdf} +\includegraphics[width=0.5\textwidth]{figures/clusters.pdf} \caption{Metallicities of cluster stars inferred from noisy, low-resolution spectra obtained with the AAOmega spectrograph. The agreement with the literature values (see text) is very reasonable.} @@ -667,8 +671,8 @@ \section{Conclusion} which includes regular reproduction of the examples presented in this \article{}. Complete documentation is available online\footnote{astrowizici.st/sick}, which includes a number of additional examples and tutorials. In the spirit of -full scientific reproducibility, the online documentation is complemented with the -files necessary to reproduce all of the examples presented in this \article{}. +scientific reproducibility, the online documentation is complemented with the +files necessary to reproduce examples presented in this \article{}. The source code is distributed using \textsc{git}, and hosted online at GitHub\footnote{github.com/andycasey/sick}.