\section{Conclusion}
\p{In the last section, I outlined a theory
of \i{annotative fusion} which generalizes
(and migrates from natural to formal languages)
Link Grammar to fields like type theory,
programming language design, and (suitably
extended) lambda calculii.  The crux of this
extension is taking a formulation of
hypergraph transforms \mdash{} where hypergraph
edge-pairs map to annotatd hypredges \mdash{} and
then reading \q{annotations} as general computational
structures, where an \q{annotative fusion} represents
the executive machinery requisite to implement
(sequential or concurrent) calls between
procedures.  As with link grammar, which recognizes
many link types (or in these terms many
premises for tail-to-head pre-annotation fusion),
this rough picture allows many different kinds
of inter-procedure calls, coding paradigms,
and functional side-effects to be represented.
For example, Object-Oriented code exhibits a
particular kind of inter-procedure connection,
subject to special semantic and
syntactic conventions (notably the object
value in an expression is bound to a \q{this}
or \q{self} symbol in the callee code).  In
languages like \Cpp{} and Java, Object-Oriented
expressions are notated by placing the object symbol
(or nested expression) before a \q{dot} token and
then a function name.  The \q{dot} then signals
the presence of two connectors, one to its left
that marks a symbol or expression as an object
(and thus connected to a \q{this} symbol in callee code)
and one to its right that marks a symbol
as a function name (and so bound to whichever
procedure uniquely resolves the procdure-call
at runtime given the runtime type of
the arguments).
}
\p{As this example shows, one could write a formal
grammar for Object Oriented languages
\mdash{} e.g. for a valid expression using an
object and a valid signature of a function that takes an
object as its \q{this} argument \mdash{} with syntax-rule
representations essentially identical to Link Grammars
for Natural Language.  In place of link-types
like verb-subject, verb-object, antecedent-pronoun,
etc., this \i{programming} language grammar would
have connections like object-expressions and
object-symbols to \q{this} tokens, thrown
exception-exprssions to symbols declared in
\q{catch blocks}, and so on.  Expanding this
idea, we can say that modern programming languages
have multiple form of inter-procedure exchange of
values, and that for each such alternative
there is a distinct link-type and a distinct pair
of \q{connectors} (in established Link
Grammar terminology) or \q{pre-annotations}
modeling how values get passed between procdures
insofar as that communicative protocol is in effect.
Object-Oriented code uses one protocol for objects,
a different protocol (essentially the classical
Lambda Calculus) for other functional arguments,
and a third protocol for throwing and catching
exceptions.  In the context of this paper,
these protocols correspond with specific
compatibilities between pre-annotations and
specific regimes for annotative fusion.
Within each experession/signature match, there
are in general multiple \q{annotative fusion
regimes} which must all be properly provisioned
by the desired procdure-call for the fusion
to be acceptable.  The values subject to any
particular regime I then collectively
call a \i{channel}, and the rules for
validating fusions I refer to as a \q{Channel
Algebra}.  Type declarations on procedures are
then enriched with the added structure of
multiple \q{annotative fusion regimes}
(which can also be called \q{channel prototypes},
or \q{proto-channels}) along with the
distinction between expression-pre-annotation and
signature-pre-annotation types I mentioned earlier.
These added structures add levels of detail
to the basic notion of \q{functional types} in
the Typed Lambda Calculus, and we can define type
systems that are closed over simpler functional
type systems with respect to annotative-fusion,
annotative-partiality, and proto-channel operators.
In Neustein19 I describe these enriched theoris
as \q{Channelized Type Systems} and give a more
expansive outline and explanation of their
formal properties.  For the moment, I will just
claim for sake of discussion that \q{Channelized}
type theory according to these criteria is a
reasonable extension to clasical type theory and
that the published software represents a concrete
implementation of a prototype formal language
whose type system is Channelized in this sense.
}
\p{Here I openly acknowledge that I am not
providing a rigorous mathematical exposition of
these Channelized Type Systems, analogous to
how other extensions would be presented
in the type-theory community proper.  This
is partly be personal choice: I am both
more interested in and more capable of
examining forms of type theory via their
concretization in implemented programming
languages, rather than their mathematical
exposition in \q{abstract} programming languages.
It is certainly possible to formulate formal
languages as mathematical constructs, using
theorems as de facto guarantees of their behavior.
Such hypothetical languages are still not
actually implemented, however.  Provable
claims about programming languages are importamt,
but also valuable are specific implementations
of languages \mdash{} i.e., software that reads source-code
files conformant to the language grammar and
executes operations described by that code \mdash{}
partly because the code realizing the language
itself then becomes a concrete artifact
which can be studied and analyzed in turn.
\p{}
Concrete language implementations are
therefore an alternative framework for
developing type theory, separate from purely
mathematical type theories and from the
kinds of type systems central to mathematical
foundations research (e.g., Homotopy Type Thory).
I'll refer to type theory in the former
sense as \i{experimental}, in comparison to
\q{logico-mathematical} type theories, on the basis
that claims about the type systems of concrete
programming languages are often defended by
appeal to empirical observations about
program-behavior rather than formal proofs.
}
\p{I have concluded this paper with a brief reference to
a \q{Channelized Type Theory}, which I turned I arived
at in several phases, from Phenomenology to Cognitive
Grammar to Link Grammar to Annotated Directed Hypergraphs.
As with any juxtaposition of philosophical/speculative
thories and formal/technical ones, claims of
inter-disciplinary unification (or even overlap) need to
be cautious and provisional.  It certainly is not
self-vident that Channelized Type Theory (or Link Grammar
and Dircted Hypergraphs, or Semantic Web
Ontologies and Dircted Labeled Graphs) represents
an adequate or relevant formalization of
phenomenoligical structures.  To the degree that
Channelized Type Theory (by analogy to Semantic Web
paradigms) can be retroactivly interesting to
Phenomenology at a systematizing or
intuition-honing level, the resonances between the two
need to be dilated from well-established theortical
overlaps (like Phenomenology to Cognitive Grammar),
tracing a pivot to increasingly formal and/or
technological structures (as with formalizing
Cognitive Grammar via Link Grammar and then generalizing
Link Grammar to formal languages and type theories).
This paper has been able to present only a few
examples tieing the phenomenologuical side of this
progression to the technological side at
each step along the way.
}
\p{But without presuming that the mutual relevance between
Channelized Type Theory and Phenomenology has been
demonstrated here in anything but skecthy detail, we
can still consider the meta-philosophical situation
if such a connction can be made even provisionally.
As I have proposed, Channelized Type Theory (at least
the way I have developed it) is \q{experimental} rather
than rigorously logico-mathematical; as a result,
a potential formaliztion for some phenomenological
structures is being presented as a technological
and esxperimental or empirical artifact rather than
an abstract mathematical system.  My interest
in formal models for Phenomenology is inspired by
the \q{Naturaliing Phenomenology} project and
particularly by Jean Petitot's formalizing studies
(alongside David Woodruff Smith's metaphysical
analyses which, I think, provide a persuasive
philosophical grounding for Petitot's \q{eidetic}
scientization).  However, Petitot's interdisciplinary
orientation is centered on identifying
mathematical structures (like sheaf mereology) which
seem to replicate some of the cognitive
patterning of perceptual and situational
experience; in short it is formalization via
mathematical spaces.  As I intimated when contrasting
Petitot with Barry Smith, the former's strategy
is still a departure from \q{logical} formalizations
\mdash{} sheaves are Categorical phenomena rather than
set-thoretic ones, so sheaf theories are not
reductively conflated to logical systems
(though like any Category sheaves \q{have} a
logic in some sense).  Ptitot's analyses,
in short, are formalizations of certain phenemenological
gestalts via mathematical categories rather than via
the formulation of logical systems that would
purport to simulate phenemenological structures via
axioms or syllogisms (again as a counter-example
I would cite Kit Fine's mereology based on
Husserl's \i{Logical Investigations}).
}
\p{But relative to Petitot's mathematical treatments,
I would argue that \q{experimental} formalisms
are even more significant departures from a
philosophical paradigm which essentially
reduces formalization in general to a
presentation of logical-axiomatic reconstructions
of empirical (emergent, higher-scale) phnomena.
The rationale behind exercising a new type theory
via concrete software exemplifications rather than
via a theorem-driven mathematical treatment
is that essential structural details may be
evident in th concrete implementation which get
lost in a mathematical reduction.  After all,
the principle of \q{Turing equivalnce} sugests
that at some mathematical level all programming
languages are behaviorally indistinguishable.
Insofar as grammatical or pragmatic differences
between programming languages are nonetheless
interesting as case-studies for semiotic or
philosophical themes \mdash{} insofar as programming
languages, while \q{constructed} and constrained by
the need to manipulate computer operations as
well as express coding intent for the benefit of
other programmers, are still \q{languages} and
can suggest insights for human languages as
well \mdash{} the fact that higher-level programming
structures get reduced away under mathematical
treatments of programming languages shows that
treating these languages as just mathematical
objects is not a useful theoretical maneuver
in this contexts.  After all, several
high-level features of some programming languages \mdash{}
including Object-Orientation, monads, functional
side-effects, continuations, type coercion, and
lambda abstraction \mdash{} have been studied as
potential formal models of Natural Language
features as well.  These analyses clearly
require and presuppose a theory of
programming languages where Objects, monads,
effect-systems, and the like are first-class
posits rather than epiphenomena that get
analytically erased under mathematical
reduction.
}
\p{But such a non-reductive theory of programming languages
arguably needs to be \q{experimental}, centered on
these languages as software artifacts, whose properties
and behavior are tested empirically.  If
progreamming languages are also case-studies for
Phenomenology, their status as formalizations is
likewise experimental \mdash{} Phenomenology
grounding itself in a science that is
observational rather than logico-mathematical;
that progresses by practical tinkering
rather than by asserting axioms and proving theorems.
}
\p{This experimental modus operandi does not only
affect how research proceeds; it also alters
how research intersects with the txtual and
publishing ecosystm.  If computer code is
an essential part of an autgor's argumntation,
then the author is responsible for curating a
code base as well as perfecting a written
exposition.  The publication itself does not only
exist as a book or article but extends also to
an open-source repository which needs tobe
used and maintained.  The author herself
presents as competent in the technological and
computational skills associated with
creating and maintaining an open-source repository
as well as in the subject-matter covered in
academic text.  Disciplinary expertise is
complemented with literacy in practical tools
needed to work with repositories, like
GitHub and the GNU Compiler Collection.
}
\p{There is also a more subtle sense that curating a
complex code base demands \mdash{} or brings forth \mdash{}
an experimentalist attitude that stands
apart from the conventional style of philosophical
thought.  Software development is
unapologetically trial-and-error, ad-hoc,
intuitive, relativly informal \mdash{} the
programmer is a hacker as much as a scientist.
In the landscape of 20th-century philosophy,
software development is metaphorically
post-modern, perhaps Deleuzian.  It reaches
asymptotically toward formal precision
\mdash{} this is a precondition of any commitment
to software quality \mdash{} but tries
to achieve formal guarantees through a crucible of
trial-and-error and test-and-failure.
The programmer who writes software as
part of a research project is suspended between
two different regimes of scientific rigor,
or communicative rationality \mdash{} the software
itself is (albit in digital incarnation)  a
\i{thing}, which hoperfully does what it is
supposed to, a mechanical ventriloquist endorsing
th author's claims.  What software offers the research
ecosysem is a raw performativity that transcends
disciplinary boundaries.  We can dispute the author's
claims and how much leeway we grant the
author in defending these claims, but not
the behavior of the software itself.  The author's
\q{hacker} persona lifts her outside of any
institutional or disciplinary enclosure other than
the push to get \i{this} code to work, this
one further piece to the puzzle.  But any claim
that software \mdash{} apart from its practical uses
\mdash{} by its very implementation serves as a kind
of warrant for scientific or philosophical
claims brings us back to a communicative
and disciplinary rationality \mdash{} the onus is
on the author to justify that her software's
behavior demonstates some principle of
acadmic interest, something outsid itself.  In my
case the relevant claim would be, for example,
that the code paired with this paper demonstrates how
Channelized Type Theory or \q{annotative fusion} is a
credible and practically useful model of computation.
}
\p{But at least when evaluating these claims we're not
just talking about philosophical arguments and
the intellectual ecosystms where philosophical discussions
happen \mdash{} the journals, classrooms, and conferences.
We're also talking about software and technology
\mdash{} something that can be downloaded, experimented
with, improved, fully transparent.  The
ad-hoc rationality of this transparency is somewhat
different than the partial obscurity of peer review,
closed-access journals, monetized conferences,
or disciplinary exclusivity.  Software is not
a degree.  This transparent rationality is
perhaps a natural complement to Phenomenology's
\q{to the things themselvs}.  Software is,
par excellence, expertise in the thing itself.
Software is intellectual cryptocurrency; the
intelligence of the digital challenging
the rigor and scientificity of the
brick-and-mortar and the institutional.
As the mortar unifying a research community
software is syndicalistic rather than
hierarchical.  But in this sense collaborative
software development \mdash{} as well as the communal
evaluation of published software \mdash{} is an
intriguing instance of Habermassian discourse
communities.  Software can help lead philosophy
back to its Habermassian ethical wellspring.
}
\p{Perhaps ironically, the thread developing
Phenomenology in its most \q{Naturalizing}
and scientific aspirations is also a
gateway to an experimental, even \q{post-modern}
and even political and politicized temperament.
The Analytic and the existential-political
trajectories of Phenomenology are not
so far apart, after all.
}


\section{Verified Deterministic Parallelism}\label{sec:eval-parallelism}

Finally, we evaluate our deterministic
parallelism prototypes.  Aside from the lines of proof code added,
we evaluate the impact on runtime performance.
%
Were we using a proof tool external to Haskell, this would not be necessary.
But our proofs are Haskell programs---they are necessarily visible to the
compiler.  In particular, this means a proliferation of unit values and functions
returning unit values.  Also, typeclass instances are witnessed at runtime by
``dictionary'' data structures passed between functions.  Layering proof methods
on top of existing classes like @Ord@ (from \S~\ref{sec:detpar})
could potentially add indirection or change the
code generated, depending on the details of the optimizer.
%
% Whole program compiler would be especially well suited
%
%% We do some evaluation to claim that verification has little to no effect on
%% runtime performance.
In our experiments we find little or no effect on runtime performance.
Benchmarks were run on a single-socket Intel{\textregistered}
Xeon{\textregistered} CPU E5-2699 v3 with 18 physical cores and 64GiB RAM.

\subsection{LVish: Concurrent Sets}
\label{sec:set}

% \RGS{What are PureSet and SLSet here? Needs context.}
First, we use the @verifiedInsert@ operation (from \S~\ref{sec:detpar})
to observe the runtime slowdown imposed by the extra proof methods
of @VerifiedOrd@.
We benchmark concurrent sets storing 64-bit integers.
Figure~\ref{fig:set} compares the parallel speedups
for a fixed number of parallel @insert@ operations
against parallel @verifiedInsert@ operations, varying the number of concurrent
threads.
%
There is a slight observable difference between the two
lines because the extra proof methods do exist at runtime.
%
We repeat the experiment for two set implementations: a concurrent skiplist
(SLSet) and a purely functional set inside an atomic reference (PureSet)
as described in~\cite{kuper2014freeze}.

% \NV{What is HasPut? ISet, Par}
% \NV{Add reference to Fig 10 and say with words what you conclude from this fig. ie
% how proof obligations affect speedups}
% \NV{Other than speed ups we should comment on proof burden that is added when we write verifiedInsert
% instead of insert.
% Maybe how many lines of code verified Insert and insert are?}

\begin{figure}
\captionsetup{justification=centering}
  \begin{center}
    \includegraphics[width=3.2in]{text/refinementreflection/set.eps}
  \end{center}
  \caption[Parallel speedup for PureSet and SLSet.]
    {Parallel speedup for doing 1 million parallel inserts over 10
    iterations, verified and unverified, relative to the unverified version,
    for PureSet and SLSet.}
  \label{fig:set}
\end{figure}

\subsection{Monad-par: \texorpdfstring{$n$-body}{n-body} simulation}
\label{sec:nbody}
Next, we verify deterministic behavior of an
$n$-body simulation program that leverages @monad-par@, a Haskell library which
provides deterministic parallelism for pure code \cite{monad-par}.

Each simulated particle is represented by a
type @Body@ that stores its position, velocity and mass.
%
The function @accel@ computes the relative acceleration
between two bodies:
\begin{mcode}
  accel :: Body -> Body -> Accel
\end{mcode}
where @Accel@ represents the three-dimensional acceleration
\begin{mcode}
  data Accel = Accel Real Real Real
\end{mcode}
%
To compute the total acceleration
of a body @b@ we
(1) compute the relative acceleration between @b@
and each body of the system (@Vec Body@) and
(2) we add each acceleration component.
%
For efficiency, we use a parallel @mapReduce@ for the above
computation that
first \textit{maps} each vector body to get the acceleration relative to @b@
(@accel b@) and then adds each @Accel@ value by pointwise addition.
%
@mapReduce@ is only deterministic if the element is a @VerifiedMonoid@
from \S~\ref{sec:detpar}.
%%
%%To compute the velocity of each body in the simulation
%%we map reduce
%%
%%
%%An $n$-body simulation is used to model the behavior of particles in some system
%%in which forces are acting on the particles. The code which we verify is adapted
%%from an implementation of the all-pairs variant (a traditional, brute-force
%%approach) to $n$-body simulation from \cite{parallel-n-body}. The datatype which
%%we are verifying represents a particle:
%%
%%
\begin{mcode}
mapReduce :: VerifiedMonoid b 1=> (a1->b) 1-> Vec a 1-> b
\end{mcode}
%
To prove the determinism of an $n$-body simulation, we need to provide a
@VerifiedMonoid@ instance for @Accel@.
%
We can easily prove that (@Real@, @+@, @0.0@)
is a monoid.
%
By product proof composition, we get a verified monoid instance for
\begin{mcode}
  type Accel' = (Real, (Real, Real))
\end{mcode}
which is isomorphic to @Accel@ (\ie @Iso Accel' Accel@).

Figure~\ref{fig:nbody} shows the results of running two versions of the $n$-body
simulation with 2,048 bodies over 5 iterations, with and without verification,
using floating point doubles for \texttt{Real}\footnote{Floating point numbers
  notoriously violate associativity, but we use this approximation because
  Haskell does net yet have an implementation of {\em
    superaccumulators}~\cite{superaccumulation}.}. Notably, the two programs have almost
identical runtime performance.  This demonstrates that even when verifying code
that is run in a tight loop (like @accel@), we can expect that our programs
will not be slowed down by an unacceptable amount.

\begin{figure}
\captionsetup{justification=centering}
  \begin{center}
    \includegraphics[width=3.2in]{text/refinementreflection/nbody.eps}
  \end{center}
  \caption[Parallel speedup for $n$-body simulation and array reduction.]
      {Parallel speedup for doing a parallel $n$-body simulation and
      parallel array reduction. The speedup is relative to the
    unverified version of each respective class of program.}
  \label{fig:nbody}
\end{figure}

\subsection{DPJ: Parallel Reducers}
\label{sec:reducer}
%% Our last benchmark illustrates how one can enforce various deterministic properties
%% that are different from the standard class properties (\ie monoid associativity).
%% For example,
The Deterministic Parallel Java (DPJ) project provides
a deterministic-by-default semantics for the Java programming language~\cite{DPJ}.
%
In DPJ, one can declare a method as @commutative@ and thus {\em assert} that
racing instances of that method result in a deterministic outcome.
For example:
%
% private region AccumRgn, static int sum in AccumRgn;
%% private static commutative synchronized
%%  void updateSum(int n) writes AccumRgn { sum += n; }
\begin{code}
  commutative void updateSum(int n) writes R
    { sum += n; }
\end{code}
But, DPJ provides no means to formally prove commutativity and thus
determinism of parallel reduction.
In Liquid Haskell, we specified commutativity as an extra proof method
that extends the @VerifiedMonoid@ class.
%
\begin{mcode}
  class VerifiedMonoid a => VerifiedComMonoid a where
    commutes :: x:a -> y:a -> { x <> y = y <> x }
\end{mcode}
%
Provably commutative appends can be used to deterministically
update a reducer variable, since the result is the same regardless
of the order of appends.
%
We used LVish~\cite{kuper2014freeze} to
encode a reducer variable with a value @a@ and a region @s@
as @RVar s a@.
\begin{mcode}
 newtype RVar s a
\end{mcode}
We specify that safe (\ie deterministic)
parallel updates require provably commutative appending.
\begin{mcode}
  updateRVar :: VerifiedComMonoid a => a -> RVar s a -> Par s ()
\end{mcode}
%
Following the DPJ program, we used @updateRVar@'s provably deterministic interface
to compute, in parallel, the sum of an array with $3$x$10^9$ elements by updating
a single, global reduction variable using a varying number of threads.
%
Each thread sums segments of an array, sequentially, and updates the variable
with these partial sums.
%
In Figure \ref{fig:nbody}, we compare the verified and unverified versions
of our implementation to observe no appreciable
difference in performance.


\section{Conclusion and extensions}
\label{sec:conclusion}

We have seen that the model is capable of reproducing core qualitative features of the original work by \citet{LudwigSchelkleVogel2012}.

\Cite{LudwigSchelkleVogel2012} assess the role of endogenous human capital accumulation as a means to mitigate the adverse effects of demographic change on households born later. They carefully model the trade-off between consumption, saving, investing in human capital and enjoying leisure, in order to incorporate all relevant margins of adjustment available to the household throughout the working age. They examine alternative policy schemes, constant income tax rate and constant replacement rate, to cover the different ways in which the policy maker might react to the changing environment. Yet, one key parameter remains exogenous and fixed in their analyses: all households retire at a given age.

One dimension in which the framework could be extended is therefore to take a closer look at the retirement decision. There are numerous ways of doing so: In addition to the policy schemes analysed in \cite{LudwigSchelkleVogel2012}, the policy maker could decide about moving retirement age, while keeping retirement mandated from the government. Alternatively,

In the absence of any idiosyncratic risk, all households of a given cohort will take the same retirement decision. While interesting insights might already be generated from this setting, a more realistic framework required some heterogeneity in the retirement decision. This may achieved by different modelling approaches, for instance through idiosyncratic risk (e.g. income risk or health risk) or through preference heterogeneity (e.g. household types with different time discount factors).

My proposed extension of the framework would therefore consist of the following:
\begin{itemize}
    \item Households face idiosyncratic labor productivity risk (employment risk); they are partly insured against this through public unemployment insurance
    \item Households observe their productivity state (and hence their wage offer) and then decide
        \begin{itemize}
            \item how much labor to supply at the labor market
            \item how much effort to exert on human capital accumulation
            \item how much out of available resources to consume
            \item how much out of available resources to save in assets
        \end{itemize}
    \item While working (and paying labor income tax), households accumulate claims to pension benefits
    \item Instead of a fixed retirement age for all households, the policy maker sets an age bracket in which households endogenously decide whether to claim the pension benefits already accumulated or whether to continue working and acquire additional
    \item The age bracket can be adjusted over time, e.g.\ moving from an initial retirement period from age 60 to age 70 to a retirement period from age 65 to age 75 in the final period
    \item The policy maker guarantees a consumption floor for all retirees; above that, benefit levels are linked to accumulated claims, i.e. average past earnings and years worked
\end{itemize}

Given the complexity of the proposed model, the first step is to solve for stationary equilibria. For this, the following adjustments to the solution algorithm would be required:
\begin{itemize}
    \item As in the original model, labor supply is again endogenous, i.e. optimal labor supply needs to be solved for; this can be achieved by equating the marginal utility from leisure with the marginal utility from consumption first first and then solving for time spent on human capital accumulation and working
    \item The idiosyncratic productivity state is a stochastic state variable
    \item Average past earnings and years worked define the level of pension benefits to which a household is eligible; when counting periods of low productivity (unemployment) as working periods, average past earning and age are sufficient to describe acquired pension benefits and average past earnings need to be introduced as state variable; if unemployment spells do not generate pension benefit claims, the number of years worked needs to be introduced as additional state
    \item For the retirement period (i.e. the age bracket in which a household can decide whether to retire or not), two separate sets of value function need to be calculated: the value of being retired and the value of not being retired; from the comparison of these values, the household policy regarding the retirement decision is derived
    \item In equilibrium, the government budgets for unemployment insurance and for the public pension system need to balance individually
\end{itemize}

Clearly, for any of the above, the computational performance of the current implementation of the solution algorithm needs to improved substantially. While being remarkably robust, grid search algorithms are inherently imprecise and, especially with more than one asset, tremendously slow. There is a vast variety of alternative solution methods available from the literature, both for solving the household problem as well as for iterating over "guessing and verifying" aggregates or paths of aggregates.

One method particularly suited to solve the household problem within the proposed framework is the endogenous grid method. While the implementation is, in light of the numerous constraints, not at all trivial, the computational performance should be far superior, as information from first oder conditions is exploited and interpolation and root finding is kept at a minimum.

The "outer loop" of the model, i.e. finding aggregates such that all equilibrium conditions are met, can be interpreted as finding the root of an "equilibrium function" that measures the distance between the "guess" on which solution is based and the "verification" that results from simulating the solved model. In particular for the updating step, numerous root-finding algorithms are particularly powerful, such as (quasi-)Newton methods, that exploit information from derivatives of the "equilibrium function" (either by calculating or by approximating derivatives).

The combination of speeding up an individual iteration of the backward solution / forward simulation step and requiring less steps in total by applying more advanced root-finding algorithms should tremendously improve the computation time required to solve the model for a given calibration, enabling both increased model complexity through rich features and accuracy through sufficiently dense grids and sufficiently long time horizons.

If all of the above can be achieved, there additional extensions of the framework are of interest, e.g. the introduction of aggregate risk / uncertainty. This could be achieved either in the form of aggregate productivity risk, or in the form of policy risk. The former can be modelled through introducing stochastic aggregate productivity states (e.g. TFP shocks), the latter through uncertainty about the timing or the magnitude of an upcoming policy reform. While there is a substantial body of literature on consumption, saving (in on or more assets) and labor supply under aggregate risk, the literature on endogenous human capital accumulation and endogenous retirement is, to my best knowledge, limited. Therefore, I believe that the ideas presented above should prove to be a fruitful framework for questions around policy design with respect to demographic change.


\subsection{The interdependence assumption}\label{subsec:interdependence}

Let $\bar{\mathcal{M}}$ be a joint distribution from which the random variables
$(s, r)$ are drawn. We say that $s$ and $r$ are interdependent when there exist
$s_1, r_1$ and $s_2, r_2$ in the support of $\bar{\mathcal{M}}$ with $s_1 \neq
s_2$ such that:
\begin{align*}
    \Pr[(s, r) = (s_1, r_1)] &< \Pr[(s, r) = (s_1, r_2)]
\land\\
    \Pr[(s, r) = (s_2, r_1)] &> \Pr[(s, r) = (s_2, r_2)]
\end{align*}

Where the pair $(s, r)$ is drawn from the joint distribution
$\bar{\mathcal{M}}$.

It is clear that when two random variables $s$ and $r$ exhibit interdependence,
they must necessarily be dependent random variables. To see that
interdependence is a stronger version of dependence, observe that in the case
of dependence, the probability for some $s = s_1$ conditioned on $r = r_1$ is
necessarily different from the probability for some $s = s_2$ conditioned on $r
= r_2$. In interdependence, it can be seen that we additionally require the
event $s = s_1$ which was less probable than the event $s = s_2$ under the
condition $r = r_1$ to become more probable than $s = s_2$ under the condition
$r = r_2$.

We observe that commonly compressed texts such as HTML content exhibit
interdependence almost everywhere. To be more precise, if we sample, for
example, digrams (two-letter sequences) in HTML content of popular websites and
treat this two-letter sequence $\phi = (s, r)$ of the two characters $s$ and $r$
as a random variable $\phi$, we notice that $s$ and $r$ are dependent variables
and in fact interdependent. This straightforward fact is supported by extensive
statistical analyses in the scientific literature such as
\cite{norvig2013english}.

While the interdependence assumption is a general notion observed in all common
plaintexts, it is suitable to mention here how these ideas will emerge as we
mount our attack. In a plaintext $(s, r)$ in which the attacker controls some
reflection string $r$ and wishes to obtain information about some secret string
$s$, she wishes to distinguish between the cases $s = s_1$ and $s = s_2$ of two
different secrets $s_1$ and $s_2$, i.e. between the instances $(s_1, r)$ and
$(s_2, r)$. By measuring the difference in the probability of $(s, r)$
occurring for $r = r_1$ and $r = r_2$, the attacker can distinguish which value
of $s$ is in use. If $s = s_1$, then the attacker will observe the inequality
$\Pr[(s, r) = (s_1, r_1)] < \Pr[(s, r) = (s_1, r_2)]$, but when $s = s_2$, the
attacker will observe the different inequality $\Pr[(s, r) = (s_2, r_1)] >
\Pr[(s, r) = (s_2, r_2)]$.

\subsection{Composing with compression}\label{subsec:comcompose}

We now shift our interest to algorithms which compose compression and
encryption. We define the composition of a compression algorithm with a
rendering function and an encryption algorithm.

The encryption scheme above is treated as a composition of a
compression and encryption algorithm:
\begin{equation*}
    \mathcal{E} = \textrm{Enc} \circ \textrm{Com}
\end{equation*}

$\textrm{Com}$ is any polynomially computable reversible function that takes an
input string and outputs a new string: $\textrm{Com}: \{0, 1\}^* \leftarrow \{0,
1\}^*$.

$\textrm{Enc}$ denotes an encryption function. We stress our important
assumption that $\textrm{Enc}$ is defined on $\{0, 1\}^*$ and not on some
fixed-length input.

Also, a text transformation function $\mathcal{K}$ is a function that has the
properties defined above and, for the rest of the paper, we treat it as a
compression function.

\subsection{Compression idealness}\label{subsec:com_idealness}

We now move on to define the notion of compression idealness.

Let $\mathcal{K}$ be a function defined on some domain and with output space
all strings $\{0, 1\}^*$, and let $\bar{\mathcal{M}}$ be a distribution whose
support is a subset of the domain of $\mathcal{K}$.  We say that $\mathcal{K}$
is an ideal compression function with respect to the distribution
$\bar{\mathcal{M}}$ when for every $w_1, w_2$ in the support of
$\bar{\mathcal{M}}$ we have:
\begin{equation*}
\Pr[w = w_1] < \Pr[w = w_2] \iff \lvert\mathcal{K}(w_1)\rvert > \lvert\mathcal{K}(w_2)\rvert
\end{equation*}

Where $w$ is a random variable drawn from $\bar{\mathcal{M}}$.

The intuitive notion behind compression idealness is that the encoding
function is somehow perfectly aware of the input distribution. It
exploits this knowledge of the input space to encode each possible
input in an ideal way - more often occurring plaintexts are compressed
better, i.e. in shorter length, than rarely occurring plaintexts.
Practical compression functions are not perfectly ideal, because the
distribution of plaintexts they try to cover is broad and ill-defined.
However, such compression functions try to learn the distribution of
the plaintext they are about to compress by observing frequencies of
occurrences and taking advantage of them.

We extensively investigate experimentally the idealness aspect of the LZ77 and
Huffman compression functions in Appendix \ref{subsec:idealness_experiment}.

\subsection{Length monotonicity}\label{subsec:lenmonotone}

An important assumption for our attack is that the encryption function
$\textrm{Enc}$ is \textit{length monotonic}. Specifically, for any keys $k_1,
k_2$ in the key generating function space and string messages $m_1, m_2$:
\begin{equation*}
\begin{split}
|m_2| > |m_1|
\Rightarrow
|\textrm{Enc}_{k_1}(m_2)| \geq |\textrm{Enc}_{k_2}(m_1)|
\end{split}
\end{equation*}

If the last inequality becomes strict, we call the encryption function
\textit{strictly length monotonic}.

A practical instance of a length monotonic encryption function is AES in GCM
mode. Stream ciphers can be treated as strictly monotonic to the bit level.

\subsection{Compressibility with respect to predicates}\label{subsec:propertycom}
In this section we will define compressibility with respect to predicates. We
show that all ideal compression functions that exhibit interdependence are
compression detectable by a reflection vector $\overbar{r}$ with respect to a
predicate $Q$ and a distribution $\mathcal{M}$.

Let $\mathcal{M}$ be a plaintext distribution and $Q(s)$ be a predicate on the
plaintext $s$ drawn from $\mathcal{M}$. Furthermore, we require that $Q$ is not a
trivial predicate; that is, there must exist elements for which $Q$ is true and
others for which it is false. Let us use $\mathcal{M}_Q$ to denote the
distribution $\mathcal{M}$ conditioned on the predicate $Q$.

For the specific property $Q$ and plaintext distribution $\mathcal{M}$, define:
\begin{equation*}
    \pi \defeq max(\Pr[Q(s)], 1 - \Pr[Q(s)])
\end{equation*}

Where $s$ is drawn from $\mathcal{M}$.

Let $\overbar{r} = (r_1, r_2) \in \mathcal{M}^2$ be a reflection string pair,
$\mathcal{K}$ be an ideal compression function, and let $\alpha(\lambda)$ be a
non-negligible function.

We now examine how the lengths of compressing a secret $s$ rendered with
reflection strings $r_1$ and $r_2$ respectively compare.

The predicate $Q$ partitions the set $\mathcal{M}$ into two partitions
$\mathcal{M}_Q$ and $\mathcal{M}_{\lnot Q}$. We are interested in reflection
string pairs $\overbar{r} = (r_1, r_2)$ for which the comparison direction
depends on which partition $s$ belongs to.  If $s \in \mathcal{M}_Q$, it should
compress better when reflection $r_1$ is used as compared to when $r_2$ is used.
On the contrary, if $s \in \mathcal{M}_{\lnot Q}$, the opposite direction should
occur.  If this is the case for the selected reflection pair, we say that $Q$
compares favourably under $\overbar{r}$:
\begin{equation*}
\begin{split}
    cpr^Q_{\mathcal{K}}(s, \overbar{r})
    \defeq\\
    \begin{cases}
        |\mathcal{K}(s, r_1)| < |\mathcal{K}(s, r_2)| &\text{ if } Q(s)\\
        |\mathcal{K}(s, r_1)| \geq |\mathcal{K}(s, r_2)| &\text{ otherwise}
    \end{cases}
\end{split}
\end{equation*}

The reflection pair $\overbar{r}$ \textit{detects} predicate $Q$ under
compression function $\mathcal{K}$ over the secret distribution $\mathcal{M}$ with
advantage $\alpha$ when the comparison is favourable for both $s_1$ drawn from
$\mathcal{M}_Q$ and $s_2$ drawn from $\mathcal{M}_{\lnot Q}$. Formally, we
define the predicate $dtc_\alpha(Q, \overbar{r}, \mathcal{K}, \mathcal{M})$
as follows:
\begin{align*}
    \Pr
        [cpr^Q_{\mathcal{K}}(s_1, \overbar{r}) \land
         cpr^Q_{\mathcal{K}}(s_2, \overbar{r})]
    \geq\\
    \pi + \alpha(\lambda)
\end{align*}

Where $s_1$ is drawn from $\mathcal{M}_Q$ and $s_2$ is drawn from
$\mathcal{M}_{\lnot Q}$.

We call $Q$ \textit{compression-detectable} with an advantage $\alpha$ if a pair
$\overbar{r} = (r_1, r_2)$ exists, such that $dtc_\alpha(Q, \overbar{r}, \mathcal{K},
\mathcal{M})$ holds. Furthermore we require that such a pair $\overbar{r}$ is
polynomially computable. That is, there exists some polynomial-time
functionality $\mathcal{O}_R(\mathcal{K}, Q, \mathcal{M})$ which produces an
$\overbar{r}$ such that $dtc_\alpha(Q, \overbar{r}, \mathcal{K}, \mathcal{M})$ holds.

The compression-detectability property exists in all common compression
functions as long as $s$ and $r$ compress in the same context. We will now
prove the fact that all compression functions which are ideal under some
distribution $\bar{\mathcal{M}}$ exhibit compression-detectability of some
predicate $Q$.

\subsection{Good compression allows predicate detection}

We now move on to show that all good compression functions exhibit
compression-detectability of some predicate. In intuitive terms, this means
that if a compression function compresses well enough, it will necessarilly
allow one part of the plaintext to affect how another part of the plaintext
compresses. An attacker that is able to measure how well a string compresses
can use this to detect a predicate on the second part of the plaintext by
changing the first part of the plaintext.

In the following theorem, we prove compression detectability of a predicate with
the simplification that the resulting reflection pair $(r_1, r_2)$ is
efficiently computable.

\begin{lemma}[Good compression is detectable]
Let $\mathcal{K}$ be an ideal compression function with respect to some
interdependent distribution $\bar{\mathcal{M}}$. Then there exists
some compression-detectable predicate $Q$ for $\mathcal{K}$.
\end{lemma}

A full proof can be found on Appendix A.


\subsection{Robotics}

Robot exists in some configuration space
By cartesian coordinates, angles and lengths.

There are legal and illegal positions

Path planning is difficult

There are many degrees of freedom for complex robots

Higher dimension space makes solutions more difficult


\graphicspath{{Ch4_Jets/figures/}}

\chapter{Jets}
\label{ch:jets}
%TODO: reference boson tagging part of analysis chapter somewhere in this chapter
%TODO: basic jet cartoon figure
As discussed in Section~\ref{sec:monte_carlo}, partons created during $pp$ collisions undergo a showering process where they produce cascades of additional strongly interacting particles through gluon radiation and splitting.
As this showering process concludes and the products approach a sufficiently low energy ($\approx 1$ GeV) the resulting partons hadronize and produce a spray of colorless hadrons called a ``jet'' which interacts with both the tracking and calorimeter systems of the ATLAS detector.
Jets are reconstructed by employing \textit{jet clustering algorithms} which take from the event a set of constituent inputs representing the products of parton showering and combine them to output a set of jets, ideally representing the original partons from the hard scatter event.
At the ATLAS experiment jets may be constructed using only tracks as inputs, only calorimeter clusters as inputs, or a combination of both.

\section{Jet Constituents}
\label{sec:jet_constituents}
All jet clustering algorithms take as input a set of four-vectors representing all the products of parton showering and hadronization, known as \textit{constituents}.
These constituents compose \textit{all} the potential jets in the event, and it is the job of the jet clustering algorithm to convert these to a set of four-vectors representing only the corresponding jets from the event.
These constituents can be created with information from any particular ATLAS sub-detector or combination thereof, as long as they encode the four-vectors of the particles produced during the jet showering/hadronization process.
The most relevant constituent types for this analysis are outlined below.

\subsection{Calorimeter Clusters}
The information quality contained within a collection of calorimeter signals of a given collision event can be increased by grouping the signals into \textit{topologically connected cell clusters}.
This strategy helps to reduce the impact of background electronic noise and other sources of calorimeter fluctuation such as the presence of pile-up.
The finely segmented lateral ($\eta$-$\phi$) readout together with the longitudinal sampling layers allows the ATLAS calorimeter system to resolve spatial signal patterns relevant for jet reconstruction while efficiently removing insignificant signals caused by noise.

\newcommand{\LCTopoSig}{\ensuremath{\varsigma^{\mathrm{EM}}_{\mathrm{cell}}}}
These topo-clusters are formed by a growing-volume algorithm \cite{Aad:2016upy} which begins with a calorimeter cell possessing a highly significant \textit{seed signal}, where significance is defined as the ratio of the cell signal magnitude over the expected noise:
\begin{equation}
    \LCTopoSig = \frac{E^{\mathrm{EM}}_{\mathrm{cell}}}{\sigma^{\mathrm{EM}}_{\mathrm{noise,cell}}}
    \label{eqn:lctopo_sig}
\end{equation}
The growth of the topo-cluster proceeds iteratively by connecting nearby cells, where the seeding, growth, and boundary conditions are controlled by placing bounds on the cell significance (Eq.~\ref{eqn:lctopo_sig}), as shown in Figure~\ref{fig:lctopo_formation}.
The four-vector corresponding to each topo-cluster is computed by a weighted combination of all cells contained in the topo-cluster.
The weights are necessary because each cell is allowed to contribute (unevenly) its energy to two separate topo-clusters.

\begin{figure}
	\centering
	\includegraphics[width=\textwidth]{lctopo_formation}
	\caption{
	Stages of topo-cluster formation in the FCAL calorimeter for a simulated dijet event.
	Cells with $\LCTopoSig > 4$ (top left) are used in the seeding, cells with $\LCTopoSig > 2$ (top right) control the topo-cluster growth.
	The final set of topo-clusters (bottom) is shown with black outlines around each cluster.
	Adapted from \cite{Aad:2016upy}.
	}
	\label{fig:lctopo_formation}
\end{figure}

\subsection{Tracks}
The more energetic or ``boosted'' a jet-initiating particle is, the more collimated the showering/hadronization process becomes.
At a certain point the calorimeter spatial resolution is no longer fine-grained enough to fully resolve the individual jet constituents.
On the other hand, the ID has excellent angular resolution and track reconstruction efficiency even at very high energy with dense clusters of charged particles \cite{Aaboud:2017all}.
Since jet clustering algorithms are indifferent to the origin of the inputs, only requiring a set of four-vectors as input, they can be applied to tracks just as well as calorimeter clusters.
In particular, utilizing ID information during jet clustering allows for a more detailed view of the internal structure of jets, which is particularly useful in the context of jet substructure (Section \ref{sec:jet_substructure}) and $b$-tagging (Section \ref{sec:btagging}).

\subsection{Track-Calo Clusters}
\label{sec:tcc_constituents}
% cite combined mass as first step towards TCCs
\newcommand{\mCALO}{\ensuremath{m^{\mathrm{calo}}}}
\newcommand{\mTRACK}{\ensuremath{m^{\mathrm{track}}}}
\newcommand{\mTA}{\ensuremath{m^{\mathrm{TA}}}}
\newcommand{\ptCALO}{\ensuremath{p_T^{\mathrm{calo}}}}
\newcommand{\ptTRACK}{\ensuremath{p_T^{\mathrm{track}}}}
While using tracks as inputs to the jet clustering improves the angular resolution, there are two primary downsides: (1) only charged particles interact with the ID, and (2) the energy resolution of the tracking detector degrades at very high energy.
In order to achieve the best of both worlds, tracking and calorimeter information can be combined.
One of the first ways in which ATLAS explored this possibility was by improving the calorimeter jet mass $(\mCALO)$ measurement by incorporating information about nearby associated tracks to produce the so-called \textit{track-assisted jet mass} \cite{ATLAS-CONF-2016-035}.

The four-vector of a jet is simply the sum of the four-vectors of its constituents. For a calorimeter jet $J$ with calorimeter cell cluster constituents $i$, each with momentum $\vec{p}_i$, the calorimeter mass ($\mCALO$) is defined (by the basic rules of special relativity) as:
\begin{equation}
    \mCALO = \sqrt{
        \left(
            \sum_{i \in J} E_i
        \right)^2
            -
        \left(
            \sum_{i \in J} \vec{p}_i
        \right)^2
    }
    \label{eqn:jet_mass}
\end{equation}
where each calorimeter cluster is assumed to result from particles with zero mass. The track-assisted jet mass is defined as:
\begin{equation}
    \mTA = \frac{\ptCALO}{\ptTRACK} \times \mTRACK
    \label{eqn:ta_jet_mass}
\end{equation}
where \ptCALO\ is the transverse momentum of a calorimeter jet, \ptTRACK\ is the transverse momentum of the four-vector sum of tracks associated to the calorimeter jet and \mTRACK\ is the invariant mass of this four-vector sum.
The improvement in jet mass resolution observed with $\mTA$ is shown in Figure~\ref{fig:ta_vs_comb_mass_res}.

\begin{figure}
	\centering
	\includegraphics[width=0.6\textwidth]{ta_vs_calo_mass_res_wz_jets}
	\caption{
	The resolution of the jet mass response as a function of truth jet $p_T$ for simulated $W$ and $Z$ boson jets for calorimeter-based jet mass (dashed red line) and track-assisted jet mass (blue solid line).
	The half of the 68\% interquartile range (IQnR) divided by the median of the jet mass response is used as an outlier-insensitive measure of the resolution.
	\cite{ATLAS-CONF-2016-035}
	}
	\label{fig:ta_vs_comb_mass_res}
\end{figure}

While the jet mass resolution is notably improved by utilizing \mTA\ in many cases, a more rigorous unification of tracking and calorimeter information was desired to yield benefits in \textit{all} observable jet properties at a wider range of energies.
One method to achieve this is the definition of a new type jet input constituent which unifies tracks and calorimeter deposits into new ``Track-Calo Cluster'' (TCC) objects, designed to maximally exploit the strengths of each detector.

To build TCC constituents for each event, good quality tracks matched to the selected hard scatter primary vertex are extrapolated to the calorimeter and matched to corresponding topo-clusters, as shown in Figure~\ref{fig:tcc_cartoon}.
The error on this extrapolation accounts for both the original ID measurement of the track parameters, as well as additional uncertainty accumulated as the particle passes through additional detector elements.
The typical extrapolated angular uncertainty of a track is significantly smaller than the size of the average topo-cluster across the detector, particularly for moderate to high $p_T$ tracks.

\begin{figure}
	\centering
	\includegraphics[width=\textwidth]{TCC_cartoon}
	\caption{
	A schematic demonstration the creation of seven TCC objects representing \circled{1} a simple track-cluster match, \circled{2} a topo-cluster without a matching track, \circled{3} a track without a matching cluster, \circled{4} and \circled{5} are each tracks matching a single cluster but sharing that cluster's energy, and \circled{6} and \circled{7} showing a much more complex scenario with multiple track-cluster matches.
    \cite{ATL-PHYS-PUB-2017-015}
	}
	\label{fig:tcc_cartoon}
\end{figure}

Fully matched track/topo-cluster combinations are referred to as ``combined''.
Un-matched topo-clusters and tracks are not discarded, but rather grouped into separate sets of TCC constituents.
TCC objects created with an un-matched track are referred to as ``charged'', and TCC objects created with an un-matched topo-cluster are referred to as ``neutral''.
Within the acceptance of the ID the ``combined'' type composes $> 95\%$ of all reconstructed TCC, whereas outside the acceptance of the ID the ``neutral'' type dominates, as shown in Figure~\ref{fig:tcc_cluster_fractions}.

\begin{figure}
	\centering
	\includegraphics[width=\textwidth]{tcc_cluster_fractions}
	\caption{
	The fractions of different TCC types are shown as a function  of (a) the TCC $\eta$ and (b) the TCC $p_T$.
	Combined objects (triangles) represent tracks for the selected hard scatter primary vertex which are matched to topo-clusters, neutral objects (squares) are for topo-clusters not matched to tracks for any primary vertex, and charged objects (circles) are tracks from the selected hard scatter primary vertex not matched to any topo-cluster.
    \cite{ATL-PHYS-PUB-2017-015}
	}
	\label{fig:tcc_cluster_fractions}
\end{figure}

In order to combine the track and/or topo-cluster into a single object, a scheme must be devised for defining the resulting four-vector in terms of the four-vectors of the track and topo-cluster.
This is done in a straight-forward manner as follows:
\newcommand*\caloP[1]{#1^{\mathrm{calo}}}
\newcommand*\trackP[1]{#1^{\mathrm{track}}}
\begin{align}
    \vec{p}_{\mathrm{TCC}}^{\mathrm{\;combined}} &\equiv (\caloP{p_T}, \trackP{\eta}, \trackP{\phi}, \caloP{m})\\
    \vec{p}_{\mathrm{TCC}}^{\mathrm{\;charged}} &\equiv (\trackP{p_T}, \trackP{\eta}, \trackP{\phi}, \trackP{m})\\
    \vec{p}_{\mathrm{TCC}}^{\mathrm{\;neutral}} &\equiv (\caloP{p_T}, \caloP{\eta}, \caloP{\phi}, \caloP{m})
\end{align}
which combines calorimeter energy/mass measurements and track angular information for the combined TCC objects.
For dealing with cases where multiple tracks are matched to the same topo-cluster (or vice versa) a more complicated formula accounting for energy-sharing is required \cite{ATL-PHYS-PUB-2017-015}.

\section{Clustering Algorithms}
% TODO: reference other algorithms: CA, kT, mass drop, UFO, particle flow, etc
Due to their aggregate nature, the notion of a \textit{jet} is not as immediately or clearly interpreted as are other physics objects such as electrons, muons, and photons.
This allows for a significant amount of freedom in how jets are defined and reconstructed in collider experiments.
Furthermore the manner in which individual constituents are combined, and the characteristic size of the resulting jets (in the $\eta$-$\phi$ plane) can be altered on a per-algorithm basis.
To deal with this ambiguity a set of properties that must be met by any standardized jet definition were outlined in December of 1990 \cite{Huth:217490} as follows:
\begin{enumerate}
    \itemsep0em
    \item Simple to implement in an experimental analysis.
    \item Simple to implement in a theoretical calculation.
    \item Defined at any order of QCD perturbation theory.
    \item Yield finite cross section at any order of perturbation theory.
    \item Yield a cross section that is \textit{relatively} insensitive to hadronization.
\end{enumerate}
This set of rules allows for better comparison of experimental results and theoretical predictions, as well as better comparison of results between different collider experiments.

The most common category of jet clustering algorithm used by ATLAS is \textit{sequential recombination} \cite{Catani:1993hr}.
These algorithms are carefully designed to be insensitive to the present of soft (sometimes called ``infrared'') and collinear gluon emission and thus usable in perturbation theory calculations.
These recombination algorithms work iteratively by attempting to work in reverse through the history of the parton shower, starting with the softer final products of the showering/hadronization process recorded by the detector, and working back (ideally) to the original hard collisions product(s) which initiated the jet.

The primary quantities of interest in these algorithms are a distance measure between separate objects $d_{ij}$ and between each object and the ``beam'' $d_{iB}$.
\begin{align}
d_{ij} &= \min\left({p_{T_i}^{2P}, p_{T_j}^{2P}}\right) \times \frac{\Delta R_{ij}^2}{R^2} \\
d_{iB} &= p_{T_i}^{2P}
\end{align}
where $\Delta R_{ij}$ is the angular distance between the $i$-th and $j$-th objects: $\Delta R_{ij}^2 = \Delta \eta_{ij}^2 + \Delta \phi_{ij}^2$, $p_T$ is the transverse momentum of the object, and the parameters $P$ and $R$ are algorithm parameters which regulate the evolution of the clustering.
Starting with the full set of constituents as objects, the algorithm proceeds by identifying the smallest of all the distance measures $d_{ij}$ or $d_{iB}$.
If the smallest is $d_{ij}$ for some particular $i$/$j$ then it combines the four-vectors of $i$ and $j$ into a new object, otherwise if it is $d_{iB}$ then object $i$ is added to the set of jets to be output at the end of the clustering and discarded from the rest of the calculation.
New distances are calculated accounting for combined objects and the process is repeated until no objects are left, or in other words, all constituents in the event have been recombined into jets.

Different jet clustering algorithms in the sequential recombination family are distinguished by different values for the parameters $P$ and $R$ mentioned above.
The $k_T$ algorithm \cite{Catani:1993hr} for $P=1$ causes softer (lower $p_T$) particles to be merged first.
This introduces a strong sensitivity to small fluctuations of the energy density in the particle shower.
For this reason it is rarely used in a modern context.
The \textit{Cambridge-Aachen} (C/A) algorithm \cite{Dokshitzer:1997in} for $P=0$ works only with the angular component of the jets by sorting the objects without any reference to $p_T$ in $d_{ij}$.

The \textit{anti}-$k_T$ algorithm \cite{Cacciari:2008gp} for $P = -1$ causes soft particles to cluster together with nearby hard particles before they cluster between themselves.
This reduces sensitivity to small fluctuations of energy within the parton shower, the primary (undesirable) characteristic of the $k_T$ algorithm.
This property causes a hard particle with no hard neighbors within a distance of $2R$ to accumulate all nearby soft particles within a circle of radius $R$.
This leads to a stability in jet area which is helpful for jet calibration and analysis, which has resulted in anti-$k_T$ being used as the default algorithm for the majority of ATLAS research.

The choice of jet clustering algorithm parameters as well as constituent type depends in part upon the physics analysis goals in question.
In particular circumstances two separate jet algorithms may be used to reconstruct the same event to pick out separate features.
For example, for identifying the decay products of the two-pronged decay of a Standard Model vector boson ($W/Z \rightarrow q\bar{q}^{(\prime)}$), the anti-$k_T$ algorithm with a large radius parameter of $R$ = 1 is used to capture the full jet corresponding to the inclusive $W/Z$ decay.
However, jets with a smaller radius parameter can be used to capture the features of the jets corresponding to the individual quark jets.

In particular for the case of capturing and reconstructing the $b$-quarks from a $H \rightarrow b\bar{b}$ decay, a special modification the jet clustering algorithms discussed above can be made to produce jets with variable radius (VR) \cite{Krohn:2009zg}.
This entails modifying the radius parameter $R$ to depend on jet $p_T$ in the following way:
\begin{equation}
R \rightarrow R_{\mathrm{eff}}(p_T) \equiv \frac{\rho}{p_T}
\end{equation}
where the new constant parameter $\rho$ determines how quickly the effective jet size decreases as the jet $p_T$ increases.
Additionally the VR jet clustering algorithm also imposes a minimum ($R_{\mathrm{min}}$) and maximum ($R_{\mathrm{max}}$) bound on the radius which prevents the jet radii from becoming pathologically small or large.

In practice the VR modification has only been widely used on ATLAS for anti-$k_T$ jets reconstructed with track constituents, in particular for reconstructing the individual $b$-jets from an $H \rightarrow b\bar{b}$ decay process.
The values $\rho = 30$ GeV, $R_{\mathrm{min}} = 0.02$, and $R_{\mathrm{max}} = 0.4$ are used in ATLAS and were derived by scanning each parameter for simulated Higgs jets and maximizing the truth $b$-quark matching efficiency for each subjet as shown in Figure~\ref{fig:vr_jet_optimization}.

\begin{figure}
	\centering
	\includegraphics[width=\textwidth]{vr_jet_optimization}
	\caption{
	Efficiency of subjet double $b$-labelling at the truth level for Higgs jets as a function of Higgs jet $p_T$.
	(a) The efficiency for VR track jets with $R_{\mathrm{min}} = 0.02$ and $R_{\mathrm{max}} = 0.4$ for several different $\rho$ values.
	(b) The efficiency for VR track jets with $\rho = 30$ GeV and $R_{\mathrm{max}} = 0.4$ for several different values of $R_{\mathrm{min}}$.
	(c) The efficiency for VR track jets with $\rho = 30$ GeV and $R_{\mathrm{min}} = 0.02$ for several different values of $R_{\mathrm{max}}$
	The efficiency for standard $R = 0.2$ track jets is also included in all of the plots.
	\cite{ATL-PHYS-PUB-2017-010}
	}
	\label{fig:vr_jet_optimization}
\end{figure}

\section{Calibration}
\label{sec:jet_calibration}
The jets reconstructed by any particular clustering algorithm may not correctly match the true four-vector of the original parton.
There are a number of factors responsible for this, such as:
\begin{itemize}
    \itemsep0em
    \item \textbf{Dead Material}: Some of the products of the showering process may be absorbed by inactive detector elements and thus not be present as constituents.
    \item \textbf{Leakage}: Some energy may fall outside or ``punch through'' the calorimeter.
    \item \textbf{Out-of-cone Effects}: Some particles may fall outside the reconstructed jet due to imperfect clustering.
    \item \textbf{Thresholds/Efficiency}: A proportion of the total jet energy may be lost in reconstruction. For example by falling below the noise threshold in some calorimeter cells.
\end{itemize}

In order to compensate for these effects the jet energy, $\eta$ and mass is corrected based upon studies utilizing MC simulated events.
The full calibration scheme is outlined in Figure~\ref{fig:jet_calib_flowchart}.
For each simulated event, jets are reconstructed and groomed as described in the preceding sections.
However, a second collection of jets is also clustered using truth particles from the simulation.
These ``truth'' or ``particle-level'' jets suffer from none of the issues described above and match the true parton four-vector much more closely.
By matching together each reconstructed jet with its truth-level counterpart, the difference between the truth four-vector and the reconstructed four-vector can be quantified.

\begin{figure}
	\centering
	\includegraphics[width=\textwidth]{jet_calibration_flowchart}
	\caption{
	Overview of the large-$R$ jet reconstruction/calibration procedure, as described in \cite{Aaboud:2018kfi}.
	Note that for the TCC jets used in the analysis covered by this thesis, the inputs are Track-Calo Clusters (TCCs) instead of calorimeter clusters as specified in this chart.
	}
	\label{fig:jet_calib_flowchart}
\end{figure}

{
\newcommand{\EReco}{\ensuremath{E_{\mathrm{reco}}}}
\newcommand{\ETruth}{\ensuremath{E_{\mathrm{truth}}}}
\newcommand{\MReco}{\ensuremath{m_{\mathrm{reco}}}}
\newcommand{\MTruth}{\ensuremath{m_{\mathrm{truth}}}}
\newcommand{\CJES}{\ensuremath{c_{\mathrm{JES}}}}
\newcommand{\CJMS}{\ensuremath{c_{\mathrm{JMS}}}}
\newcommand{\EtaReco}{\ensuremath{\eta_{\mathrm{reco}}}}
Reconstructed jets are matched to particle-level jets with a simple angular matching procedure that minimizes their separation $\Delta R = \sqrt{(\Delta \eta)^2 + (\Delta \phi)^2}$.
The energy \textit{response} is defined as $\EReco / \ETruth$, where \EReco\ is the reconstructed jet energy \textit{prior} to calibration and \ETruth\ is the energy of the corresponding truth-level jet.
The mass response is defined similarly as $\MReco / \MTruth$.
The response is parameterized as a function of jet energy and $\eta_{\mathrm{reco}}$, and an average is computed ($R_E = \langle \EReco / \ETruth \rangle)$ using a Gaussian fit of the response. The jet energy response for TCC jets is shown in Figure~\ref{fig:tcc_jet_e_response}.

The energy correction derived this way (\CJES) is typically on the order of 5-10\% with only a weak dependence on the jet energy and a structure in $\eta_{\mathrm{reco}}$ that clearly reflects the detector technology and geometry.
The mass correction (\CJMS) is close to unity for jets with $p_T$ between 200 and 800 GeV, but can be as large as 1.5 for very energetic jets with low mass.

In addition to this jet energy scale (JES) and jet mass scale (JMS) calibration, a small correction $\Delta \eta$ is applied to correct for a bias relative to truth-level jets, but only in certain regions of the detector \cite{TheATLAScollaboration:2015soq}.
At this point we refer to the uncalibrated quantities with subscript zero $(E_0, \eta_0$, etc), and the calibrated quantities with subscript ``reco''.
The final JES+JMS scale calibrated large-$R$ jet energy, mass, $\eta$ and $p_T$ can then be written as
\begin{align}
    \EReco &= \CJES\; E_0\\
    \MReco &= \CJES\; \CJMS\; m_0\\
    \EtaReco &= \eta_0 + \Delta \eta\\
    p_T^{\mathrm{reco}} &= \CJES \sqrt{E_0^2 - \CJMS^2 m_0^2}\; /\; \cosh{(\eta_0 + \Delta \eta)}
\end{align}
}

\begin{figure}
	\centering
	\includegraphics[width=0.6\textwidth]{tcc_jet_e_response}
	\caption{
	The jet energy response (before calibration) for TCC jets is presented as a function of jet pseudorapidity for several values of truth jet energy ranging from 150 GeV to 4 TeV.
	}
	\label{fig:tcc_jet_e_response}
\end{figure}

\section{Jet Substructure}
\label{sec:jet_substructure}
The primary goal of jet reconstruction is to accurately measure the four-vectors of the outgoing partons resulting from the hard scatter event.
However, a significant amount of additional information can be obtained by analyzing the internal structure of the jet constituents.
For example they may tend to be diffuse and evenly spread in the case of a gluon-initiated jet.
On the other hand, in the case of a $Z \rightarrow q\bar{q}$ or $H \rightarrow b\bar{b}$ decay there will often be two distinct ``prongs''.
It is often the case that the sensitivity of jet-based searches can be improved by accounting for these differences in the internal structure of jets which differs for background and signal, because a single jet containing all the decay products of a massive particle (such as a $W$ or $Z$ boson) has significantly different internal structure than a jet (of the same $p_T$) originating from a light quark or gluon.

The details of jet substructure can be more clearly resolved if the contribution from soft radiation and pileup is removed from the jet beforehand using a process generally referred to as \textit{jet grooming}.
For the large-$R$ TCC jets used for this thesis a technique called ``trimming'' is used which relies on the fact that the contamination from pile-up, multiple parton interactions (MPI) and initial state radiation (ISR) in the reconstructed jet is often much softer than the showering products of the partons associated with the outgoing hard-scatter products.
During the trimming procedure soft constituents are removed by using their $p_T$ ratios as the metric for removal.

The trimming procedure uses a $k_T$ algorithm with a smaller radius parameter $R_{\mathrm{sub}}$ to reconstruct all constituents from a single large-$R$ jet into a set of smaller contained ``subjets''.
Any subjets with $p_{T_i} / p_T^{\mathrm{jet}} < f_{\mathrm{cut}}$ are removed from the original large-$R$ jet, where $p_{T_i}$ is the transverse momentum of the $i^{\mathrm{th}}$ subjet and $f_{\mathrm{cut}}$ is an adjustable parameter of the trimming procedure.
This process is illustrated in Figure~\ref{fig:jet_trimming_cartoon}.
For this thesis values of $R_{\mathrm{sub}} = 0.2$ and $f_{\mathrm{cut}} = 0.05$ are used.
A variety of alternative jet grooming procedures have been studied by ATLAS \cite{Aad:2013gja} as well, including methods that involve modifying the jet clustering algorithm itself.

\begin{figure}
	\centering
	\includegraphics[width=0.6\textwidth]{jet_trimming_cartoon}
	\caption{
	Diagram depicting the jet trimming procedure.
    \cite{Aad:2013gja}
	}
	\label{fig:jet_trimming_cartoon}
\end{figure}

After jet grooming has been applied to enhance the quality of information contained within the constituents of a jet, the aggregate properties of these constituents can be computed with so-called \textit{jet substructure variables}.
In the past the more commonly used jet substructure variables were computed by analyzing the jet clustering algorithm history ($k_T$ ``splitting scales'' \cite{PhysRevD.65.096014}) or properties of the re-clustered subjets ($N$-subjettiness \cite{Thaler:2010tr}).

Presently, as is the case for the work covered in this thesis, the so-called \textit{Energy Correlation Functions} (ECF) \cite{Larkoski:2013eya, Moult:2016cvt} have become the de facto standard and are computed by summing certain expressions over all constituents contained within a jet as follows:
\begin{align}
    e_2^{(\beta)} &= \sum_{1 \le i < j \le n_J} z_i z_j \theta_{ij}^\beta \\
    e_3^{(\beta)} &= \sum_{1 \le i < j < k \le n_J} z_i z_j z_k \theta_{ij}^\beta \theta_{ik}^\beta \theta_{jk}^\beta \\
    e_4^{(\beta)} &= \sum_{1 \le i < j < k < l \le n_J} z_i z_j z_k z_l \theta_{ij}^\beta \theta_{ik}^\beta \theta_{jk}^\beta \theta_{il}^\beta \theta_{jl}^\beta \theta_{kl}^\beta
\end{align}
where $n_J$ is the number of constituents in the jet, $\beta$ is an adjustable parameter, $z_i$ is the ratio of the $p_T$ of the $i^{\mathrm{th}}$ constituent of the jet over the total jet $p_T$, and $\theta_{ij} = (\phi_i - \phi_j)^2 + (y_i - y_j)^2$ is the angular separation of constituents $i$ and $j$.
These ECF expressions form the basis for constructing higher-level jet substructure observables where $e_{N+1}^{(\beta)}$ captures the $N$-prong nature of a jet. For example, the high level jet substructure observable that quantities how compatible a jet is with a 2-prong structure is
\begin{equation}
    D_2^{(\beta)} = \frac{e_3^{(\beta)}}{\left( e_2^{(\beta)} \right)^3} \end{equation}
The $e_2$ vs. $e_3$ phase space distributions of 1-prong (light quark/gluon) and 2-prong ($W/Z \rightarrow q\bar{q}^{(\prime)},\ H \rightarrow b\bar{b})$ jets are shown in Figure~\ref{fig:d2_plane_contours}.
The value $\beta = 1$ is standard in ATLAS as it results in the highest sensitivity across a wide range of jet mass and $p_T$.

\begin{figure}
	\centering
	\includegraphics[width=0.6\textwidth]{d2_plane_contours}
	\caption{
	Schematic depiction of the phase space for the energy correlation functions $e_2$ and $e_3$ which compose $D_2$.
	Contours of the $D_2$ variable are shown as white dashed curves.
	The $D_2$ variable is explicitly defined to cleanly separate the 1-prong and 2-prong regions of this phase space.
    \cite{Moult:2016cvt}
	}
	\label{fig:d2_plane_contours}
\end{figure}

\section{B-Jet Identification}
\label{sec:btagging}
In general jet reconstruction algorithms proceed without special consideration of the ``flavor'' of a jet: light quark, charm ($c$) or bottom ($b$).
However, the identification of jets containing $b$-hadrons (often simply called $b$-\textit{jets}) is of utmost importance not only for this thesis, but for the majority of the most ambitious physics goals of the ATLAS experiment.
In particular the precision measurements of Higgs boson properties and searches for BSM physics rely heavily on an ability to pick out or \textit{tag} $b$-jets and distinguish them from light quark jets. The algorithms used to perform this tagging are referred to as \textit{b-tagging algorithms}.

The relatively long lifetime of $b$-hadrons (approximately 1.5 picoseconds) gives them a characteristic flight path of approximately 5 mm from the primary hard-scatter vertex before undergoing secondary decay.
This flight distance is quite often large enough that the decay chain can be resolved by the ID and the secondary decay vertex (SV) can be identified.
Furthermore, roughly 90\% of the time a tertiary vertex (TV) from a $c$-quark will be present as well.
These properties, depicted in Figure~\ref{fig:b_decay_cartoon}, are exploited by the $b$-tagging algorithms.

\begin{figure}
	\centering
	\includegraphics[width=0.65\textwidth]{b_decay_cartoon}
	\caption{
	Cartoon of a $b$-jet decay containing a $b$-hadron decay vertex (blue dot) displaced from the primary $pp$ vertex (red dot) and a $c$-hadron decay vertex (orange dot) further displaced and often close to the $b$-hadron flight axis.
	The tracks emerging from the secondary (blue dot) and tertiary (orange dot) vertices have large impact parameters (green line) with respect to the primary hard scatter vertex (red dot). \textcopyright 2017 Andy Chisholm.
	}
	\label{fig:b_decay_cartoon}
\end{figure}

The primary $b$-tagging algorithm developed for ATLAS during Run 2, referred to as MV2c10, utilizes a machine learning technique called a boosted decision tree (BDT).
This is multivariate algorithm which uses inputs from a variety of other algorithms which utilize both tracking and calorimeter information pertinent to each jet under consideration. These include:
\begin{itemize}
    \itemsep0em
    \item Jet $p_T$ and $\eta$.
    \item A likelihood-based combination of the transverse and longitudinal impact parameter significances. %TODO: cite relevant thesis section
    \item The presence and properties of a secondary vertex.
    \item Reconstruction of a $b$-hadron decay chain using a Kalman filter to search for a common direction connecting the primary vertex to both the bottom and tertiary charm decay vertices.
\end{itemize}

The MV2c10 machine learning algorithm is trained on a set of events from a simulated $t\bar{t}$ sample, where $b$-jets are labelled as ``signal'' and $c$-jets and light quark jets are labelled as ``background''.
Ultimately the MV2c10 algorithm produces a single output discriminating variable for each jet, as shown in Figure~\ref{fig:mv2c10_discriminant}.

\begin{figure}
	\centering
	\includegraphics[width=\textwidth]{mv2c10_discriminant}
	\caption{
	The MV2c10 output (left plot) for $b$-jets (solid line), $c$-jets (dashed line) and light quark jets (dotted line) in simulated $t\bar{t}$ events, as well as the background rejection for light quarks (dashed line) and $c$-jets as a function of the $b$-jet tagging efficiency (right plot).
	This performance was evaluated on simulated $t\bar{t}$ events.
    \cite{Aaboud:2018xwy}
	}
	\label{fig:mv2c10_discriminant}
\end{figure}

In order to utilize the MV2c10 output discriminant in a physics analysis, two tasks must be accomplished: (1) Cuts on the MV2c10 discriminant called ``working points'' (WP) must be defined, with a specified signal efficiency in simulated events and (2) scale factors to correct for small discrepancies between simulation and data must be derived along with their uncertainties.
The ATLAS experiment produces these scale factors by studying a very pure $t\bar{t}$ sample in data using two complementary methods: a ``tag-and-probe'' approach (T\&P) and a combinatorial likelihood approach (LH).
These methods both rely on the fact that the $t \rightarrow Wb$ branching fraction is close to 100\%.
Two oppositely charged leptons resulting from the leptonic $W$ boson decays are required in each event ($e\mu$, $ee$ or $\mu\mu$).
By selecting only events where both $W$ bosons (from each top quark) decay leptonically, the number of non $b$-jets in these events is greatly reduced. The T\&P and LH methods differ in the restrictions they place on the lepton flavors of the final state. The resulting $b$-tagging efficiencies and scale factors are shown in Figure~\ref{fig:b_tagging_eff_sf} for the 70\% WP.

\begin{figure}
	\centering
	\includegraphics[width=\textwidth]{b_tagging_eff_sf}
	\caption{
	The (a) b-jet tagging efficiency and (b) b-jet tagging efficiency simulation-to-data scale factors for the $\varepsilon_b$=70\% single-cut WP of the MV2 tagger as a function of jet \pt. The efficiency measurement is shown together with the efficiency derived from simulated $t\bar{t}$. Vertical error bars include data statistical uncertainties only while the green bands correspond to the sum in quadrature of statistical and systematic uncertainties. The dots are located at the mean of the b-jet \pt distribution in each \pt\ bin.
    \cite{Aad:2019aic}
	}
	\label{fig:b_tagging_eff_sf}
\end{figure}