% $Id: b2fcc257ab28f057ef1dd2f8d542497b8b43d0c6 $

\section{Equational Reasoning with Rigid Unit Superposition}
\label{sec:super}

There are many ways of integrating equational reasoning in tableau
methods~\cite{DB75,LS02,BR15,DV96}. Because our prover does not rely on clausal
forms, but on arbitrary formulas with quantifiers occurring deep inside
branches, we deal with rigid variables, i.e.~variables that should be
instantiated only once, since multiple instantiations would create new
propositional branches.  In order to find instantiations for universally
quantified formulas, the procedure described in~\ref{sec:tab} need a unification
algorithm. In order to be complete, this algorithm needs to solve rigid
E-unification modulo rewrite rules:~assume a set of equations $E$, containing
rigid variables, a rewrite system $\mathcal{RE}$, and target terms $s$ and $t$;
we want a substitution $\sigma$ such that $\bigwedge_{e \in E} e\sigma \vdash
s\sigma =_\mathcal{RE} t\sigma$. Such a substitution is a solution to the rigid
E-unification problem.

We propose here an approach based on superposition with rigid variables, as in
previous work by Degtyarev and Voronkov~\cite{DV96} and earlier work on rigid
paramodulation~\cite{DAP00}, but with significant differences. First, in order
to avoid constraint solving, we do not use basic superposition nor
constraints. Second, we introduce a merging rule, which factors together
intermediate (dis)equations that are alpha-equivalent: with multiple instances
of some of the quantified formulas (amplification), it becomes important not to
duplicate work. In this aspect, our calculus is quite close to labeled unit
superposition~\cite{KS10} when using sets as labels. Third, unlike rigid
paramodulation, we use a term ordering to orient the equations.

\subsection{Preliminary Definitions}

We write $ \clauseWithSubst{ s \approx t }{ \Sigma}$ (resp.  $\clauseWithSubst{
  s \not\approx t }{ \Sigma}$) for the unit clause that contains exactly one
equation (resp.~disequation) under hypothesis $\Sigma$ (which is a set of
substitutions). We write $\clauseWithSubst{\emptyset}{\Sigma}$ for the empty
clause under hypothesis $\Sigma$.  The meaning of $\clauseWithSubst{s \approx
  t}{ \Sigma}$ is that for every $\sigma \in \Sigma$, $s \approx t$ is provable
using the substitution $\sigma$ for the metavariables.  We also define
$\renameVars{e}$, where $e$ is a (dis)equation, as follows: let $\sigma$ map
every rigid variable of $e$ to a fresh non-rigid variable, then $\renameVars{e}
= \clauseWithSubst{ e\sigma }{ \{ \sigma \} }$. For example,
$\renameVars{p(X)\approx a}$ is
$\clauseWithSubst{ p(v_1)\approx a}{ \{ X\mapsto v_1\} }$.

As can be noticed, we keep a set of substitutions, rather than unit clauses
paired with individual substitutions, in order to avoid duplicating the work for
alpha-equivalent clauses. Indeed, because of amplification, many instances of a
given (dis)equation might be present in a branch of the tableau. It would be
inefficient to repeat the same inference steps with each variant of the axioms.
Because we apply $\renameVars{e}$ on every input equality $e$, clauses do not
share any variable, though they may share meta-variables in their attached sets
of substitutions.

Considering a substitution as a function from variables to terms, we define the
domain of a substitution $\sigma$ as the set of variables that have a
non-trivial binding in $\sigma$.\footnote{A trivial binding maps a variable to
itself.} The co-domain of a substitution is the set of variables occurring in
terms in the image of the domain of the substitution. In the following, we will
consider idempotent substitutions, i.e.~substitutions for which the domain and
co-domain have an empty intersection.

\begin{sloppy}
The composition of two substitutions $\sigma$ and $\sigma'$, denoted by $\sigma
\circ \sigma'$, is well-defined if and only if the domains of $\sigma$ and
$\sigma'$ have no intersection. In this case, $\sigma \circ \sigma' \triangleq
\left\{ x \mapsto (x\sigma)\sigma' | x \in \text{domain}(\sigma) \right\}$. This
definition extends to sets of substitutions: $\Sigma \circ \sigma' \triangleq
\left\{ \sigma \circ \sigma' | \sigma \in \Sigma \right\}$. We then have $\sigma
\leq \sigma'$ if and only if $\exists \sigma''.~ \sigma \circ \sigma'' =
\sigma'$. This notion also extends to sets of substitutions:
$\smash{ \Sigma \leq \Sigma' }$ if and only if
$\smash{ \forall \sigma' \in \Sigma'.~ \exists \sigma \in \Sigma. \sigma \leq
\sigma' }$. The merging of two substitutions $\sigma \uparrow \sigma'$ is the
supremum of $\{\sigma,\sigma'\}$ for the order $\leq$, if it exists, or $\bot$
otherwise. The merging of sets of substitutions is
$\Sigma \uparrow \Sigma' \triangleq \left\{ \sigma \uparrow \sigma' ~|~
\sigma \in \Sigma, \sigma' \in \Sigma' \right., \sigma \uparrow \sigma' \not=
\bot \}$.
\end{sloppy}

To perform an inference step between two unit (dis)equations, we merge their
sets of substitutions. An inference rule is said to be successful if the merging
of the premises' substitution sets is non-empty. For example, the resolution
step between $p(x,x)| \{ X \mapsto a \}$ and $\lnot p(y,b)| \{ X \mapsto y \}$
is not possible, because the result would need to map $X$ to $a$ and $b$, which
is impossible because $X$ is rigid.

\subsection{Inference System}

In Fig.~\ref{fig:unit-sup-rules}, we present the rules for unit superposition
with rigid variables. We adopt notations and names from Schulz's paper on
E~\cite{SS02}. A single bar denotes an inference, i.e. we add the result to the
saturation set, whereas a double bar is a simplification in which the premises
are replaced by the conclusion(s). The relation $\prec$ is a reduction ordering,
used to orient equations and restrict inferences, thus pruning the search space.
Typically, $\prec$ is one of RPO or KBO. The rules of
Fig.~\ref{fig:unit-sup-rules} work as described below:

\begin{description}
\item[ER] is equality resolution, where a disequation
$\clauseWithSubst{s \not\approx t}{\Sigma}$ is solved by syntactically unifying
$s$ and $t$ with $\sigma$, if $\sigma$ is compatible with $\Sigma$.
\item[SN/SP] is superposition into positive or negative literals. A subterm of
$u$ is rewritten using $s \approx t$ after unifying it with $s$ by $\sigma$. The
rewriting is done only if $s\sigma \not\preceq t\sigma$, a sufficient (but not
necessary) condition for a ground instance of $s\sigma \approx t\sigma$ to be
oriented left-to-right.
\item[TD1] deletes trivial equations that will never contribute to a proof.
\item[TD2] deletes clauses with an empty set of substitutions. In practice, we
only apply a rule if the conclusion is labeled with a non-empty set of
substitutions.
\item[ME] merges two alpha-equivalent clauses into a single clause, by merging
the sets of substitutions. This rule is very important in practice, to prevent
the search space from exploding due to the duplicates of most formulas.
Superposition deals with this explosion by removing duplicates using
subsumption, but in our context subsumption is not complete because rigid
variables are only proxy for ground terms: even if $C\sigma \subseteq D$, the
one ground instance of $C$ might not be compatible with the ground instance of
$D$.
\item[ES] is a restricted form of equality subsumption. The active equation
$\clauseWithSubst{ s\approx t}\Sigma $ can be used to delete another clause, as
in E~\cite{SS02}. However, ES only works if $s$ and $t$ are syntactically equal
to the corresponding subterms in the subsumed clause $C$. Otherwise, there is no
guarantee that further instantiations will not make $s\approx t$ incompatible
with $C$. Moreover, $C$ needs not be entirely removed. Only its substitutions
that are compatible with $\Sigma$ are subsumed.
\item[RN/RP] are rewriting of clauses, which only works for syntactical
equality, not matching.
\end{description}

Rule \textbf{SN/SP} generates as many equations as there are in the set
$(\Sigma \circ \sigma'') \uparrow (\Sigma' \circ \sigma'')$ because all
substitutions may not always be merged. For instance, given two unit clauses
$f(x) = t | \{ \{ X_1 \mapsto x \}, \{ X_2 \mapsto x \} \}$ and
$f(a) = v | \{ \{ X_1 \mapsto a \} \}$, rule \textbf{SP} allows us to derive two
distinct equations
$(t = v)\{ x \mapsto a \} | \{ \{ X_1 \mapsto a \} \}$ and
$(t = v)\{ x \mapsto a \} | \{ \{ X_1 \mapsto a; X_2 \mapsto a \} \}$, which are
non-mergeable.

\begin{figure}[htb]
\begin{center}

% SN
\AXC{$\clauseWithSubst{s \approx t}{\Sigma}$}
\AXC{$\clauseWithSubst{u \mathrel{R} v}{\Sigma'}$}
\LL{SN/SP}
\BIC{$\clauseWithSubst{\sigma''(u[p \leftarrow t] \mathrel{R} v)}
{\sigma'''}$}\DP
$\text{if} \left\{ \begin{array}{l@{\quad}l}
\sigma'' = \text{mgu}(u_{|p}, s) & u_{|p} \not\in V\\
\sigma''(s) \not\preceq \sigma''(t) & \sigma''(u) \not\preceq \sigma''(v)\\
\multicolumn{2}{l}{
\sigma''' \in (\Sigma \circ \sigma'') \uparrow (\Sigma' \circ \sigma'')} \\
\multicolumn{2}{l}{R \in \{ \approx, \not\approx \} }
\end{array}\right.$\\[12pt]

\mbox{
% ER
\AXC{$\clauseWithSubst{s \not\approx t}{\Sigma}$}
\LL{ER}
\RL{if $\sigma = \text{mgu}(s, t)$}
\UIC{$\clauseWithSubst{\emptyset}{\Sigma \circ \sigma}$}\DP

% TD1
\AXC{$\clauseWithSubst{s \approx s}{\Sigma}$}
\LL{TD1}
\doubleLine{}
\UIC{$\top$}\DP

% TD2
\AXC{$\clauseWithSubst{s \mathrel{R} t}{\emptyset}$}
\LL{TD2}
\RL{$ R \in \{ \approx, \not\approx \} $}
\doubleLine{}
\UIC{$\top$}
\DP}\\[12pt]

% ME
\AXC{$\clauseWithSubst{\rho(u) \approx \rho(v)}{\Sigma}$}
\AXC{$\clauseWithSubst{u \approx v}{\Sigma'}$}
\LL{ME}
\RL{$\rho \text{ is a variable renaming}$}
\doubleLine{}
\BIC{$\clauseWithSubst{\rho(u) \approx \rho(v)}
{\Sigma \cup (\Sigma' \circ \rho)}$}\DP\\[12pt]

% ES
\AXC{$\clauseWithSubst{s \approx t}{\Sigma}$}
\AXC{$\clauseWithSubst{u[p \leftarrow s] \approx u[p \leftarrow t]}
{\Sigma' \cup \Sigma''}$}
\LL{ES}
\RL{$
\text{if} \left\{ \begin{array}{l}
\Sigma'' \not= \emptyset\\
\Sigma \leq \Sigma''
\end{array}\right.$}
\doubleLine{}
\BIC{$\clauseWithSubst{s\approx t}{\Sigma} \qquad
\clauseWithSubst{u[p\leftarrow s] \approx u[p \leftarrow t]}
{\Sigma'}$}\DP\\[12pt]

% RP
\AXC{$\clauseWithSubst{s \approx t}{\Sigma}$}
\AXC{$\clauseWithSubst{u \approx v}{\Sigma'}$}
\LL{RP}
\doubleLine{}
\BIC{$\clauseWithSubst{s \approx t}{\Sigma}$ \qquad
     $\clauseWithSubst{u[p \leftarrow t] \approx v}{\Sigma'}$}\DP
$\text{if} \left\{\begin{array}{l}
u_{|p} = s\\
s \succ t\\
\Sigma \leq \Sigma'\\
u \not\succeq v ~ \text{or} ~ p \neq \lambda\\
\end{array}\right.$\\[12pt]

% RN
\AXC{$\clauseWithSubst{s \approx t}{\Sigma}$}
\AXC{$\clauseWithSubst{u \not\approx v}{\Sigma'}$}
\LL{RN}
\doubleLine{}
\BIC{$\clauseWithSubst{s \approx t}{\Sigma}$ \qquad
     $\clauseWithSubst{u[p \leftarrow t] \not\approx v}{\Sigma'}$}\DP
$\text{if} \left\{\begin{array}{l}
u_{|p} = s\\
s \succ t\\
\Sigma \leq \Sigma'\\
\end{array}\right.$
\caption{The Set of Rules for Unit Rigid Superposition}
\label{fig:unit-sup-rules}
\end{center}
\end{figure}

\subsection{Rewriting}

Rewrite rules can be integrated into the rigid unit superposition easily. In
fact, a rewrite rule $l\rew{}r$ can be expressed as an equality with a
hypothesis set consisting of a single trivial substitution
$\clauseWithSubst{s\approx{}t}{\{\emptyset\}}$\footnote{The singleton set
containing the trivial (or identity) substitution $\{\emptyset\}$, is not to be
confused with $\emptyset$, the empty set}.  Since the trivial substitution is
compatible with every substitution, it will never prevent any inference, thus
allowing us to use the unit clause as many times as needed to rewrite terms
without accumulating constraints, particularly using the rules RP and RN, whose
side conditions are always verified by rewrite rules. Rigid unit superposition
therefore provides an algorithm for rigid E-unification modulo rewrite rules, as
detailed in the next paragraph.

\subsection{Main Loop}

Our objective with rigid E-unification is to attempt to close a branch of the
tableau prover (i.e.~a set of Boolean literals set to true). To do so, we first
create a set of unit clauses to process from the rewrite rules, and the renamed
equational or atomic literals. Then, the given-clause algorithm is applied to
try and saturate the set. Assuming a fair strategy, this will eventually find a
solution (i.e.~derive $\clauseWithSubst{\emptyset}{\Sigma}$) if there exists
one. We refer the interested reader to~\cite{SS02} for more details.

Because the whole branch is managed by a single given-clause saturation loop, we
look for all solutions susceptible to close the branch at the same time.
Moreover, this technique is amenable to incrementality, i.e.~every time a
(dis)equation is decided by the SMT solver, we could add it to the saturation
set and perform a number of steps of the given-clause algorithm.

To illustrate the calculus, we detail Fig.~\ref{fig:unit-sup-proof-example}.
a refutation of the following set of
clauses stemming from set theory, where pair, fst, and snd are the constructor
and destructors of tuples, $f$ a function on tuples, and $X$ a rigid variable:

\[\begin{array}{rcl}
a &\preceq b \\
\text{pair}(\text{fst}(x), \text{snd}(x))) &\rew& x\\
\text{fst}(a) &\approx& \text{fst}(b)\\
p(a) &\not\approx& p(\text{pair}(\text{fst}(b), X))\\
\end{array}\]

\begin{figure}[t]
\begin{center}
\begin{tabular}{clc}
1 & rewrite rule & $\text{pair}(\text{fst}(x), \text{snd}(x))) \rew x$\\

2 & axiom & $\text{fst}(a) = \text{fst}(b)$\\

3 & axiom & $p(a) \not= p(\text{pair}(\text{fst}(b), X))$\\

4 & \textsf{rewr}(1) &
$\clauseWithSubst
{ \text{pair}(\text{fst}(x), \text{snd}(x)) \approx x }
{ \{ \} }$\\

5 & \renameVarsSymb(2) &
$\clauseWithSubst
{ \text{fst}(a) \approx \text{fst}(b) }
{ \{ \} }$\\

6 & \renameVarsSymb(3) &
$\clauseWithSubst
{ p(a) \not\approx p(\text{pair}(\text{fst}(b), y)) }
{ \{ \mapVar{X}y \} }$\\

\midrule

7 & RN(5,6) &
$\clauseWithSubst
{ p(a) \not\approx p(\text{pair}(\text{fst}(a), y)) }
{ \{ \mapVar{X}y \} }$\\

8 & SN(4,7) &
$\clauseWithSubst
{ p(a) \not\approx p(a) }
{ \{ \mapVar{X}{\text{snd}(a)} \} }$\\

9 & ER(8) &
$\clauseWithSubst
{ \emptyset }
{ \{ \mapVar{X}{\text{snd}(a)} \} }$
\end{tabular}
\caption{Proof of a Set Theory Problem}
\label{fig:unit-sup-proof-example}
\end{center}
\end{figure}


\documentclass[9pt]{beamer}
% \documentclass[9pt,handout]{beamer}

\usepackage{ucs}
\usepackage[utf8x]{inputenc}
% \usepackage{beamerthemeplain}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[english]{babel}
\usepackage{fontenc}
% \usepackage{verbatim}
\usepackage{graphics}

\usepackage{textcomp}
\usepackage[absolute,overlay]{textpos}

\usepackage{wasysym}

\usepackage{slashed}
\usepackage{array}

\usetheme{CNRScolors}

\input{../newcommands.tex}
\input{../custom-definitions.tex}

\graphicspath{ {../figures/}{./} }

\setbeamertemplate{navigation symbols}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \setbeameroption{show notes} % un-comment to see the notes
% \setbeamertemplate{note page}[plain]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifmynote
% \mynotetrue
\mynotefalse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifmyhide
% \myhidetrue
\myhidefalse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand\mynote[1]{%
\ifmynote \textbf{#1} \else \fi
}
\newcommand\myhide[1]{%
\ifmyhide \vspace{15pt} \begin{center} \myexample{(blackboard)}\end{center} \vspace{15pt} \else #1 \fi
}

 \newcolumntype{x}[1]{%
>{\centering\hspace{0pt}}p{#1}}%
\newcommand{\tn}{\tabularnewline}

\date[Stat2]{Sept. 27, 2018}
\title{Methods of statistical analysis and simulation}
\subtitle{2. Parameter estimation}
\author[E. Chapon]{Émilien Chapon}
% \institute[(CERN)]{CERN}
% \logo{\includegraphics[height=0.6cm]{../../CMS-Color-Label.pdf}\hspace{1.05\textwidth}\includegraphics[height=0.6cm]
% {../../LogoBadge.pdf} }

\begin{document}

{
\setbeamertemplate{footline}{}
\setbeamertemplate{headline}{}
% \logo{\includegraphics[height=1.2cm]{../../CMS-Color-Label.pdf}
% \hspace{0.94\textwidth}\includegraphics[height=1.2cm]{../../LogoBadge.pdf}}

\begin{frame}
 \maketitle

%  \setcounter{framenumber}{0}
\end{frame}
}

% CONTENU
% point estimation... cf cours ED, compléter avec le F. James

\begin{frame}
 \frametitle{Outline}

 \tableofcontents
\end{frame}

\section{Information}

\begin{frame}
 \frametitle{The likelihood function}

 We discuss a random variable $X$, with pdf $f(X|\theta)$, where $\theta$ is a real parameter (or a set of $k$ real parameters).
 The set of allowed values of $X$ is denoted $\Omega_\theta$.

\myhide{
 We consider $N$ independent observations of $X$: $X_1,\dots,X_N$. The joint pdf is, by independence,

 $$P(\vec{X}|\theta) = P(X1,\dots,X_N)|\theta) = \prod_{i=1}^N f(X_i|\theta)$$

 \begin{block}{Likelihood function}
  The likelihood function is a function of $\theta$, given the observed data $X^0$:

  $$\mathcal{L}(\theta) = P(X^0|\theta)$$
 \end{block}

}

\end{frame}

\begin{frame}
 \frametitle{Notes on the likelihood function}

 \begin{itemize}
  \item It is tempting to consider the area under $\mathcal{L}$, but $\mathcal{L}(\theta)$ is not a probability distribution function in $\theta$: \alert{the area under $\mathcal{L}$ is meaningless}.
  \item We will see that likelihood ratios are often used.
 \end{itemize}

\end{frame}

\begin{frame}
 \frametitle{Likelihood function: example}

 \begin{itemize}
  \item Poisson probability $P(n|\mu) = \mu^n \frac{e^{-\mu}}{n!}$
  \item Suppose $n=3$ is observed. We get the likelihood function:
  $$\mathcal{L}(\mu) = \mu^3 \frac{e^{-\mu}}{3!}$$
 \end{itemize}

 \begin{center}
  \includegraphics[width=0.6\textwidth]{likelihood_Poisson.png}
 \end{center}

\end{frame}

\begin{frame}
 \frametitle{Statistic}

 \begin{block}{Definition}
  Suppose a new random variable: $T = T(X_1,\dots,X_N)$. Any such function $T$ is called a \textbf{statistic}.
 \end{block}

 Example: sample mean $\bar{X}$.

 \vspace{10pt}

 NB: careful not to confuse this \textbf{statistic} with \textbf{statistics} (the field of mathematics we are discussing) or \textbf{statistics} (physicist's jargon as a substitute for
 ``data'' or ``amount of data''. Better avoid the latter usage when writing papers!

\end{frame}

\begin{frame}
 \frametitle{Information of R.A. Fisher}

 \begin{block}{Definition}
 \myhide{If $\Omega_\theta$ is independent of $\theta$, and if $\mathcal{L}(X|\theta)$ is regular enough to allow the operators $\partial^2/\partial\theta^2$ and $\int \dd X$ to comute, then
  \begin{eqnarray}
   I_X(\theta) & = & E \left[ \left( \frac{\partial \ln \mathcal{L}(X|\theta)}{\partial \theta} \right)^2 \right] \nonumber \\
   & = & \int_{\Omega_\theta} \left( \frac{\partial \ln \mathcal{L}(X|\theta)}{\partial \theta} \right)^2 \mathcal{L}(X|\theta) \dd X \nonumber \\
   & = & - E \left[ \frac{\partial^2 \ln \mathcal{L}(X|\theta)}{\partial \theta^2}  \right] \nonumber
  \end{eqnarray}
}
 \end{block}

 NB: this is an additive property (the information of $N$ observations is $N$ times the information of 1 observation).

\end{frame}

\begin{frame}
 \frametitle{Sufficient statistics}

 \begin{block}{Definition}
  A statistic is said to be \textbf{sufficient} if $f(\vec{X}|T)$ is independent of $\theta$.
 \end{block}

 Properties:

 \begin{itemize}
  \item<2-> If $T$ is a sufficient statistic for $\theta$, then any strictly monotonic function of $T$ is also a sufficient statistic for $\theta$.
  \item<3> $T(\vec{X})$ is a sufficient statistic for $\theta$ iff the likelihood factorises as
  $$\mathcal{L}(\vec{X}|\theta) = g(T,\theta) h(\vec{X}),$$
  where:
  \begin{enumerate}
   \item $h(\vec{X})$ does not depend on $\theta$
   \item $g(T,\theta) \propto A(T|\theta)$, the conditional pdf for $T$ given $\theta$.
  \end{enumerate}
 \end{itemize}

\end{frame}

\begin{frame}
 \frametitle{Darmois theorem}

 This theorem proves that only a very restricted class of probability density functions admits a number of sufficient statistics independent of the number of observations.

 \begin{itemize}
  \item<2-> Whatever $\Omega_\theta$, if there exists a number $N>1$ such that the set $X1,\dots,X_N$ admits a sufficient statistic for $\theta$, then the pdf is of the ``exponential form''
  $$f(X|\theta) = \exp [ \alpha(X)a(\theta) + \beta(X) + c(\theta)]$$
  \item<3> Inversely, $(X1,\dots,X_N)$ admits a sufficient statistic for all $N>1$ (but only if $\Omega_\theta$ does not depend on $\theta$), if $f(X|\theta)$ has the exponential form,
  and if the mapping $(X_1,\dots,X_N) \Rightarrow (R,X_2,\dots,X_N)$, with
  $$R = \sum_{i=1}^N \alpha(X_i),$$
  is one-to-one and continuously differentiable for all $X$. $R$ is sufficient for $\theta$, as well as any monotonic function of $R$.
 \end{itemize}

\end{frame}

\section{Parameter estimation on unbinned data}

\begin{frame}
 \frametitle{Outline}

 \tableofcontents[current]
\end{frame}

\begin{frame}
 \frametitle{Parameter estimation}

 Let $X$ be a random variable of pdf $f(x;\theta_0)$, with $\theta_0$ unknown. We draw $N$ independent trials of $X$, $\{x_1,\dots,x_N\}$.

 An \textbf{estimator} is a statistic $t_N(x_1,\dots,x_N)$ that can be used to estimate $\theta_0$. It can have the following properties:

 \mynote{Écrire au tableau le nom des différentes prioriétés, les afficher 1 par 1 au tableau}

 \begin{description}
  \item<2->[unbiased]: if $\langle t_N \rangle = \theta_0$ (otherwise the bias is $\langle t_N \rangle - \theta_0 = b_N$)
  \item<3->[convergent] or consistent: e.g. consistency in probability, $\forall \epsilon>0, \forall \eta>0, \exists N_0 / \forall N>N_0, P(|t_N - \theta_0|>\epsilon)<\eta$
  \begin{itemize}
   \item NB: The law of large numbers is equivalent to the statement that the sample mean is a consistent estimator of the parent mean.
  \end{itemize}
  \item<4->[efficient]: if the variance of the estimator $V(t_N) \xrightarrow[N\to\infty]{} \text{minimum variance bound}$ (this property can be only asymptotic)
  \item<5->[optimal]: if $t_N$ minimises the Mean Square Error (MSE): $\text{MSE}(t_N) = V(t_N) + b_N$
  \begin{itemize}
   \item NB: unbiasedness and efficiency imply optimality
  \end{itemize}
  \item<6>[robust]: if it does not depend on a hypothesis on the pdf
 \end{description}

\end{frame}

\begin{frame}
 \frametitle{Illustration}

 pdfs for $t_N$ in different cases

 \includegraphics[width=\textwidth]{estimators.jpg}
\end{frame}

\begin{frame}
 \frametitle{Minimum variance: Cramér-Rao inequality}

 Let $\vec{X}$ be observations from a distribution with pdf $f(\vec{X}|\theta)$, the likelihood is $\mathcal{L}_{\vec{X}} = L(\vec{X}|\theta)$.

 \myhide{
 \begin{block}{Cramér-Rao inequality}
 If the range of $\vec{X}$ does not depend on $\theta$, and if $\mathcal{L}_{\vec{X}}$ is sufficiently regular that differentiation with respect fo $\theta$ and integration over
 $\theta$ commute, then:

  $$V(\hat{\theta}) \geq \frac{[1+(\dd b / \dd \theta)]^2}{I_{\hat{\theta}}}
  \geq \frac{[1+(\dd b / \dd \theta)]^2}{I_{\vec{X}}}
  = \frac{\left( \frac{\dd \tau(\theta)}{\dd \theta} \right)^2}{E\left[ \left( \frac{\partial \ln \mathcal{L}_{\vec{X}}}{\partial \theta} \right)^2 \right]}$$

  where $I_{\vec{X}}$ is the Fisher information, $I_{\vec{X}}(\theta) = E\left[ \left( \frac{\partial \ln \mathcal{L}(\theta|\vec{X})}{\partial \theta} \right)^2 \right]$, and
  $\tau(\theta) \equiv E(\hat{\theta}) = \theta + b(\theta)$
 \end{block}}

\end{frame}

\begin{frame}
 \frametitle{Efficiency and minimum variance}

 \begin{block}{First part of the inequality: minimum variance}
  $V(\hat{\theta}) = \frac{[1+(\dd b / \dd \theta)]^2}{I_{\hat{\theta}}} $ iff the sampling distribution of $\hat{\theta}$ is of the exponential form:

  $$\mathcal{L}_{\hat{\theta}} = \exp [a(\theta)\hat{\theta} + \beta(\hat{\theta}) + c(\theta)]$$
 \end{block}

 \uncover<2>{
 \begin{block}{Second part of the inequality: minimum bound variance (efficient estimator)}
  $V(\hat{\theta}) = \frac{[1+(\dd b / \dd \theta)]^2}{I_{\vec{X}}} $ iff $ I_{\hat{\theta}} = I_{\vec{X}} $,

  ie iff $\hat{\theta}$ is a sufficient statistic for $\theta$,

  ie  iff $f(\vec{X}|\theta)$ is of the exponential form (Darmois' theorem).
 \end{block}}

\end{frame}

\begin{frame}
 \frametitle{Usual methods of constructing consistent estimators}

 We will see:

 \begin{itemize}
  \item the moments method
  \item the maximum likelihood method
  \item the linear least squares method
 \end{itemize}

 \uncover<2>{NB: the last two are \textbf{implicitly defined estimators}, defined through an equation of the type $\xi(\hat{\theta})=0$}

\end{frame}

\subsection{Moments method}

\begin{frame}
 \frametitle{The moments method}

 We can use the law of large numbers:

 $$\frac{1}{N} \sum_{i=1}^N a(X_i) \xrightarrow[N\to\infty]{} E[a(X)] = \int a(X)f(X,\theta_0)\dd X$$

 Let $a(X)$ such that $E[a(X)] = \int a(X) f(X;\theta) \dd X = h(\theta)$ where $h$ is known.

 If $h$ is invertible, we can find the true value of $\theta$:
 $\theta_0 = h^{-1}(E[a]) = h^{-1}\left(\int a(X) f(X;\theta) \dd X\right)$

 \begin{block}{}
 The estimator is then:

 $$\hat{\theta} = h^{-1} \left( \frac{1}{N} \sum_{i=1}^N a(x_i) \right)$$
 \end{block}

 NB: $\hat{\theta}$ does not directly depend on $f$, only on the $x_i$: this is a \textbf{robust estimator}.
\end{frame}

\begin{frame}
 \frametitle{The moments method: application}

 \myhide{
 \begin{block}{1D case ($\theta \in \mathbb{R}$)}
  We take simply $a(X) = X$. Then $h(\theta_0) = \bar{X} = \mu$: it is the sample mean.
 \end{block}

 \begin{block}{ND case: $\vec{\theta} = (\theta_1,\dots,\theta_K)$}
  We take $a_j(X) = X^j$. Then $h_j(\vec{\theta}) = \mu_j(\vec{\theta})$: $j$-ith moment of $f(X;\vec{\theta})$
 \end{block}
}

\end{frame}

\subsection{Maximum likelihood method}

\begin{frame}
 \frametitle{The maximum likelihood method (ML)}

 \myhide{
 In general the logarithm of $\mathcal{L}$ is used: $\ln \mathcal{L}\left(\vec{X};\theta\right) = \sum_{i=1}^N \ln f(X_i;\theta)$

 \begin{block}{Maximum likelihood estimator}
  $$\left. \frac{\partial (\ln \mathcal{L} \left(\vec{X};\theta\right)}{\partial \theta}\right|_{\hat{\theta}_\text{ML}} = \left.\frac{\partial}{\partial \theta} \left(  \sum_{i=1}^N \ln f(X_i;\theta) \right)\right|_{\hat{\theta}_\text{ML}} = 0$$

  $\hat{\theta}_\text{ML}$ is the maximum likelihood estimator of $\theta$.
 \end{block}}

 \uncover<2>{Note: numerical methods are often designed to look for a minimum rather than a maximum. $-2 \ln \mathcal{L}$ is more commonly used.}

\end{frame}

\begin{frame}
 \frametitle{The maximum likelihood estimator (MLE)}

 This estimator is
 \begin{itemize}
  \item<1-> \textbf{asymptotically efficient}
  \item<2-> \textbf{biased} (except when the likelihood is of the exponential form)
  \item<3-> \textbf{non optimal} (except when the likelihood is of the exponential form)
  \item<4-> \textbf{convergent}
  \item<5-> \textbf{invariant}: the ML estimate $\hat{\tau}$ of a function $\tau(\theta)$ is $\hat{\tau} = \tau(\hat{\theta})$
  \begin{itemize}
   \item However other properties of the MLE (e.g. the bias) are not invariant under change of parameter.
  \end{itemize}
  \item<6-> \textbf{not robust}: it requires to know the form of the PDF!
 \end{itemize}

 \uncover<7->{NB: invariance is an important and convenient property!}

\end{frame}

\begin{frame}
 \frametitle{Variance of the MLE}

 Because of asymptotic minimum variance bound:
 $$V(\hat{\theta}_{ML}) \xrightarrow[N\to\infty]{} \frac{1}{N} \left[ \left.-E\left(\frac{\partial^2\ln f(x;\theta)}{\partial \theta^2}\right)\right|_{\theta=\theta_0} \right]^{-1} \approx \frac{1}{D_2(\theta=\hat{\theta}_{ML})}$$

 \vspace{20pt}

 For finite samples, this can result in a misestimation of the variances. In the large sample limit (or in a linear model with Gaussian data), $\mathcal{L}$ is Gaussian and $\ln\mathcal{L}$ is (hyper)parabolic. Then contours with $s$ times the standarad deviations $\sigma_i$ can be found from the (hyper)surface defined by $\theta$ such that:

 $$\ln\mathcal{L}(\theta) = \ln\mathcal{L}(\hat{\theta}_\text{ML}) - s^2/2$$

 \uncover<2>{NB: $\ln(\mathcal{L}(\theta))$ can always be made parabolic through a change of variable, without changing the MLE, thanks to invariance.}
\end{frame}

\begin{frame}
 \frametitle{MLE: illustration for Gaussian data (unknown $\mu$, known $\sigma$)}

%  Plot $-\ln\mathcal{L}$, analytically, in 2 cases: a) Gaus, b) Poisson

 $$\mathcal{L}(\mu) = \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}}$$

 $$-2\ln(\mathcal{L}(\mu)) = \frac{(x-\mu)^2}{\sigma^2} + \text{constant}$$

 \mynote{Jupyter here}
\end{frame}

\begin{frame}
 \frametitle{MLE: illustration for Poisson data}

 \mynote{Exercise}

 $$\mathcal{L}(\mu) = \mu^N \frac{e^{-\mu}}{N!}$$

 $$-2\ln(\mathcal{L}(\mu)) = -2 \times \left(N \times \ln \mu - \mu \right) + \text{constant} $$

 \begin{exampleblock}{}
  \begin{itemize}
   \item What is the MLE?
   \item What is the variance of the MLE? How does it compare to the minimum variance bound?
%    \item Compare to the value of $\mu$ such that $$-2 \times \ln\mathcal{L}(\theta) = -2\times\ln\mathcal{L}(\hat{\theta}_\text{ML}) +1$$
  \end{itemize}

 \end{exampleblock}

 \mynote{Jupyter here, + solving in the blackboard. $I_N(\mu) = E(-\frac{\partial^2}{\partial\mu^2} \ln \mathcal{L}(\mu|N)) = E(N/\mu^2) = 1/\mu$}

\end{frame}

\begin{frame}
 \frametitle{MLE: likelihood scans}

 From the CMS Higgs boson mass measurement (\href{http://cms-results.web.cern.ch/cms-results/public-results/publications/HIG-14-009/index.html}{EPJC 75 (2015) 212}):

 \begin{center}
  \includegraphics[width=0.7\textwidth]{CMS-HIG-14-009_Figure_002-a}
 \end{center}

\end{frame}

\begin{frame}
 \frametitle{(Academic) example of a poor MLE}

 \mynote{Exercise}

 \begin{exampleblock}{}
  A random variable $X$ is uniformly distributed on the interval $[0,\theta]$. $N$ indpendent trials $\{x_i\}$ are drawn. What is the MLE? Can you think of a better estimate?
 \end{exampleblock}

 \uncover<2->{
 \begin{itemize}
  \item The likelihood function is $\mathcal{L} = \prod_{i=1}^N \theta^{-1} = \theta^{-N}$ and the MLE is $\hat{\theta} = \max\{X_i\}$.
  \item<3-> The MLE is biased (always too small by definition)... intuitively $\hat{\theta}_{CS} = \max\{X_i\} + \max\{X_i\}/N$ is a better estimate.
 \end{itemize}
 }
\end{frame}

\begin{frame}
 \frametitle{(Academic) example of a poor MLE}

 \begin{center}
  \includegraphics[width=0.7\textwidth]{academic_MLE.jpg}
 \end{center}

\end{frame}

\subsection{Least squares method}

\begin{frame}
 \frametitle{Outline}

 \tableofcontents[current]
\end{frame}

\begin{frame}
 \frametitle{Least squares method (aka $\chi^2$ estimator)}

 We consider $N$ observations $\vec{x}$

 $E(x_i;\vec{\theta})$ is a  and $V_{ij}$ ($i,j = 1\dots N$) are \textbf{known functions} of $\vec{\theta}$

 \myhide{
 \begin{block}{Least squares estimator}
 The estimator is the value $\vec{\theta}$ such that $Q$ is minimum:

  $$Q = \left[ \vec{X} - E(\vec{X};\vec{\theta}\right]^\intercal V^{-1} (\vec{\theta}) \left[ \vec{X} - E(\vec{X};\vec{\theta}) \right]$$

  $$Q = \sum_{i=1}^N \sum_{j=1}^N \left[ X_i - E(X_i;\vec{\theta})\right] V^{-1}_{ij} \left[ X_j - E(X_j;\vec{\theta})\right]$$
 \end{block}
 }

 \uncover<2>{
 This estimator is:

 \begin{itemize}
  \item \textbf{consistent}
  \item (generally) \textbf{biased}
  \item \textbf{non-optimal}
 \end{itemize}
}

\end{frame}

\begin{frame}
 \frametitle{Gaussian case}

 In the Gaussian case, the least squares and maximum likelihood methods coincide.

 Assuming $N$ independent measurements $y_i$ at known points $x_i$, Gaussian distributed with mean
 $\mu(x_i;\theta)$ and known variance $\sigma_i^2$:

 $$\chi^2(\theta) = -2\ln\mathcal{L}(\theta) + \text{constant} = \sum_{i=1}^N \frac{\left(X_i - \mu(\theta)\right)^2}{\sigma_i^2}$$
\end{frame}

\begin{frame}
 \frametitle{$\chi^2$ estimator: uncorrelated case}

 \myhide{
 Uncorrelated case: $V_{ij} = 0 $ for $i \neq j$

 $$Q = \sum_{i=1}^N \frac{\left(x_i - E(x_i; \vec{\theta})\right)^2}{\sigma_i^2(\vec{\theta})}$$}
\end{frame}

\begin{frame}
 \frametitle{Variance of the $\chi^2$ estimator}

 \myhide{
 If $\theta \in \mathbb{R}$:

 $$V(\hat{\theta}_{LS}) \xrightarrow[N\to\infty]{} 2\left(\left.\frac{\partial^2 Q}{\partial\theta^2}\right|_{\theta=\theta_0}\right)^{-1} \approx \frac{2}{D_2(\theta=\hat{\theta}_{LS})}$$
 }
\end{frame}

\begin{frame}
 \frametitle{Specific cases of the $\chi^2$ estimator}

 \begin{block}{Linear case}
  If \structure{$\sigma_i$ are independent of $\theta$, and $E(x_k;\theta)$ linear function of $\theta$}: $Q$ is \textbf{optimal} and \textbf{convergent}.
 \end{block}

 \uncover<2->{
 \begin{block}{Gaussian case}

 \begin{itemize}
  \item If \structure{the $x_i$ follow a normal law $G(X_i;\mu_i,\sigma_i)$}: $Q$ follows a $\chi^2$ law, $\chi^2(Q;N)$:

  $$\chi^2(\vec{\theta}) = \sum_{i=1}^N \frac{\left( X_i - \mu_i (\vec{\theta})\right)^2}{\sigma_i^2 (\vec{\theta})}$$
  \item<3>If in addition \structure{the model is linear ($\sigma_i$ independent of $\theta$)}: $\chi^2_\text{min} = \chi^2 (\chi^2_\text{min};N-r)$ (with $r$ the dimension of $\vec{\theta}$), and $\vec{\theta}_{LS}$ follows a normal law of dimension $r$ with $\langle \hat{\theta}_{LS}\rangle = \vec{\theta}_0$, $V = 2 D_2^{-1}$

  $N-r$ is \textbf{the number of degrees of freedom}.
 \end{itemize}

 \end{block}}

\end{frame}

\section{Parameter estimation with histograms}

\begin{frame}
 \frametitle{Outline}

 \tableofcontents[current]
\end{frame}

\begin{frame}
 \frametitle{Histograms}

 Let's assume an histogram with $N$ uncorrelated bins (the total number of events is not fixed): $d_i$ events in bin $i$, with $i = 1 \dots N$. The $d_i$ follow Poisson laws: $E(d_i;\theta) = f_i(\theta)$,
 $\sigma^2(d_i;\theta) = f_i(\theta)$.

 \vspace{10pt}

 \begin{center}
  \includegraphics[width=0.8\textwidth]{histo}
 \end{center}

\end{frame}

\begin{frame}
 \frametitle{Usual methods for fitting histograms}

 \myhide{
 \begin{block}{Minimum $\chi^2$ method (expected uncertainties)}
 \vspace{-7pt}
  $$Q_P = \sum_{i=1}^N = \frac{\left(d_i - f_i\right)^2}{f_i^2}$$
  \vspace{-7pt}
 \end{block}

 \begin{block}{Modified minimum $\chi^2$ method (observed uncertainties)}
 \vspace{-7pt}
  $$Q_N = \sum_{i=1}^N = \frac{\left(d_i - f_i\right)^2}{d_i^2}$$
  \vspace{-7pt}
 \end{block}

 \begin{block}{Binned likelihood (multinomial data)}
 \vspace{-7pt}
  $$\ln \lambda = - \sum_{i=1}^N d_i \ln (d_i/f_i) = \sum_{i=1}^N d_i \ln (f_i) + \text{constant}$$
  \vspace{-7pt}
 \end{block}

\begin{block}{Binned likelihood (Poisson data)}
\vspace{-7pt}
  $$\ln \lambda = - \sum_{i=1}^N f_i - d_i + d_i \ln (d_i/f_i) = - \sum_{i=1}^N f_i - d_i \ln (f_i) + \text{constant}$$
  \vspace{-7pt}
 \end{block}}

\end{frame}

\begin{frame}
 \frametitle{}

 All methods are asymptotically equivalent. The binned likelihood method converges faster (and the modified $\chi^2$ is the slowest), and is less sensitive to empty bins.
\end{frame}

\section{Some basic estimators}

\begin{frame}
 \frametitle{Outline}

 \tableofcontents[current]
\end{frame}

\begin{frame}
 \frametitle{Sample mean}

 \mynote{Écrire d'abord au tableau}

 \uncover<2>{
 $$\bar{X} = \sum_{i=1}^N \frac{x_i}{N} = \bar{\mu}$$

 This estimator is \textbf{unbiased}, thanks to the central limit theorem.

 Its variance is:

 $$V(\hat{\mu}) = \frac{\sigma^2}{N},\qquad\text{i.e.}\quad \sigma(\hat{\mu}) = \frac{\mu}{\sqrt{N}}$$

 The sample mean is an \textbf{efficient estimator} of the mean of a Gaussian, but not in the general case.
 }
\end{frame}

\begin{frame}
 \frametitle{Variance estimator: known mean}

 \mynote{Écrire d'abord au tableau}

 \uncover<2>{
 $$\hat{V}_\mu = \frac{1}{N} \sum_{i=1}^N (x_i-\mu)^2$$

 This estimator is \textbf{consistent and unbiased}: $\langle \hat{V}_\mu \rangle = \frac{N\langle (x-\mu)^2 \rangle}{N} = V$
 }
\end{frame}

\begin{frame}
 \frametitle{Variance estimator: unknown mean}

 \myhide{
 Using $\hat{\mu} = \bar{X}$

 $$\hat{V}_b = \frac{1}{N} \sum_{i=1}^N (x_i-\bar{X})^2 = \frac{1}{N} \sum_{i=1}^N (x_i^2 - \bar{X}^2)$$

 \begin{eqnarray}
  \langle \hat{V}_b \rangle & = & \frac{N \langle X^2 - \bar{X}^2 \rangle}{N} = \langle X^2 \rangle - \langle \bar{X} \rangle^2 \nonumber \\
  & = & \langle X^2 \rangle - \langle X \rangle^2 - \left( \langle \bar{X}^2 \rangle - \langle \bar{X} \rangle ^2 \right) \nonumber \\
  & = & V(X) - V(\bar{X}) \nonumber \\
  & = & V(X) - \frac{V(X)}{N} \nonumber \\
  & = & \left( 1 - \frac{1}{N} \right) V(X)\quad \neq V(X) \nonumber
 \end{eqnarray}

 This estimator is biased! $\rightarrow$ \textbf{Bessel correction}
 }

\end{frame}

\begin{frame}
 \frametitle{Variance estimator: unknown mean}

 \mynote{Écrire d'abord au tableau}

 \begin{block}{}
  $$\hat{V} = \frac{1}{N-1} \sum_{i=1}^N (x_i - \bar{X})^2$$
 \end{block}

 $$V(\hat{V}) = \frac{2V}{N}$$

\end{frame}

\section{Point estimation in practice}

\begin{frame}
 \frametitle{Outline}

 \tableofcontents[current]
\end{frame}

\begin{frame}
 \frametitle{Choice of estimator}
 \structure{How to choose an estimator?} It should have the following properties:

 \begin{itemize}
  \item<2-> Consistency and unbiasedness
  \item<3-> Minimum loss of information
  \item<4-> Minimum variance (efficient estimator)
  \item<5-> Robustness
  \item<6-> Simplicity (e.g. if possible normally distributed, etc.)
  \item<7-> Minimum computer time
  \item<8-> Minimum loss of physicist's time
 \end{itemize}

\end{frame}

\begin{frame}
 \frametitle{Monte-Carlo (``toy'') studies}

 \begin{block}{}
  Monte-Carlo studies: directly related to the frequentist paradigm (simulate experiment many times to estimate pdf)
 \end{block}

It is possible to write simple, short, fast Monte Carlo programs
that generate data for fitting.   Can then look at fit values,
uncertainties, and pulls.  These are often called “toy” Monte
Carlos to differentiate them from complicated event and detector
simulation programs.

\begin{itemize}
 \item Tests likelihood function.
 \item Tests for bias.
 \item Tests that uncertainty from fit is correct.
\end{itemize}

\uncover<2>{
This does NOT test the correctness of the model of the data.  For
example, if you think that some data is
Gaussian
distributed, but
it is really
Lorentzian, then the simple Monte Carlo test will not reveal this.}
\end{frame}

% \begin{frame}
%  \frametitle{Simple Monte Carlo}
%
%  \begin{exampleblock}{Exercise}
%   \begin{itemize}
%    \item Generate exponential ($\tau_0=0.5$ and $N=1000$)
%    \item Find MLE
%    \item Repeat many times (e.g. 1000 times)
%    \item Plot $\hat{\tau}$%, $\sigma(\hat{\tau})$, pulls ($= (\hat{\tau}-\tau_0)/\sigma(\hat{\tau})$) in histograms
%    \item Repeat for other estimators, especially binned
%   \end{itemize}
%  \end{exampleblock}
%
% \end{frame}

% \subsection{More realistic cases}

% cf Fred James + PDG stat review

\begin{frame}
 \frametitle{Extended likelihood}

 In many cases the number of events $n$ is not fixed: this dependence should be included in the likelihood: this is called the extended likelihood.

 \myhide{$$\mathcal{L}(\vec{\theta}) = \structure{\frac{\mu^n}{n!}e^{-\mu}} \prod_{i=1}^{n} f(x_i | \vec{\theta})$$}

 $\mu$ sometimes depends on $\vec{\theta}$ itself, providing additional information.
\end{frame}

\begin{frame}
 \frametitle{Extended likelihood: illustration}

 \FrameText{\href{http://lhcbproject.web.cern.ch/lhcbproject/Publications/LHCbProjectPublic/LHCb-PAPER-2016-020.html}{JHEP 1609 (2016) 153}}

 \begin{center}
  \includegraphics[width=0.7\textwidth]{fig1a}
 \end{center}

\end{frame}

\begin{frame}
 \frametitle{Nuisance parameters}

 The parameters of the likelihood are usually split in two categories:

 \begin{itemize}
  \item \textbf{parameters of interest} $\vec{\theta}$: the parameters we are interested in measuring;
  \item \textbf{nuisance parameters} $\vec{\nu}$: other parameters.
 \end{itemize}

 Example: the likelihood could depend on $\sigma_S$, the signal cross section (a parameter of interest), and $\mu_B$, a background cross section (a nuisance parameter).

\end{frame}

\begin{frame}
 \frametitle{Nuisance parameters}

 \centering
 \includegraphics[width=0.9\textwidth]{ATLAS_WW_ex1.png}
\end{frame}

\begin{frame}
 \frametitle{Nuisance parameters}

 \centering
 \includegraphics[width=0.9\textwidth]{ATLAS_WW_ex2.png}
\end{frame}

\begin{frame}
 \frametitle{Nuisance parameters in practice}

 It is often useful to ``constrain'' the nuisance parameters if possible:

 \uncover<2->{
 \begin{block}{Using prior knowledge}
  Assume that we know the pdf for $\vec{\nu}$: $P_{\vec{\nu}}$. Then the likelihood becomes:

 \myhide{$$\mathcal{L}(\vec{\theta},\vec{\nu}) = P_x(\vec{x}|\vec{\theta},\vec{\nu}) P_{\vec{\nu}}(\vec{\nu})$$ }
 \end{block}
 }

 \uncover<3->{
 \begin{block}{Using auxiliary data}
 Assume that we have $\vec{y}$ measurements, statistically independent from $\vec{x}$, and described by a model $P_y(\vec{y}|\vec{\nu})$. Then:

  \myhide{$$\mathcal{L}(\vec{\theta},\vec{\nu}) = P_x(\vec{x}|\vec{\theta},\vec{\nu}) P_y(\vec{y}|\vec{\nu})$$}
 \end{block}

 Technical note: if one wants to simulate the experiment with Monte Carlo, $\vec{x}$ and $\vec{y}$ must be generated under assumption of \textbf{fixed} values for $\vec{\theta}$ and $\vec{\nu}$. (Do not vary $\vec{\theta}$ and $\vec{\nu}$ for each toy!)}
\end{frame}

\begin{frame}
 \frametitle{Frequentist treatment of nuisance parameters: profile likelihood}

 It is useful to remove the dependence of the likelihood $\mathcal{L}(\vec{\theta},\vec{\nu})$ on the nuisance parameters $\vec{\nu}$, by defining the profile likelihood:

 \myhide{$$\mathcal{L}_\text{p}(\vec{\theta}) = \mathcal{L}(\vec{\theta},\hat{\hat{\vec{\nu}}}(\vec{\theta})),$$}

 where $\hat{\hat{\vec{\nu}}}(\vec{\theta})$ is the value of $\vec{\nu}$
 the maximises the likelihood for a given value of $\vec{\theta}$. We'll come back to profile likelihood later.
\end{frame}

\begin{frame}
 \frametitle{Profile likelihood scan}
 \FrameText{\href{http://cms-results.web.cern.ch/cms-results/public-results/publications/HIG-13-001/index.html}{EPJC 74 (2014) 3076}}

 \begin{center}
 \includegraphics[width=0.44\textwidth]{CMS-HIG-13-001_Figure_019}\hfill
  \includegraphics[width=0.55\textwidth]{CMS-HIG-13-001_Figure_022-a}
 \end{center}

 ``stat only'' means nuisance parameters $\vec{\nu}$ fixed to their best fit value $\hat{\hat{\vec{\nu}}}(\hat{\vec{\theta}})$: $\mathcal{L}(\vec{\theta},\hat{\hat{\vec{\nu}}}(\hat{\vec{\theta}}))$ (conditional PDF),\\
 the other curve is the \textbf{profile likelihood scan} $\mathcal{L}_\text{p}(\vec{\theta}) = \mathcal{L}(\vec{\theta},\hat{\hat{\vec{\nu}}}(\vec{\theta}))$.

\end{frame}

\section{Bayesian inference}

\begin{frame}
 \frametitle{Outline}

 \tableofcontents[current]
\end{frame}

\begin{frame}
 \frametitle{Bayesian inference}

 \mynote{Write Bayes' theorem on the black board}

 Reminder: Bayes' theorem:

 \uncover<2->{
 $$\alert{p(\theta | x_0)} = \frac{\mathcal{L}(x_0|\theta) \structure{\pi(\theta)}}{\int \mathcal{L}(x_0|\theta^\prime) \structure{\pi(\theta^\prime)} \dd \theta^\prime}$$

 Bayesian inference is about determining the posterior probability, $\alert{p(\theta | x_0)}$. We see that it depends on the choice of prior,
 $\structure{\pi(\theta)}$.

 \begin{alertblock}{}
  How to represent total lack of knowledge on the parameter(s) of interest?
 \end{alertblock}
 }

 \uncover<3>{
 \begin{block}{}
 An intuitive (and popular) choice: \textbf{uniform prior}, by Laplace's \emph{Principle of insufficient reason} (in the absence of any other reason, all hypotheses are equally probable).
 \end{block}
 }

\end{frame}

\begin{frame}
 \frametitle{The uniform prior}

 Several issues:

 \begin{itemize}
  \item<1-> If one choses a uniform prior for $\theta$, then the prior for some function $g(\theta) = \tau$ is not uniform. But what is the most ``natural'' variable for which the prior should be uniform? An angle or its cosine, mass or mass squared, lifetime or decay rate...?
  \item<2-> If the parameter range is infinite or semi-infinite, the prior over any finite range is 0...
  \item<3-> Issues even in the discrete case: consider we wish to determine if an object is red or white: $P=1/2$ for each. However consider that we have 100 possible shades of red.
  Is $P(\text{white})$ now 1/101 or 1/2?
 \end{itemize}
\end{frame}

\begin{frame}
 \frametitle{Jeffrey's prior}

 Physicist Harold Jeffrey expressed \textbf{objective priors} known today as \textbf{Jeffrey's priors}, or sometimes (somewhat wrongly) \emph{uninformative} or \emph{objective} priors.
 They are expressed applying the principle of minimum Fisher information:

 \myhide{1D:

 $$\pi(\theta) = \sqrt{I(\theta)} = \sqrt{- E\left(\frac{\partial^2 \ln f(x|\theta)}{\partial \theta^2}\right)}$$

 ND:

 $$\pi(\vec{\theta}) = \sqrt{\det (I(\vec{\theta}))}$$
}

\uncover<2->{Note: Jeffrey's priors are designed so that \textbf{inference does not depend on the chosen metric}. In other words, if $\tau = f(\theta)$, $p(\theta|x_0)$ and $p^\prime(\tau|x_0)$ are correctly related
by the Jacobian of the transformation.}

\end{frame}

\begin{frame}
 \frametitle{Examples}

 \mynote{Write them on the blackboard too}

 Jeffrey's priors for some common cases:

 \begin{itemize}
  \item Poisson signal mean $\mu$, no background: \structure{$\pi(\mu) = 1/\sqrt{\mu}$}
  \item<2-> Poisson signal mean $\mu$, mean background $b$: \structure{$\pi(\mu) = 1/\sqrt{\mu+b}$}
  \item<3-> Unbounded mean of Gaussian: \structure{$\pi(\mu)=1$} (uniform)
  \item<4-> Std. dev. of a Gaussian with fixed $\mu$: \structure{$\pi(\sigma) = 1/\sigma$}
 \end{itemize}

 \uncover<5>{Note: these priors are \textbf{improper} (not normalisable). This can be allowed because priors are multiplied by $\mathcal{L}$ and one can may still get a normalisable posterior density.}

\end{frame}

\begin{frame}
 \frametitle{How to choose the prior?}

 Pros and cons of Jeffrey's priors:

 \begin{itemize}
  \item<2-> Pro: inference does not depend on the chosen metric
  \item<3-> Con (for lazy physicists): harder to compute than an uniform prior...
  \item<4-> Con: violates the likelihood principle
  \item<5-> Con: depends on the likelihood, i.e. on the experimental apparatus (ex: Poisson with background)
  \item<6-> Con: difficult to apply for more than one parameter (solution: \textit{reference prior}, Bernardo and Berger)
 \end{itemize}

 \uncover<7>{
 \textbf{What is the correct prior?}

 There is not unique choice. Recall that Bayesian statistics is subjective by essence... However, to get meaningful results, one should check that results are insensitive
 to the choice of prior (within some sensible range).
 }

\end{frame}

\begin{frame}
 \frametitle{Likelihood principle}

 \begin{block}{Likelihood principle}
  Given a measurement $x$, all the relevant information regarding $\theta$ is encoded in the likelihood $\mathcal{L}(x_0|\theta)$.
 \end{block}

 This is encoded in Bayesian inference (see Bayes' theorem), but generally violated in frequentist inference (which needs to also account for the probability to observe
 other results than the one measured...), also by some of Jeffrey's priors.

\end{frame}

\begin{frame}
 \frametitle{Bayesian inference about the Poisson parameter}

 $$P(n|\mu) = \frac{e^{-\mu} \mu^n}{n!}$$

 \begin{itemize}
  \item A flat prior would give $E(\mu) = n+1$... not good since $E(n)=\mu$
  \item If there is background, Jeffrey's prior is $\pi(\mu) = 1/\sqrt{\mu+b}$. Depends on $b$?! Another proof that Jeffrey's prior does not reflect one's prior knowledge...
 \end{itemize}

\end{frame}

\begin{frame}
 \frametitle{Bayesian treatment of nuisance parameters}

 Back to the case of parameters of interest $\vec{\theta}$ and nuisance parameters $\vec{\nu}$.

 One may have data $\vec{y}$ constraining $\vec{\nu}$, with likelihood $\mathcal{L}(\vec{y}|\vec{\nu})$.

 Then one may use Bayes' theorem to obtain the posterior probability on $\vec{\nu}$:

 $$p(\vec{\nu}|\vec{y}) \propto \mathcal{L}(\vec{y}|\vec{\theta}) \pi(\vec{\nu})$$

 \uncover<2>{One often lacks knowledge on $\mathcal{L}(\vec{y}|\vec{\theta})$... possibilities:

 \begin{itemize}
  \item Gaussian pdf (centered on nominal value, with certain standard deviation)
  \item Log-normal or gamma pdf (better than truncated pdf if $\nu>0$ -- e.g. for multiplicative factors: efficiency, ...)
 \end{itemize}
}

\end{frame}

\begin{frame}
 \frametitle{Bayesian treatment of nuisance parameters}

 The likelihood function, prior and posterior all depend on the nuisance parameters:

 \myhide{$$p(\vec{\theta},\vec{\nu} | \vec{x}_0) \propto \mathcal{L}(\vec{x}_0|\vec{\theta},\vec{\nu}) \pi(\vec{\theta},\vec{\nu})$$}

 One can obtain the posterior pdf for $\vec{\theta}$ alone by marginalising the likelihood (integrating over the nuisance parameters):

 \myhide{\begin{eqnarray}
          p(\vec{\theta} | \vec{x}_0) & \propto & \left(\int \mathcal{L}(\vec{x}_0|\vec{\theta},\vec{\nu}) \pi(\vec{\nu} | \vec{\theta}) \dd \vec{\nu}\right) \pi(\vec{\theta}) \nonumber \\
           & \propto & \mathcal{L}(\vec{x}_0|\vec{\theta}) \pi(\vec{\theta}) \nonumber
         \end{eqnarray}}
\end{frame}

\begin{frame}
 \frametitle{Marginalisation vs profiling}

 Nuisance parameters in Bayesian inference are removed by \textbf{marginalisation}:

 \begin{eqnarray}
  p(\theta|x_0) & = & \int p(\theta,\nu|x_0) \dd\nu \nonumber \\
  & \propto & \int \mathcal{L}(x_0|\theta,\nu)\pi(\theta)\pi(\nu)\dd\nu \nonumber
 \end{eqnarray}

 \uncover<2>{in contrast to \textbf{profiling}, which can be viewed as marginalization
with the data-dependent prior $\pi(\theta,\nu) = \delta(\nu-\hat{\nu}(\theta,x_0))$

\begin{eqnarray}
  p(\theta|x_0) & \propto & \int \mathcal{L}(x_0|\theta,\nu)\pi(\theta,\nu)\dd\nu \nonumber\\
  & \propto & \int \mathcal{L}(x_0|\theta,\nu)\pi(\theta)\delta(\nu-\hat{\nu}(\theta,x_0))\dd\nu \nonumber\\
  & \propto & \mathcal{L}(x_0 | \theta,\hat{\nu}(\theta))\nonumber
 \end{eqnarray}
}

\end{frame}

\begin{frame}
 \frametitle{Marginalisation and numerical integration}

 The integrals involved in marginalisation are often very complex and over a many-dimension space.

 Integration may be difficult with standard Monte-Carlo methods:

 \begin{itemize}
  \item transformation method not possible (requires inversion of the cumulative function)
  \item hit-and-miss method too inefficient
 \end{itemize}

 \uncover<2>{$\rightarrow$ \textbf{Markov Chain Monte-Carlo (MCMC)}\footnote{\uncover<2>{Note: MCMC is frequently used as a tool in Bayesian statistics but is not Bayesian by itself.}}: Markov chain following a pdf proportional to a desired function $\pi(\vec{\theta})$. $\pi(\vec{\theta})$ does not have to be normalised!

 One samples $(\vec{\theta},\vec{\nu})$ from $\pi(\vec{\theta},\vec{\nu})$ and records the marginal distribution for $\vec{\theta}$.}
\end{frame}

\begin{frame}
 \frametitle{MCMC: Metropolis-Hastings algorithm}

 One starts with a proposal pdf $q(\vec{\theta},\vec{\theta}_0)$ (example: Gaussian pdf centered around $\vec{\theta}_0$). Starting at $\vec{\theta}_0$:

 \begin{enumerate}
  \item<2-> Generate a value $\vec{\theta}$ using the proposal density $q(\vec{\theta},\vec{\theta}_0)$
  \item<3-> Form the Hastings test ratio, $\alpha = \min \left[ 1, \frac{\pi(\vec{\theta})q(\vec{\theta}_0,\vec{\theta})}{\pi(\vec{\theta}_0)q(\vec{\theta},\vec{\theta}_0)}\right]$
  \item<4-> Generate $u$ uniformly in $[0,1]$
  \item<5-> If $u \leq \alpha$, take $\vec{\theta}_1 = \vec{\theta}$. Otherwise, repeat the old point: $\vec{\theta}_1 = \vec{\theta}_0$
  \item<6-> Set $\vec{\theta}_0 = \vec{\theta}_1$ and go back to step 1
 \end{enumerate}

 \uncover<7>{If $q$ is symmetric in $\vec{\theta}$ and $\vec{\theta}_0$, this is the \textit{Metropolis}-Hastings algorithm, and $\alpha = \min [ 1, \pi(\vec{\theta})/\pi(\vec{\theta}_0) ]$}

\end{frame}

\begin{frame}
 \frametitle{MCMC: visualisation}

 \centering
 \includegraphics[width=\textwidth]{MCMC.pdf}
\end{frame}

\begin{frame}
 \frametitle{Example: cosmological parameters from Planck}
 \FrameText{\href{http://arxiv.org/abs/arXiv:1303.5076}{AA 571 (2014) A16}}

 \begin{figure}
 \centering
 \includegraphics[width=0.67\textwidth]{triangle_planckonly_vs_WMAP_6pars}

 \caption{\tiny Comparison of the base $\Lambda$CDM model parameters for Planck+lensing only (colour-coded samples), and the 68\% and 95\%
constraint contours adding WMAP low-$\ell$ polarization (WP; red contours), compared to WMAP-9 (Bennett et al. 2012; grey contours).
}
 \end{figure}

\end{frame}

\section{Data combination}

\begin{frame}
 \frametitle{Outline}

 \tableofcontents[current]
\end{frame}

\begin{frame}
 \frametitle{Combination of data}
 \FrameText{\href{http://cms-results.web.cern.ch/cms-results/public-results/publications/HIG-14-009/index.html}{EPJC 75 (2015) 212},
 \href{https://arxiv.org/abs/1403.4427}{arXiv:1403.4427}}

 Combining data:

 \begin{itemize}
  \item Best is to go back to the original data (i.e. combine the full likelihoods)
  \begin{itemize}
   \item Includes full information, including correlations, non-Gaussianities, etc.
   \item May be a lot of work / not possible (e.g. combining accross experiments)
  \end{itemize}
  \item<2-> Discussed here: combining results
 \end{itemize}

 \begin{center}
  \includegraphics[width=0.44\textwidth]{CMS-HIG-14-009_Figure_002-a}\hfill
  \uncover<2>{\includegraphics[width=0.55\textwidth]{mtop_combo_Fig5}}
 \end{center}

\end{frame}

\begin{frame}
 \frametitle{One parameter, no correlations: weighted average}

 Assume $N$ determinations $x_i \pm \sigma_i$ of a single physical quantity $x$. We use the least squares method:

 \myhide{
 $$S(x) = \sum_i \left( \frac{x-x_i}{\sigma_i} \right)^2$$

 Minimising $S(x)$ yields

 $$\hat{x}_\text{comb} = \frac{\sum_i w_i  x_i}{\sum_i w_i}$$

 where

 $$w_i = \frac{1}{\sigma_i^2}$$

 $\hat{x}_\text{comb}$ is the weighted average of the $x_i$. The variance of $\hat{x}_\text{comb}$ is:

 $$\frac{1}{\sigma^2_\text{comb}} = \sum_i \frac{1}{\sigma_i^2}$$
 }
\end{frame}

\begin{frame}
 \frametitle{Notes on the weighted average}

 \begin{itemize}
  \item $\frac{1}{\sigma^2_\text{comb}} = \sum_i \frac{1}{\sigma_i^2}$: $\frac{1}{\sigma^2_\text{comb}}$ is at least as small as the smallest of the individual uncertainties.
  \item $\frac{1}{\sigma^2_\text{comb}}$ does \textbf{not} depend on the degree of consistency of the individual measurements. Combining $0 \pm 3$ and $z \pm 3$ gives a combined
  uncertainty of $\approx 2$, independent of whether $z$ is 1 or 7.
  \item The method assumes a \textbf{linear} problem: it assumes that the $\sigma_i$ are independent of the $x_i$.
 \end{itemize}

\end{frame}

\begin{frame}
 \frametitle{An apparent counter-example}

 Assume we want to combine $100 \pm 10$ and $1 \pm 1$\footnote{In real life one should not try to combine such discrepant measurements... There must be a mistake in either of them.},
 two independent measurements of the same Poisson parameter.
 The weighted sum gives $2 \pm 1$, which seems ridiculous. \textbf{Where is the issue?}

 \uncover<2->{
 Here we have estimated the \textbf{estimated} uncertainties, instead of the true ones. These observed uncertainties depend on the measured rate, and a downward fluctuation
 artificially increases the weight in the combination.

 Both measurements should have been given the same weight, then yielding $50.5 \pm 5$.
 }

 \uncover<3>{A way to overcome this is to make the procedure \textbf{iterative}, trying to approach the true uncertainty (variance) for each measurement.}
\end{frame}

\begin{frame}
 \frametitle{General case with correlations: Best Linear Unbiased Estimate (BLUE)}

 $N$ (unbiased) measurements $x_i$ with covariance matrix $V$

 \begin{itemize}
  \item \structure{Best}: smallest variance
  \item \structure{Linear}: linear dependence on the inputs, $\hat{x}_\text{BLUE} = \sum_i w_i x_i$
  \item \structure{Unbiased}: implies $\sum_i w_i = 1$.
 \end{itemize}

 The weights are obtained by minimising the variance, i.e. minimising $\sum_{i,j} w_i w_j \left(V^{-1}\right)_{ij}$:

 $$w_i = \frac{\sum_{j} \left(V^{-1}\right)_{ij}}{\sum_{i,j} \left(V^{-1}\right)_{ij}}$$

 This is equivalent to the least squares method, but explicitly gives the weights for each measurement in the combination.

\end{frame}

\begin{frame}
 \frametitle{Correlations and extrapolation}

 Two measurements $x_1 \pm \sigma_1$, $x_2 \pm \sigma_2$, $\sigma_1 \leq \sigma_2$, $\rho > \sigma_1 / \sigma_2$

 In this case, \structure{$x \notin [x_1,x_2]$}: BLUE involves \textbf{extrapolation}!

 Counterintuitive, but sensible: this is because, in the case of strongly positive correlation, it is likely that $x_1$ and $x_2$ are both on the same side of the true value.

 \structure{Corollary}: correlations between measurements may be poorly known, but BLUE is highly sensitive to the assumptions on correlations.
\end{frame}

\begin{frame}
 \frametitle{Correlated measurements of several physical quantities}

 $N$ observables $X_\alpha = (X_1,\dots,X_N)$, $n$ experimental results $y_i = (y_1,\dots,y_n)$. Each $y_i$ is a measurement of a given $X_\alpha$, and all observables are measured at least
 once: $n \geq N$. The covariance matrix of the $n$ measurements is $V$.

 Let us define the $(n \times N)$ matrix $\mathcal{U}$:

 \myhide{
 $$\mathcal{U}_{i\alpha} = \begin{cases}
      1 & \text{if } y_i \text{ is a measurement of } X_\alpha  \\
      0 & \text{otherwise}
   \end{cases}$$

   Then the best linear estimate of each observable $X_\alpha$ is:

   $$\hat{x}_\alpha = \sum_{i=1}^n \lambda_{\alpha i} y_i$$

   where the weights are:

   $$\lambda_{\alpha i} = \sum_{\beta=1}^N \left( \mathcal{U}^t V^{-1} \mathcal{U} \right)^{-1}_{\alpha \beta} \left(\mathcal{U}^t V^{-1} \right)_{\beta i} $$

   The covariance for the estimates is

   $$\text{cov}(\hat{x}_\alpha, \hat{x}_\beta) =\left( \mathcal{U}^t V^{-1} \mathcal{U} \right)^{-1}_{\alpha \beta} $$
   }
\end{frame}

\begin{frame}
 \frametitle{Example: straight line fitting}

 Two tracking planes, each with 3 layers providing uncorrelated measurements $y_i \pm \sigma_i$. No magnetic field: one fits straight lines $y = a + bx$.

 The first sub-detector gives $(a_1,b_1)$, the second $(a_2,b_2)$, combined into $(a_\text{comb},b_\text{comb})$

 \includegraphics[width=\textwidth]{BLUE/fig1}
\end{frame}

\begin{frame}
 \frametitle{Example: straight line fitting}

 Now the two tracking planes are on either side of the origin.

 \includegraphics[width=\textwidth]{BLUE/fig2_ab}
\end{frame}

\begin{frame}
 \frametitle{Real life example 1: determination of the fraction of dark energy in the universe, $\Omega_\Lambda$}

 \centering
 \includegraphics[width=0.45\textwidth]{BLUE/fig3.pdf}
\end{frame}

\begin{frame}
 \frametitle{Real life example 2: preliminary world top quark mass combination}
 \FrameText{\href{https://arxiv.org/abs/1403.4427}{arXiv:1403.4427}}

 \begin{columns}
  \begin{column}{1.19\textwidth}
   \includegraphics[width=0.4\textwidth]{mtop_combo_correl.png}\hfill
 \includegraphics[width=0.19\textwidth]{mtop_combo_BLUE_coef.png}\hfill
 \includegraphics[width=0.4\textwidth]{mtop_combo_Fig5}
  \end{column}
 \end{columns}

\end{frame}

\begin{frame}
 \frametitle{Real life example 3: Standard Model fits}
 \FrameText{\href{http://project-gfitter.web.cern.ch/project-gfitter/}{arXiv:1803.01853}}

 \begin{columns}
  \begin{column}{1.15\textwidth}
 \includegraphics[width=0.49\textwidth]{2018_03_20_Scan2D_MWvsmt_logo}\hfill
 \includegraphics[width=0.49\textwidth]{2018_03_20_WMassScan_logo}
 \end{column}
 \end{columns}
\end{frame}

\begin{frame}
 \frametitle{Back to profile likelihood}

 \hfill\includegraphics[width=0.8\textwidth]{BLUE/fig2_ab}

 \begin{columns}
  \begin{column}{0.55\textwidth}
   The correct combination is obtained by going back to the full likelihoods.

   Combining profile likelihoods $\mathcal{L}_{\text{prof},1|2}(a) = \mathcal{L}_{1|2}(a,\hat{\hat{b}}(a))$ does not give correct results.
  \end{column}
  \begin{column}{0.37\textwidth}
   \includegraphics[width=\textwidth]{BLUE/fig2_cd}
  \end{column}
 \end{columns}

\end{frame}

% \begin{frame}
%  \frametitle{Combining $p$-values}
% \end{frame}
% Leave this for when I introduce p-values...
\end{document}


\chapter{Theoretical Analysis}
\label{chap:analysis}
In literature, flow across the equator is often treated in less detail than mid-latitude circulations, which is probably due to the fact that it is impossible to formulate a leading-order balance as simple as geostrophy. This in turn makes it hard to find simple analytical solutions and gain an intuition of the dominant mechanics in the equatorial regions. In order to understand the findings presented in \chapref{chap:cesm-runs}, it seemed necessary to review the equatorial processes from a more theoretical point of view, which is done in this chapter.

\secref{sec:equatorial-theory} gives an introduction to the general nature of cross-equatorial flow and ties a first connection between potential vorticity, friction and viscosity, and the overturning. By considering the \ac{PV} balance at the equator, it is found that the presence of friction is indeed crucial to enable cross-equatorial flow. However, the efficiency of the \ac{PV} transformation is found to be \emph{independent} of the given viscosity to a leading order.

\secref{sec:equatorial-shallow-water} describes a custom equatorial shallow-water model that is then used to test whether the observed dependency of the overturning on viscosity can be recreated in a highly idealized model. To this end, the response of the equatorial flow and inter-hemispheric mass balance to different viscosities and model resolutions is tested. It is found that neither a simple viscosity reduction, explicitly resolving equatorial eddies, nor an under-resolution of the western boundary layer leads to a similar response as in \acs{CESM}.

\section{Theory of Cross-Equatorial Flow}
\label{sec:equatorial-theory}
As a starting point, the following sections present some pictures of cross-equatorial flow, and how exactly it connects to friction and viscosity.

\secref{sec:equatorial-vorticity} describes how friction in general acts to enable cross-equatorial flow due to potential vorticity constraints. \secref{sec:killworth} then proceeds to analyze cross-equatorial flow quantitatively using a picture brought forward by \citet{killworth}.

\subsection{Equatorial Vorticity Balance}
\label{sec:equatorial-vorticity}
Currents crossing the equator are strongly suppressed due to potential vorticity conservation constraints. This becomes most evident from the expression for \ac{PV} conservation in a layered ocean, \eqref{eq:pv-conservation-layer}:
%
\begin{equation}
\Ddx\Pi_s = \Ddx\left(\frac{\zeta + f}{h}\right) = \frac{1}{h} \nabla_H\times \vec{\mathcal{F}}.
\end{equation}
%
As the equator is approached, \(f\) becomes smaller and smaller until it vanishes at \ang{0} latitude, and \emph{changes its sign} as the flow penetrates into the opposite hemisphere. Since the layer height \(h\) is strictly positive, there are two possibilities how \eqref{eq:pv-conservation-layer} can be fulfilled:
%
\begin{enum}
	\item \ac{PV} can actually be conserved across the equator by creating excessive relative vorticity \(\zeta\) (\ie through nonlinear effects) --- however, the resulting velocity shear will usually heavily alter the flow paths and prevent water from deeply penetrating the other hemisphere\sidenote[-3]{An exception to this is presented by \citet{nofbc2}, who show that topography such as the Mid-Atlantic Ridge may allow flow to cross the equator while conserving \ac{PV}, based on a model from \cite{anderson}.}; or
	\item the advection of excess \ac{PV} along a streamline is balanced by a substantial amount of friction (\(\mathcal{F}\)), causing the \ac{PV} to change sign, until it joins the mid-latitude circulation.
\end{enum}
%

Another way to recognize the processes that drive flow into the opposite hemisphere stems from a non-dimensional formulation of the vorticity equation given in \cite{bryan1963}. \citeauthor{bryan1963} assumes a lateral friction term of the form
%
\begin{equation}
\nabla_H \times \vec{\mathcal{F}} = A_H \nabla^2 \zeta \approx A_H \nabla^2 v_x
\end{equation}
%
as before, and assumes that the conversion of \ac{PV} happens predominantly inside western boundary currents. According to \citeauthor{bryan1963}, the steady-state vorticity balance in non-dimensional form can then be approximated as\sidenote[-2]{With non-dimensional coordinates \(x',y'\), depth-integrated velocities \(U,V\), and stream function \(\Psi\).}
%
\begin{equation}
\underbrace{\varepsilon \left( U \zeta_x + V \zeta_y \right) \vphantom{\frac{\varepsilon}{\text{Re}}}}_{\mathclap{\text{Nonlinearity}}} %
+ \underbrace{V \vphantom{\frac{\varepsilon}{\text{Re}}}}_{\mathclap{\text{Coriolis}}} %
+ \underbrace{\sin(\pi y'/2) \vphantom{\frac{\varepsilon}{\text{Re}}}}_{\mathclap{\text{Wind stress}}} %
=%
\underbrace{\frac{\varepsilon}{\text{Re}} V^4 \Psi}_{\mathclap{\text{Friction}}}
\end{equation}
%
where \(\varepsilon\) denotes the horizontal Ekman number, and \(\text{Re}\) the Reynolds number. From this formulation, it becomes clear that the sign of the lateral friction term \(\frac{\varepsilon}{\text{Re}} V^4 \Psi\) is only related to the sign of \(\Psi\) close to the boundary. Since we have assumed that the flow crosses in a western boundary current, the friction term \(\propto \Psi\) always has the same sign as the \(V\)-term\sidenote[-4]{Recall that the sign of the stream function is in fact tied to the direction of rotation: \(\Psi\) is positive for clockwise rotation, and negative otherwise.}, regardless if the crossing is north-to-south (\(V, \Psi < 0\)) or south-to-north (\(V, \Psi > 0\)). For the nonlinear term, no such argument can be made \emph{a priori}.

\parabreak

Both types of cross-equatorial flow (\ac{PV} conserving flow and flow in frictional balance) are studied in many models and applications throughout literature. In the upcoming sections, we shall assume that the second mode, which depends on friction, has the most relevance in the real ocean, based on a picture that was put forward in \cite{killworth} (see next section). However, we need to keep in mind that, in theory, \ac{PV} conserving modes are possible \citep{nofbc2}.

\clearpage
\subsection{The Killworth Model}
\label{sec:killworth}
A particularly interesting study of the dynamics of cross-equatorial geostrophic adjustment has been conducted by \citeauthorfull{killworth} \citep{killworth}.
\sidefigure[Steady-state solutions of one-dimensional equatorial geostrophic adjustment.]{Two steady-state solutions (with different starting latitudes) of one-dimensional equatorial geostrophic adjustment. \acs{ODE} as in \cite{killworth}; solved with a shooting method.}[fig:killworth-ode]%
{\importpgf{figures/cross-equatorial/killworth/}{killworth-h.pgf}\\[2ex]%
\importpgf{figures/cross-equatorial/killworth/}{killworth-u.pgf}}[-1]%

In the first part of his paper, \citeauthor{killworth} derives a set of nonlinear \acp{ODE} describing the long-time average solution of a dam-break scenario where water, starting with some height anomaly \(h\) from a latitude \(Y\) south of the equator, is released in an inviscid, one-dimensional ocean. He finds that the flow is able to penetrate at most two Rossby radii of deformation into the northern hemisphere, depending on the starting latitude \(Y\) (\figref{fig:killworth-ode}). In this scenario, \ac{PV} is conserved by creating excessive amounts of relative vorticity (\ie through the first mode as described in \secref{sec:equatorial-theory}), turning the flow into an eastward jet, until it cannot penetrate any further (layer height approaches zero). This shows that, in the absence of solid boundaries and friction, deeply penetrating cross-equatorial flow is impossible, or --- in other words --- that one-dimensional nonlinearities alone cannot enable a full-blown overturning.

In the second part of the paper, \citeauthor{killworth} extends the model to a two-dimensional basin, and a lateral friction term is added. He proceeds to show that the circulation now spans the whole basin, because a western boundary current that is in frictional balance permits long migration of water parcels into the opposite hemisphere. By lowering the viscosity parameter, he finds a reduction of cross-equatorial flow in the interior, but not in the western boundary layer.

This behavior can be understood by assuming that the flow occurs in a thin, strictly meridional western boundary layer in lateral friction balance\sidenote[-1]{This implies \(u=0\) and \(v_x \gg v_y\).}, \ie it can be described as a Munk layer (\cf \secref{sec:munk}). The dominant balance in the potential vorticity conservation equation for a layered ocean \eqref{eq:pv-conservation-layer} is then
%
\begin{equation}
\Ddx \Pi_s \propto \frac{1}{h} A_H v_{xxx}. \label{eq:munk-friction-balance}
\end{equation}
%
Since the typical zonal length scale in a Munk layer \(\delta_M\) is given by \eqref{eq:munkwidth}, \ie
%
\begin{equation}
\delta_M = \left(\frac{A_H}{\beta}\right)^{1/3},
\end{equation}
%
the right hand side of \eqref{eq:munk-friction-balance} is of the order\sidenote{Assuming that the layer height \(h\) is approximately constant along stream lines.} \(\orderof{v} = V\). The left hand side of \eqref{eq:munk-friction-balance} (material derivative of \ac{PV}) involves a time derivative, and the total time spent in the boundary layer is \(\propto V^{-1}\). Thus, the total transformation of potential vorticity in the boundary current is of order \num{1} to a leading order. \emph{This implies that the magnitude of \(A_H\) does not influence the efficiency of \ac{PV} modification in a Munk layer in a first order approximation, as long as friction is present at all, and the Munk layer is resolved in the model.}

\clearpage
\section{An Equatorial Shallow-Water Model}
\label{sec:equatorial-shallow-water}
After these theoretical considerations, I wanted check whether the same behavior observed in the \acs{CESM} experiments from \chapref{chap:cesm-runs} can be reproduced by simply reducing viscosity in a highly idealized model\sidenote[-2]{As shown in the previous section, viscosity has no influence on a pure Munk layer --- however, it is not clear \emph{a priori} what happens when this layer is under-resolved, or how nonlinearities change the solution.}. For this purpose, I ran some additional experiments with a shallow-water model that I have developed, based on the models used in \cite{killworth} and \cite{kawase}. In particular, I wanted to obtain a similar dependence of total cross-equatorial transport and structure of the equatorial flow field on viscosity as observed in the Atlantic in my \ac{CESM} experiments (\secref{sec:obs-amoc}), while only modeling a single active layer of fluid with homogeneous velocities and density (as in \secref{sec:physics-layered}), and without any wind forcing. Instead, the model is forced by buoyancy only (a constant mass source in the north-western corner of the domain).

I have specifically chosen the model equations and parameters to yield a solution that is somewhat similar to a long-term average of the deep branch of the \acs{AMOC}, while the upper branch is modeled implicitly by assuming that it always closes the meridional overturning. Like the real \ac{AMOC}, it is forced by a mass imbalance in the North\sidenote[-5]{Which is, however, assumed constant, to only observe the \emph{kinematic} effects of a reduced viscosity --- an assumption that is only a first order approximation of the real ocean.}, representing the creation of \ac{NADW}. However, I did not want to prescribe the magnitude of the cross-equatorial flow as in \eg \cite{edwards}. Hence, as a mass sink, I have chosen to implement uniform upwelling\sidenote[-1]{By simply removing water from the domain, implicitly assuming that it re-enters the \q{upper branch} of the basin instead.} proportional to the layer height anomaly as in \cite{kawase}, so a solution that stays entirely inside the northern hemisphere becomes possible.

The following sections describe the equations that are solved by the model (\secref{sec:sw-equations}), and the experiments I have conducted, along with the observations I have made during the analysis (\secref{sec:sw-experiments}).

\subsection{Model Equations}
\label{sec:sw-equations}
The shallow-water model I have implemented is basically a combination of the shallow-water models used in \cite{killworth} and \cite{kawase}, with an additional \ac{CESM}-style anisotropic friction term. \citeauthor{killworth} uses a non-dimensional unforced shallow-water model with lateral friction in Cartesian coordinates:
%
\sidedef{Killworth's model}{}{
	\begin{align}
		u_t + uu_x + vu_y - \frac{1}{2} yv + h_x &= A_H (u_{xx} + u_{yy}) \\
		v_t + uv_x + vv_y + \frac{1}{2} yu + h_y &= A_H (v_{xx} + v_{yy}) \\
		h_t + (uh)_x + (vh)_y &= 0
	\end{align}
}
%
with (non-dimensional) velocities \(u, v\); layer height \(h\); meridional position \(y\); and turbulent diffusivity \(A_H\). \citeauthor{kawase} on the other hand uses a forced shallow-water model with bottom friction in spherical coordinates:
%
\sidedef{Kawase's model}{}{
	\begin{align}
		u_t - 2 \Omega \sin \theta v + \frac{g}{R_e \cos\theta} \eta_\phi &= - \kappa u \\
		v_t + 2 \Omega \sin \theta u + \frac{g}{R_e} \eta_\theta &= -\kappa v \\
		\eta_t + \frac{H}{R_e \cos \theta} u_\phi + \frac{H}{R_e \cos\theta} (\cos\theta v)_\theta &= Q - \lambda \eta,
	\end{align}
}
%
with Coriolis parameter \(2\Omega \sin\theta\); Earth's radius \(R_e\); reduced gravity \(g\); bottom friction parameter \(\kappa\); background layer height \(H\) and height anomaly \(\eta\); a localized water source \(Q\); and a water sink parameter \(\lambda\) parameterizing diapycnal mixing. The source in this model is located at the north-western corner of the domain, and the water sink is modeled as an exponential decay term\sidenote[-2]{Or exponential growth for \(\eta < 0\), \ie a negative displacement relative to the undisturbed layer height.}.

Combining these two models, I arrived at a non-dimensional, Cartesian formulation with buoyancy forcing, anisotropic lateral friction as in \ac{CESM}, and proper treatment of the convection term in the \(h\) equation:
%
\sidedef{Dion's Shallow-Water Model}{}{
\begin{align}
	u_t + uu_x + vu_y - \frac{1}{2}yv + h_x &= (A u_x)_x + (B u_y)_y \\
	v_t + uv_x + vv_y + \frac{1}{2}yu + h_y &= (B v_x)_x + (A v_y)_y \label{eq:shallowwater} \\
	h_t + (uh)_x + (vh)_y &= Q - \lambda (h-1),
\end{align}
}
%
with definitions as in the \citeauthor{killworth} model, but with an additional sink as in \cite{kawase}\sidenote[-1]{\(h-1 = \eta\), since the non-dimensional undisturbed layer height \(H' \equiv 1\) in the Killworth model.}. Note that this term adds a diapycnal contribution to the \ac{PV} conservation equation \eqref{eq:pv-conservation}, so \ac{PV} is not strictly conserved, even in the absence of friction (however, we assume this term to be small, since all experiments are in the low-damping regime). The buoyancy forcing is modeled as an explicit mass source \(Q\) in the north-western corner of the basin.

For a description of the numerical implementation and verification of this model refer to \appendixref{appendix:shallow-water}.

\subsection{Experimental Setup}
\label{sec:sw-experiments}
After reproducing some published results with my model to verify that it is working correctly (\appendixref{appendix:shallow-water}), I ran a total of three sets of simulations to investigate the equatorial dynamics in different scenarios:
%
\begin{enum}
\item High resolution, low forcing: In this first set, the model is forced by an explicit source \(Q\) in the north-western corner of the basin corresponding to a forcing of \SI{12}{\sv}. Between experiments, only the Munk layer viscosity \(\nu_M\) is changed (\(\nu_M = 0,\ 0.2,\ 2.0 \)). All other viscosity parameters as in the \ac{CESM} run \run{x3_default}. The model grid consists of \(60 \times 120\) equally spaced  grid cells.
\item High resolution, high forcing: As the first set, but with a stronger forcing of \SI{48}{\sv}, to allow for more nonlinearities in the solution. All runs are initialized with the final state of the \(\nu_M = 0.2\) experiment from set 1. To make computations more efficient, the grid spacing is reduced around the equator and western boundary, and increased everywhere else (same total number of grid cells).
\item Low resolution, low forcing: Four low-resolution simulations with Munk layer viscosities \num{e3}, \num{e4}, \num{e5}, and \SI{e6}{\metre\squared\per\second}. 20 equally spaced grid cells in \(x\)-direction, and 80 cells in \(y\)-direction, with a four times finer grid at the equator than at the northern and southern boundaries\sidenote[-3]{This grid was chosen to achieve a similar spatial resolution as in the \grid{x3} \ac{CESM} runs.}. Forcing as in set 1.
\end{enum}
%
Furthermore, all experiments share the following setup:
%
\begin{items}
	\item a rectangular basin that extends \SI{6000}{\kilo\metre} in zonal (\(x\)) and \SI{12000}{\kilo\metre} in meridional (\(y\)) direction, with the equator in the middle;
	\item a dampening time scale \(\lambda^{-1}\) of 1 year, putting the experiments into the weak damping regime as defined in \cite{greatbatch}; and
	\item an undisturbed layer height \(H\) of \SI{400}{\metre}, a reduced gravity \(g\) of \SI{0.02}{\metre\per\second\squared}, and a Coriolis parameter \(\beta\) of \SI{2e-11}{\per\second\per\metre}.
\end{items}
%
All of these values were chosen with the deep branch of the \ac{AMOC} in mind, while still being sufficiently close to the studies in \cite{killworth} and \cite{greatbatch} to allow comparisons.

The model is integrated forward using a finite volume solver for at least 1000 days, \ie approximately three damping time scales. To ensure stability and accuracy, the model uses adaptive time step control, with a typical time step lying in the order of 15 minutes. In every time step, an absolute solver precision of \num{e-8} in dimensionless units is enforced for both velocities and layer height.

\clearpage
\FloatBlock
\subsection{Analysis}
\subsubsection{Set 1: High resolution, low forcing}
In%
\sidefigure[Equatorial regions of the first set of shallow-water simulations.]{Equatorial regions of the first set of shallow-water simulations (with varying Munk layer viscosity). Shown are the streamlines, advection of \ac{PV} (shading), and contour of zero \ac{PV} (black line).}[fig:toy-flow-1]{\importpgf{figures/cross-equatorial/toy-flow}{set1.pgf}}[-2]%
%
this setup, the relatively weak forcing keeps nonlinearities small. As a consequence, all solutions are very similar, apart from a varying boundary layer width (which is, after all, \(\propto A_H^{1/3}\)) and different levels of numerical (dispersive) noise. The resulting steady-state solution is symmetric around the equator, similar to the weak-damping solutions in \cite{greatbatch} (\figref{fig:toy-steady-state}; see also \appendixref{appendix:shallow-water}), and flow seems to cross the equator in the western boundary layer only. The structure of the steady-state solution seems largely indifferent to viscosity (\figref{fig:toy-flow-1}) --- higher viscosities only lead to a wider boundary layer, and a more pronounced recirculation as predicted by the Munk solution, \ie \eqref{eq:munk-solution-noslip}.

\begin{figure}[p]
	\centering
	\importpgf{figures/cross-equatorial/toy-steady-state}{toy-steady-state.pgf}
	\caption[Steady-state solution of the shallow-water model for high resolution and low forcing.]{The steady-state solution in the high resolution, low forcing case is symmetric around the equator. Contours and quivers in the forcing region / western boundary partly omitted. Shading left: layer height anomaly; right: velocity magnitude. Coordinates in non-dimensional units.}
	\label{fig:toy-steady-state}
\end{figure}

The amount of water \(H_\text{south}\) that manages to penetrate deep into the southern hemisphere can be used as a diagnostic for the \enquote{overturning} in the model, by simply evaluating a mass integral over some southern region, \ie%
\sidefigure[Hemispheric mass balance for set 1 of the shallow water experiments.]{The steady-state mass balance between North and South seems to be largely independent of viscosity.}[fig:southern-water-1]{\importpgf{figures/cross-equatorial/southern-water}{set1.pgf}}[12]%
%
\begin{equation}
	H_\text{south} = \int_{x_w}^{x_e} \int_{y_s}^{y^*} h \dx{y} \dx{x},
\end{equation}
%
with the layer height \(h\), \(x_w, x_e, y_s\) denoting the position of the western, eastern, and southern boundary, respectively, and some bounding latitude \(y^*\) that separates north from south. Since the observed equatorial features tend to extend quite far into both hemispheres (\figref{fig:toy-steady-state}), I have chosen \(y^* = -10\) (non-dimensional; in multiples of the Rossby radius of deformation). A better estimate for the overturning that is comparable between different scenarios is the mass ratio between northern and southern parts of the domain, \ie \(H_\text{south} / H_\text{north}\). Calculating this value for every experiment reveals that the steady-state mass balance is indeed quite stable around \SI{7(1)}{\percent} for any Munk layer viscosity (\figref{fig:southern-water-1}), especially for the two runs with a non-vanishing Munk layer. However, it seems that higher viscosities lead to a \emph{weaker} overturning, which is in contradiction with the findings of \chapref{chap:cesm-runs}. It is also observed that higher viscosities lead to a delayed reaction of the southern part of the basin, \ie longer overall time scales.

\clearpage
\subsubsection{Set 2: High resolution, high forcing}
In%
\sidefigure[Equatorial regions of the second set of shallow-water simulations.]{Equatorial regions of the second set of shallow-water simulations (with varying Munk layer viscosity). Shown are the streamlines, advection of \ac{PV} (shading), and contour of zero \ac{PV} (black line).}[fig:toy-flow-2]{\importpgf{figures/cross-equatorial/toy-flow}{set2.pgf}}%
%
this scenario, the forcing strength has been quadrupled to increase velocity and height anomaly scales, which increases the nonlinearity of the solution. Indeed, while the overall structure of the solution is still the same as in the first scenario, the experiment without a Munk layer now features a number of eddies that constantly emerge in the equatorial region near the western boundary, travel southward, and dissipate. This is also visible in \figref{fig:toy-flow-2}, where the line of zero \ac{PV} is visibly distorted close to the western boundary.

The inter-hemispheric mass balance (\figref{fig:southern-water-2}) reveals that all experiments converge to roughly the same steady-state, with differences of the order of \SI{1}{\permille}, which also seems to be roughly the same steady-state that the solution was initialized with (final state of the \(\nu_M=0.02\) experiment from set 1). Strictly speaking, the experiment with the highest viscosity \emph{does} lead to the largest amount of southern water after \SI{2200}{\day}, but differences are so small that this might as well change once more when integrating for even longer times.
\sidefigure[Hemispheric mass balance for set 2 of the shallow water experiments.]{Even for nonlinear solutions, the steady-state mass balance between North and South seems to be independent of viscosity.}[fig:southern-water-2]{\importpgf{figures/cross-equatorial/southern-water}{set2.pgf}}[12]

It seems curious that the low-viscosity run from set 1 was clearly set apart from the other experiments (\figref{fig:southern-water-1}), while this is not the case here. However, it is important to recall that I have also introduced a scaled numerical grid before running the experiments of set 2, which becomes finer near the equator and \emph{the western boundary}. My hypothesis to explain the observed behavior is thus that the western boundary layer was not fully resolved in the low-viscosity run of set 1, while it is well-resolved in set 2 due to the finer grid spacing at the western boundary.

Hence, it seems that a fully resolved boundary layer \emph{always leads to an identical hemispheric mass balance in the steady-state}, regardless of nonlinearities (while during spin-up, the system reacts considerably faster with lower viscosities, which might be an important factor in the real ocean / \ac{CESM}).

\clearpage
\FloatBlock
\subsubsection{Set 3: Low resolution, low forcing}

This%
\sidefigure[Height field of a low-viscosity shallow-water experiment.]{Lowering viscosity creates zonal re-circulations in the equatorial band. Shown is the smoothed layer height anomaly.}[fig:sw-height-lowvisc]{\importpgf{figures/cross-equatorial/toy-height}{toy-height-lowvisc.pgf}}%
%
set of simulations was deliberately run with a low spatial resolution to test the effects of under-resolving the western boundary layer. This creates excessive amounts of numerical noise, as also seen in the \ac{CESM} experiments --- thus, all variables have been smoothed with a boxcar filter in both dimensions before post-processing.

\begin{figure}
	\begin{sidecaption}[Equatorial flow for shallow water experiment set 3.]{The equatorial flow pattern shows a distinct dependency on viscosity. Shading: \ac{PV} advection (different scale for each solution).}[fig:toy-flow-3]
		\antimpjustification
		\importpgf{figures/cross-equatorial/toy-flow}{set3.pgf}
	\end{sidecaption}
\end{figure}

Compared to the symmetric solutions obtained in set 1 and 2, the structure of the solution changes considerably in the low-viscosity runs (\figref{fig:sw-height-lowvisc}). The symmetry around the equator is broken, and, interestingly, the largest effect is seen in the circulation of the \emph{northern} hemisphere. Part of the flow crosses in the western boundary, but large parts of the flow do not make it across the equator, and are deflected eastward instead. When hitting the eastern boundary, this flow turns southward, and is deflected to the west by the equator. A similar process is observed \emph{after} the flow has crossed the equator, but fails to penetrate deeply into the southern hemisphere. It is deflected eastward until hitting the eastern boundary, where it dumps excess \ac{PV}, and joins the southern circulation (\figref{fig:toy-flow-3}). It seems odd that processes at the \emph{eastern} boundary actually manage to transform \ac{PV} in the same way as the western boundary, since it is analytically impossible to find a stable solution that balances friction and planetary vorticity at the eastern boundary \citep{pedloskyoct}. Possible explanations for the observed behavior could be:
%
\begin{enum}
\item The diapycnal term in the \ac{PV} conservation equation \eqref{eq:pv-conservation} becomes important in this region and acts to remove some potential vorticity;
\item Strong numerical noise may lead to an inaccurate solution; or
\item Calculating relative vorticity during post-processing is quite inaccurate for low-resolution grids, and \ac{PV} \emph{could} in fact be conserved. In this case, the observed re-circulation would be purely inertial, which is a well-known solution (the Fofonoff mode, see \citebook{pedloskyoct}).
\end{enum}
%
Thus, even though somewhat similar processes are observed in the Atlantic in my \ac{CESM} experiments for low viscosities (\figref{fig:amoc-velocity}), it is doubtful how realistic the interactions at the eastern boundary are modeled in this set of experiments.

\parabreak

The inter-hemispheric mass balance for this set seems curious, too (\figref{fig:southern-water-3}). Apparently, an under-resolved Munk layer does indeed lead to a \emph{much larger} amount of water that crosses the equator and reaches far south, as already suspected when comparing the results from set 1 and 2. While the high viscosity experiments lead to a mass balance that is similar to that of set 1, the low viscosity runs exceed it significantly. My only explanation for this observation is that, since northern water is effectively trapped in the equatorial region, there is simply more opportunity for a large portion of the flow to actually cross the equator, be it at the western boundary or in the interior, before it is removed from the basin.

\begin{figure}
	\begin{sidecaption}[Hemispheric mass balance for set 3 of the shallow water experiments.]{The \emph{lower} the viscosity, the \emph{more} water reaches far south in my shallow water model. Division between north and south at \num{10} deformation radii south of the equator.}[fig:southern-water-3]
		\antimpjustification
		\importpgf{figures/cross-equatorial/southern-water}{set3.pgf}
	\end{sidecaption}
\end{figure}

\subsubsection{Summary}
Albeit my buoyancy-forced shallow water model has shown some interesting features, it has eventually failed to reproduce the dependency of the \ac{MOC} on viscosity as seen in the \ac{CESM} experiments of \chapref{chap:cesm-runs} (\ie a slightly reduced transport for reduced viscosities), even when equatorial eddies were explicitly resolved (set 2) or when the equatorial Munk layer was under-resolved (set 3).

I thus conclude that neither of the examined effects effects%
%
\sidenote{\Ie \\[1ex]
	\begin{marginenum}
		\item direct response to changed viscosity,
		\item simple nonlinearities,
		\item under-resolution of the western boundary layer.
	\end{marginenum}
} %
%
is responsible for the observed response of \ac{CESM}. Further possible candidates that may cause the observed dependency are \eg topography, interactions between multiple layers, atmospheric forcing, or simply the fact that the \ac{NADW} forcing is not constant (since it depends both explicitly on time through \eg seasonal forcing and a on the actual cross-equatorial flow itself). Hence, further work seems necessary to identify the dominant processes in \ac{CESM}; some possible modifications are presented in \secref{sec:outro-moc-viscosity}.