\chapter{Object Definition}

Objects in {\rayshade} are composed of relatively simple {\em primitive}
objects.  These primitives may be used by themselves, or they
may be combined to form more complex objects known as {\em aggregates}.
A special family of aggregate objects,
{\em Constructive Solid Geometry} or CSG
objects, are the result of a boolean operations applied to
primitive, aggregate, or CSG objects.

This chapter describes objects from a strictly geometric point of
view.  Later chapters on surfaces, textures, and shading describe
how object appearances are defined.

An {\em instance} is an object that has optionally been transformed
and
textured.  They are the entities that are actually rendered by
{\rayshade}; when you specify that, for example, a textured
sphere is to be rendered, you are said to be instantiating
the textured sphere.
An instance
is specified as a primitive, aggregate, or CSG object that
is followed by optional transformation and texturing information.
Transformations and textures are described in Chapters 7 and 8 respectively.

\section{The World Object}

Writing a {\rayshade} input file is principally
a matter of defining a special aggregate object, the World object,
which is a list of the objects in the scene.  When writing a {\rayshade}
input file, all objects that are instantiated outside of object-definition
blocks are added to the World object; you need not (nor should you)
define the World object explicitly in the input file.

\section{Primitives}

Primitive objects are the building box with which other objects are
created.  Each primitive type has associated with it specialized
methods for
creation,
intersection with a ray,
bounding box calculation,
surface normal calculation,
ray enter/exit classification,
and for the computation 2D texture coordinates termed {\em u-v}
coordinates.
This latter method is often referred to as the {\em inverse mapping}
method.

While most of these methods should be of little concern to you, the
inverse mapping methods
will affect the way in which certain textures are applied to primitives.
Inverse mapping is a matter of computing normalized $u$ and $v$ coordinates
for a given point on the surface of the primitive.  For planar objects,
the $u$ and $v$ coordinates of a point are computed
by linear interpolation based upon the $u$ and $v$ coordinates assigned
to vertices or other known points on the primitive.  For non-planar
objects, $uv$ computation can be considerably more involved.

This section briefly describes each primitive and
the syntax that should be used to create an instance of the primitive.
It also describes the inverse mapping method, if any, for each type.

\begin{defprim}{blob}{{\em thresh st r} \evec{p} [{\em st r} \evec{p} \ldots]}
	Defines a blob with consisting of a threshold equal to {\em thresh},
	and a
	group of one or more metaballs.  Each metaball is defined by
	its position \evec{p}, radius {\em r}, and strength {\em st}.
\end{defprim}
The metaballs affect each other according to a superimposed
density distribution:
\[
F(x,y,z) = \sum_{i=0}^n b_{i}e^{-d_{i}} - T = 0
\]
There is no inverse mapping method for blobs.

\begin{defprim}{box}{\evec{corner1} \evec{corner2}}
	Creates an axis-aligned box
	which has \evec{corner1} and \evec{corner2} as
	opposite corners.
\end{defprim}
Transformations may be applied to the box if a non-axis-aligned instance
is required.  There is no inverse mapping method for boxes.

\begin{defprim}{sphere}{{\em radius} \evec{center}}
	Creates a sphere with the given {\em radius} and centered at the
	given position.
\end{defprim}
Note that ellipsoids may be created by applying the proper scaling
to a sphere.  Inverse mapping on the sphere is accomplished
by computing the longitude and latitude of the point on the sphere,
with the $u$ value corresponding to longitude and $v$ to latitude.
On an untransformed sphere, the $z$ axis defines the poles, and the
$x$ axis intersects the sphere at $u = 0$, $v = 0.5$.  There are
degeneracies at the poles: the south pole contains all points of
latitude 0., the north all points of latitude 1.

\begin{defprim}{torus}{{\em rmajor rminor} \evec{center} \evec{up}}
	Creates a torus centered at \evec{center} by rotating
	a circle with the given minor radius around the center
	point at a distance equal to the major radius.
\end{defprim}
In tori inverse mapping,
the $u$ value is computed using the angle of rotation about the
up vector, and the $v$ value is computing the angle of rotation
around the tube, with $v=0$ occuring on the innermost point of the tube.

\begin{defprim}{triangle}{\evec{p1} \evec{p2} \evec{p3}}
	Creates a triangle with the given vertices.
\end{defprim}

\begin{defprim}{triangle}{\evec{p1} \evec{n1} \evec{p2} \evec{n2}
	\evec{p3} \evec{n3}}
	Creates a Phong-shaded triangle with the given vertices and
	vertex normals.
\end{defprim}
For both Phong- and flat-shaded triangles, the $u$ axis is the
vector from \evec{p1} to \evec{p2}, and the $v$ axis the vector
from \evec{p1} to \evec{p3}.  There is a degeneracy at
\evec{p3}, which contains all points with $v = 1.0$.  This default
mapping may be modified using the {\tt triangleuv} primitive described
below.

\begin{defprim}{triangleuv}{\evec{p1} \evec{n1} \evec{uv1}
  \evec{p2} \evec{n2} \evec{uv2}
  \evec{p3} \evec{n3} \evec{uv3}}
	Creates a Phong-shaded triangle with the given vertices,
	vertex normals.  When performing texturing, the
	{\em uv} given for each vertex are used instead of the
	default values.
\end{defprim}
When computing $uv$ coordinates within the interior of the
triangle, linear interpolation of the coordinates associated with
each triangle vertex is used.

\begin{defprim}{poly}{\evec{p1} \evec{p2} \evec{p3} [\evec{p4} \ldots ]}
	Creates a polygon with the given vertices. The vertices
	should be given in counter-clockwise order as one is
	looking at the ``front'' side of the polygon.  The number of
	vertices in a polygon is limited only by available memory.
\end{defprim}
Inverse mapping for arbitrary polygons is problematical.
{\Rayshade}
punts and equates $u$ with the $x$ coordinate of the point of intersection,
and $v$ with the $y$ coordinate.

\begin{defprim}{heightfield}{{\em file}}
	Creates a height field defined by the altitude data stored
	in the named {\em file}.  The height field is based upon
	perturbations of the unit square in the $z=0$ plane, and is
	rendered as a surface tessellated by right isosceles triangles.
\end{defprim}
See Appendix C for a discussion of the format of a height field file.
Height field inverse mapping is straight-forward:  $u$ is the
$x$ coordinate of the point of intersection, $v$ the $y$ coordinate.

\begin{defprim}{plane}{\evec{point} \evec{normal}}
	Creates a plane that passes through the given point and
	has the specified normal.
\end{defprim}
Inverse mapping on the plane is identical to polygonal inverse mapping.

\begin{defprim}{cylinder}{{\em radius} \evec{bottom} \evec{top}}
	Creates a cylinder that extends from \evec{bottom} to \evec{top}
	and has the indicated {\em radius}.  Cylinders are rendered
	{\em without} endcaps.
\end{defprim}
The cylinder's axis defines the $v$ axis.  The $u$ axis wraps around the
cylinder, with $u=0$ dependent upon the orientation of the cylinder.

\begin{defprim}{cone}{$rad_{bottom}$ \evec{bottom} $rad_{top}$ \evec{top}}
	Creats a (truncated) cone that extends from \evec{bottom} to
	\evec{top}.  The cone will have a radius of $rad_{bottom}$ at
	\evec{bottom} and a radius of $rad_{top}$ at \evec{top}.
	Cones are rendered {\em without} endcaps.
\end{defprim}
Cone inverse mapping is analogous to cylinder mapping.

\begin{defprim}{disc}{{\em radius} \evec{pos} \evec{normal}}
	Creates a disc centered at the given position and with the
	indicated surface normal.
\end{defprim}
Discs are useful for placing
endcaps on cylinders and cones.
Inverse mapping for the disc is based on the computation of the
normalized polar coordinates of the point of intersection.  The
normalized radius
of the point of intersection is assigned to $u$, while the normalized angle
from a reference vector is assigned to $v$.

\section{Aggregate Objects}

An aggregate is a collection of primitives, aggregate, and CSG
objects.  An aggregate, once defined, may be instantiated at will,
which means that
copies that are optionally transformed and textured may be made.
If a scene calls for the presence of many geometrically identical
objects, only one such object need be defined; the one defined object
may then be instantiated many times.

An aggregate is one of several possible types.  These aggregate types
are differentiated by the type of ray/aggregate intersection algorithm
(often termed an {\em acceleration technique} or {\em efficiency scheme})
that is used.

Aggregates are defined by giving a keyword that defines the
type of the aggregate, followed by
a series of object instantiations and
surface definitions, and terminated using the {\tt end} keyword.
If a defined object contains no instantiations, a warning message
is printed.

The most basic type of aggregate, the {\em list}, performs
intersection testing in the simplest possible way:  Each object in the
list is tested for intersection with the ray in turn, and the closest
intersection is returned.

\begin{defkey}{list}{\ldots {\tt end}}
	Create a List object containing those objects instantiated between
	the {\tt list}/{\tt end} pair.
\end{defkey}

The {\em grid} aggregate
divides the region of space it occupies into a number of discrete
box-shaped
voxels.  Each of these voxels contains a list of the objects that
intersect the voxel.  This discretization makes it possible to
restrict the objects
tested for intersection to those that are likely to hit the ray,
and to test
the objects in nearly ``closest-first'' order.

\begin{defkey}{grid}{{\em xvox yvox zvox} \ldots {\tt end}}
	Create a Grid objects composed of {\em xvox} by {\em yvox} by
	{\em zvox} voxels containing those objects
	instantiated between the {\tt grid}/{\tt end} pair.
\end{defkey}
It is usually only worthwhile to ``engrid'' rather large,
complex collections of objects.  Grids also use a great deal more
memory than List objects.

\section {Constructive Solid Geometry}

Constructive Solid Geometry is
the process of building solid objects from other solids.
The three CSG
operators are Union, Intersection, and Difference.  Each operator
acts upon two objects and produces a single object result.
By combining multiple levels of CSG operators, complex
objects can be produced from simple primitives.

The union of two objects results in an
object that encloses the space occupied by the two given objects.
Intersection results in an object that encloses the space where the two
given objects overlap.  Difference is an order dependent operator; it
results in the
first given object minus the space where the second intersected
the first.

\subsection{CSG in {\Rayshade}}

CSG in {\rayshade} will generally operate properly when applied to
conjunction with
on boxes, spheres,
tori, and blobs.
These primitives are by nature consistent, as they all
enclose a portion of space (no hole from the ``inside'' to the
``outside''), have surface normals which point outward (they
are not ``inside-out''), and do not have any extraneous surfaces.

CSG objects may also be constructed from aggregate objects.
These aggregates contain
whatever is listed inside, and may therefore be inconsistent.
For example, an object which contains a single triangle will not
produce correct results in CSG models, because the triangle does not enclose
space.  However, a collection of four triangles which form a pyramid
does enclose space, and if the triangle normals
are oriented correctly,
the CSG operators should work correctly on the pyramid.

CSG objects are specified by surrounding the objects upon
which to operate, as well as any associated surface-binding commands,
by the operator verb on one side and the {\tt end}
keyword on the other:

\begin{defkey}{union}{$<${\em Object}$>$ $<${\em Object}$>$
[$<${\em Object}$>$ \ldots] {\tt end}}
	Specify a new object defined as the union of the
	given objects.
\end{defkey}

\begin{defkey}{difference}{$<${\em Object}$>$ $<${\em Object}$>$
[$<${\em Object}$>$ \ldots] {\tt end}}
	Specify a new object defined as the difference of the
	given objects.
\end{defkey}

\begin{defkey}{intersect}{$<${\em Object}$>$ $<${\em Object}$>$
[$<${\em Object}$>$ \ldots] {\tt end}}
	Specify a new object defined as the intersection of the
	given objects.
\end{defkey}

Note that the current implementation does not support more that two
objects in a CSG list (but it is planned for a future version).

% The following aren simple CSG objects using the four consistent
% primitives:
%
% union box ... difference ...

\subsection{Potential CSG Problems}

A consistent CSG model is one which is made
up of solid objects with no dangling surfaces.  In {\rayshade},
it is quite easy to construct inconsistent models, which will usually
appear incorrect in the final images.
In {\rayshade}, CSG is implemented by maintaining
the tree structure of the CSG operations.  This tree is traversed,
and the operators therein applied, on a per-ray basis.
It is therefore difficult to verify the consistency of
the model ``on the fly.''

One class of CSG problems occur when
surfaces of objects being operated upon
coincide.  For example, when subtracting a box from another box to make a
square cup, the result will be wrong if the tops of the two boxes
coincide.  To correct this, the inner box should be made
slightly taller than the outer box.
A related problem that must be
avoided occurs when two coincident surfaces are assigned
different surface properties.

It may seem that the union operator is unnecessary, since
listing two objects together in an aggregate results
in an image that appears to be the same.
While the result of such a short-cut
may appear the same on the exterior, the interior
of the resulting object will contain
extraneous surfaces.
The following examples show this quite clearly.

\begin{verbatim}
    difference
      box -2 0 -3  2 3 3
      union  /* change to list; note bad internal surfaces */
        sphere 2 1 0 0
        sphere 2 -1 0 0
      end
    end rotate 1 0 0 -40  rotate 0 0 1 50
\end{verbatim}

The visual evidence of an inconsistent CSG object varies depending
upon the operator being used.
When subtracting a consistent object from and
inconsistent one, the resulting object will appear to be
the union of the two objects, but the shading will be incorrect.
It will appear to be inside-out in places, while correct
in other places.  The inside-out sections indicate the areas
where the problems occur.
Such problems are often caused by
polygons with incorrectly specified
normals, or by surfaces that exactly coincide (which
appear as partial ``Swiss cheese'' objects).

The following example illustrates an attempt to subtract a sphere from
a pyramid defined using an incorrectly facing triangle.  Note
that the resulting image obviously points to which triangle is
reversed.

\begin{verbatim}
    name pyramid list
        triangle 1 0 0  0 1 0  0 0 1
        triangle 1 0 0  0 0 0  0 1 0
        triangle 0 1 0  0 0 0  0 0 1
        triangle 0 0 1  1 0 0  0 0 0  /* wrong order */
    end

    difference
        object pyramid scale 3 3 3 rotate 0 0 1 45
            rotate 1 0 0 -30 translate 0 -3.5 0
        sphere 2.4 0 0 0
    end
\end{verbatim}

By default, cylinders and cones do not have end caps, and thus
are not consistent primitives.  One must usually
add endcaps by listing the
cylinder or cone with (correctly-oriented) endcap discs in an aggregate.

\section {Named Objects}

A name may be associated with any primitive, aggregate, or CSG
object through the use of the {\tt name}
keyword:

\begin{defkey}{name}{{\em objname} $<${\em Instance\/}$>$}
	Associate {\em objname} with the given object.  The
	specified object is not actually instantiated; it
	is only stored under the given name.
\end{defkey}

An object thus named may then be instantiated (with possible
additional transforming and texturing) via the {\tt object} keyword:

\begin{defkey}{object}{{\em objname} [$<$Transformations$>$] [$<$Textures$>$]}
	Instantiate a copy of the object associated with {\em objname}.
	If given, the transformations and textures are composed
	with any already associated with
	the object being instantiated.
\end{defkey}


\documentclass[10pt,tgadventor, onlymath]{beamer}

\usepackage{graphicx,amsmath,amssymb,tikz,psfrag,neuralnetwork, stackengine,array, multirow, fontawesome}

\input defs.tex
\graphicspath{ {./figures/} }

%% formatting

\mode<presentation>
{
\usetheme{default}
\usecolortheme{seahorse}
}
\setbeamertemplate{navigation symbols}{}
\usecolortheme[rgb={0.03,0.28,0.59}]{structure}
\setbeamertemplate{itemize subitem}{--}
\setbeamertemplate{frametitle} {
	\begin{center}
	  {\large\bf \insertframetitle}
	\end{center}
}

\AtBeginSection[]
{
	\begin{frame}<beamer>
		\tableofcontents[currentsection,currentsubsection]
	\end{frame}
}

\usetikzlibrary{shapes,arrows}
\usetikzlibrary{positioning}
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
    text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']

%% begin presentation

\title{\large \bfseries Power Allocation in Heterogeneous Networks for Base Stations with Multiple Antennas}

\author{Peter Hartig \\ \and Supervisor: Prof. Laura  Cottatellucci
}

\date{\today}

\begin{document}

\frame{
\thispagestyle{empty}
\titlepage
}

\section{System Description}
\begin{frame}
\frametitle{The Heterogeneous Network}
	\includegraphics[width=\textwidth]{het_net}
\end{frame}

\begin{frame}
\frametitle{The Heterogeneous Network Game}
\begin{columns}

\begin{column}{0.5\linewidth}
	\includegraphics[width=\textwidth]{het_net}

\end{column}
\begin{column}{0.5\linewidth}
\begin{table}
    \setlength{\extrarowheight}{2pt}
    \begin{tabular}{cc|c|c|}
      & \multicolumn{1}{c}{} & \multicolumn{2}{c}{Player $2$}\\
      & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$A$}  & \multicolumn{1}{c}{$B$} \\\cline{3-4}
      \multirow{2}*{Player $1$}  & $A$ & $(8,8)$ & $(2,15)$ \\\cline{3-4}
      & $B$ & $(15,2)$ & $(3,3)$ \\\cline{3-4}
    \end{tabular}
  \end{table}
\end{column}
\end{columns}
\bigskip
\begin{itemize}
\item
	Players $=$ Femto Cell Base Stations (FCBS)
\item
	Player Strategy $=$ FCBS Transmission Scheme
\end{itemize}

\end{frame}

%\begin{frame}
%\frametitle{The Heterogeneous Network Game}
%\begin{table}
%    \setlength{\extrarowheight}{2pt}
%    \begin{tabular}{cc|c|c|}
%      & \multicolumn{1}{c}{} & \multicolumn{2}{c}{Player $2$}\\
%      & \multicolumn{1}{c}{} & \multicolumn{1}{c}{$A$}  & \multicolumn{1}{c}{$B$} \\\cline{3-4}
%      \multirow{2}*{Player $1$}  & $A$ & $(8,8)$ & $(2,15)$ \\\cline{3-4}
%      & $B$ & $(15,2)$ & $(3,3)$ \\\cline{3-4}
%    \end{tabular}
%  \end{table}
%\bigskip
%\begin{itemize}
%\item
%	Players $=$ Femto Cell Base Stations (FCBS)
%\item
%	Player Strategy $=$ FCBS Transmission Scheme
%\end{itemize}
%
%\end{frame}

\section{Project Goals}

\begin{frame}
\frametitle{Objectives}
\begin{enumerate}
\setlength\itemsep{2em}

\item Find a Nash Equilibrium between all players.
\begin{itemize}
\item Preferably a "social optimal" Nash Equilibrium.
\end{itemize}
\item Minimize resources required to reach Nash Equilibrium.
\end{enumerate}
%\pause
\begin{center}
%\begin{tikzpicture}{center}
%\node [block] (game) {Game with Many Players};
%\node [block, right = of game] (central) {Central Problem};
%\node [block, right = of central] (distributed) {Distributed Solution to Central Problem};
%
%\path[line] (game) -- (central);
%\path[line] (central) -- (distributed);
%
%\end{tikzpicture}
		\includegraphics[scale=.2]{het_net}

\end{center}

\end{frame}

\section{Key Tools}

\begin{frame}
\frametitle{Key Tools: The Normalized Nash Equilibrium}
A Nash equilibrium in which the dual variables (prices) corresponding to constraints are equal up to a constant.
\begin{equation}
\lambda_f = \frac{\lambda_{0}}{ r_f}, \; \forall \; [r_0 \cdots r_F] > 0
\end{equation}
Choosing $r_f =1$, all players must pay the same "price" to change their strategy.
\end{frame}

\begin{frame}
\frametitle{Key Tools: N-Person Concave Games}
Conditions
\begin{itemize}
\item All player utility functions must be concave with respect to their own strategy.
\item The set of strategies for the \emph{entire} game is convex.
\end{itemize}
\bigskip
Implications
\begin{itemize}
\item Immediately proves existence of a \emph{pure strategy} Nash Equilibrium.
\item Provides an additional sufficient condition for uniqueness of Nash Equilibrium (diagonally strict concavity).
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Key Tools: Potential Games}
\begin{enumerate}
\item
Potential Games
\begin{itemize}
\item "Central" optimization function $\Psi(\mathbf{s})$ with
\end{itemize}
\begin{equation}\label{potential_game_condition}
\frac{\partial \Psi(\mathbf{s})}{\partial \mathbf{s}_{f}}
 =
 \frac{\partial U_f(\mathbf{s})}{\partial \mathbf{s}_{f}}.
\end{equation}
\item
When all utility functions are concave, the optimum of the potential function corresponds to a Nash Equilibrium.
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{Key Tools: Distributed Optimization}
Some optimization problems may be decomposed into "sub-problems".
\begin{equation}
f(x) = \sum_{i = 1}^{F} f_{i}(x_{i})
\end{equation}
Decomposing the corresponding Lagrangian gives
\begin{equation}
L(x,y) = \sum_{i = 1}^{F} L_i(x_i,y)
\end{equation}
allows for dual ascent with distributed updates.
\end{frame}
%

\section{System Model}
\begin{frame}
\frametitle{System Model: Femto Base Stations}
Each FCBS is a player in the game and is characterized by:
\\
\begin{itemize}
\setlength\itemsep{2em}

\item
	$T_{f}$ antennas to transmit to $K_{f}$ femtocell users ($T_{f} \geq K_{f}$).
\item
	The transmitted
	signal is $\mathbf{s}_{f
	}= \mathbf{U}_{f}\mathbf{x}_{f}$ with $E[\mathbf{x}_{f}\mathbf{x}_{f}^H] = \mathbf{I}$.
\item
	An average power constraint $E\{trace(\mathbf{U}_{f}^H\mathbf{U}_{f})\} \leq P^{Total}_{f} $.
\item
	A utility function $U_{f}(\boldsymbol{\gamma}_{f}) =
	\sum_{i=1}^{K_{f}}
    	 U_{f,i}(\gamma_{f,i}) $
    	with non-decreasing function $U_{f,i}(\cdot)$.
\end{itemize}
\end{frame}

%\begin{frame}
%\frametitle{System Model: FCBS Users}
%User $i$ of FBS $f$ has signal to interference plus noise ratio (SINR)
%	\begin{equation*}
%	\gamma_{f,i} = \frac{\|\mathbf{h}^H_{f,i}\mathbf{u}_{f,i}\|^2}
%	{\sigma^2_{\text{noise}}   +
%	\underbrace{
%	 \sum_{\tilde{f}=1, \tilde{f}\neq f}^{f} \sum_{u=1}^{K_{\tilde{f}}}
%	\|\mathbf{h}^H_{\tilde{f},u}\mathbf{u}_{\tilde{f},i}\|^2}_{\mathrm{inter-cell}}
%	 +
%	 \underbrace{
%	 \sum_{\tilde{k}=1, \tilde{k}\neq i}^{K_f}
%	 \|\mathbf{h}^H_{f,\tilde{k}}\mathbf{u}_{f,\tilde{k}}\|^2}_{\mathrm{intra-cell}}},
%	  \; i \in \{1 ... K_f\}
%	  \end{equation*}
%\end{frame}

\begin{frame}
\frametitle{System Model: Macro Users}
	Received interference constraint given by
	\begin{equation}
	E\{\sum^F_{f=1} \mathbf{\tilde{h}}_{m,f}^T  \mathbf{U}_{f}
	\mathbf{U}_{f}^{H} \mathbf{\tilde{h}}_{m,f}^*\} \leq I^{Threshold}
	_{m}
	\end{equation}
	\bigskip
	\centering
		\includegraphics[scale=.2]{het_net}
\end{frame}

\begin{frame}
\frametitle{System Model: General}
\begin{itemize}
\setlength\itemsep{2em}

\item
	No inter-femto cell interference
\item
	FCBS have knowledge of channel state information
	\begin{itemize}
	\item
	The downlink channel matrix $\mathbf{H}_f \in \mathbb{C}_{K_{f} \times T_{f}} $ to its $K_{f} $ users.

	\end{itemize}
\end{itemize}
	\bigskip
	\centering
		\includegraphics[scale=.2]{het_net}
\end{frame}

\section{General Setup}

\begin{frame}

\frametitle{General Problem Formulation}
\begin{enumerate}
\setlength\itemsep{2em}

\item  Player $f$ has trasnmitted signal $\mathbf{s}_{f
	}= \mathbf{U}_{f}\mathbf{x}_{f}$ with strategy $\mathbf{U}_f$.
\begin{itemize}
\item $\mathbf{U}_f$ has an implied power allocation
\end{itemize}
%\item Simplify by selecting $\mathbf{U}_f$ as a pseudo inverse of $\mathbf{H}_f$  (i.e $\mathbf{H}_f\mathbf{U}_f = \mathbf{I}$) such that
%	\begin{equation*}
%	\gamma_{f,i} = \frac{\|\mathbf{h}^H_{f,i}\mathbf{u}_{f,i}\|^2}
%	{\sigma^2_{\text{noise}}}
%	\end{equation*}
%	with
%	\begin{equation*}
%	U_{f}(\boldsymbol{\gamma}_{f}) =
%	\sum_{i=1}^{K_{f}}
%    	 U_{f,i}(\gamma_{f,i}) .
%	\end{equation*}
\pause
Does the problem admit the N-Person Concave game Framework?

\item  Set of strategies is convex. \faThumbsOUp
\pause
\item  $U_{f}(\boldsymbol{\gamma}_{f})$ is concave only when $U_{f,i}(\gamma_{f,i})$ is concave and non-increasing.
\faThumbsODown
\end{enumerate}
\end{frame}

\section{Convex Setup}

\begin{frame}
\frametitle{Convex Problem Formulation}
\begin{enumerate}
\setlength\itemsep{2em}
\item Pre-select $\mathbf{U}_f$ to be a psuedo inverse of $\mathbf{H}_f$  (i.e $\mathbf{H}_\mathrm{f}\mathbf{U}_\mathrm{f} = \mathbf{I}$).
\item
	Normalize the columns of $\mathbf{U}_{f}$ such that
	 $\|\mathbf{u}_{f,i}\|^2 =1 \;\forall i \in \{1 ... K_{f}\}$.
\item
	Player $f$ strategy is now the diagonal, power allocation
	matrix $\mathrm{diag}(\mathbf{p}_{f})$ with $p_{f,i} \geq 0, \forall i \in \{1 ... K_{f}\}$
such that the transmitted
	signal is
	$\mathbf{s}_{f	}= \mathbf{U}_{f}
	\mathrm{diag}(\mathbf{p}_{f})^{\frac{1}{2}}
	\mathbf{x}_{f}$.
\item
	Power constraint given by
	\begin{gather*}
	\sum_{i=1}^{K_{f}} p_{f,i}
	  \leq P^{Total}_{f}.
	  	\end{gather*}
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{Problem Analysis}
Does the problem admit the N-Person Concave game Framework?
\\
\begin{enumerate}
\setlength\itemsep{2em}
\item  Set of strategies is convex. \faThumbsOUp
\item  $U_{f}(\boldsymbol{\gamma}_{f})$ is concave if
	$U_{f,i}(\cdot)$ is non-decreasing and concave (reasonable assumption). \faThumbsOUp
\item
	If $U_{f,i}(\cdot)$ is strictly concave, this satisfies conditions for the unique Normalized Nash Equilibrium (diagonally strict concavity) . \faThumbsOUp
\end{enumerate}

\end{frame}

\section{A Solution}
\begin{frame}
\frametitle{Player Optimization Problem}
Each player attempts to solve the optimization problem given by
	\begin{subequations}
	\begin{align}
	    \underset{\mathbf{p}_{f} }{\text{min}} \;
	    & - \sum_{i=1}^{K_f}
    	U_{f,i}(\gamma_{f,i}) \label{player_opt_c} \\
	    \text{subject to  }\\
	  &
	  \sum^F_{f=1} E\{ \mathbf{\tilde{h}}_{m,f}^T  \mathbf{s}_{f}
	\mathbf{s}_{f}^{H} \mathbf{\tilde{h}}_{m,f}^* \}
	\leq I^{Threshold}
	_{m} & m \in \{1 ...m\}
		\label{interference_const_c}\\
        &
        	\sum_{i=1}^{K_{f}} p_{f,i}
	   \leq P_{f}^{\text{Total}}  \label{power_const_c}\\
        & p_{f,i} \geq 0 &  i\in \{1 ...K_{f}\} \label{pos_power_const_c}
	\end{align}
	\end{subequations}

Note that $\mathbf{U}_{f}$ is pre-selected as a pseudo-inverse to  $\mathbf{H}_f$.
\end{frame}

\begin{frame}
\frametitle{Steps Outline}
\begin{enumerate}
\setlength\itemsep{2em}

\item
	Form Potential Function.
\item
	Setup distributed algorithm.
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{The Potential Function}
Things to note
\begin{enumerate}
\item
	Spacing assumption makes $U_{f}(\boldsymbol{\gamma}_{f})$ independent of all other player strategies.

\item
	The sum of concave functions over a convex set is also concave. Does this satisfy the potential function condition?
	\begin{equation*}\label{potential_game_condition}
\frac{\partial \Psi(\boldsymbol{\gamma})}{\partial \boldsymbol{\gamma}_{f}}
 =
 \frac{\partial U_f(\boldsymbol{\gamma})}{\partial \boldsymbol{\gamma}_{f}}
\end{equation*}
Yes!
\end{enumerate}

\end{frame}

\begin{frame}
\frametitle{Solving for a NNE}
\begin{enumerate}
\setlength\itemsep{2em}

\item
	The potential function of a game with strictly concave utility functions has optimum corresponding to NNE.
\item
	Satisfying the Diagonally Strict Concavity conditions means the NNE is unique.
\end{enumerate}
\bigskip
Just need to solve for the unique optimum of a convex problem.
\pause
\par
 Can the problem be distributed?
\end{frame}

\begin{frame}
\frametitle{Distributed Dual Ascent}
For $U_{f,i}(\gamma_{f,i}) = log(1+\gamma_{f,i})$ and potential function
\begin{gather*} \label{Potential_Function}
\Psi(\mathbf{p}) = \sum_{f = 1}^{F} U_{f}(\mathbf{p}_{f}).
\end{gather*}
We arrive at a central, convex optimization problem given by
		\begin{subequations}
	\label{optim}
	\begin{align}
	    \underset{\mathbf{p}}{\text{minimize  }}
	    & \; \Psi(\mathbf{p}) \label{potential_game} \\
	    \text{subject to  } \; &
	  \sum^F_{f=1} E\{\tilde{\mathbf{h}}_{m,f}^T  \mathbf{s}_{f}
	\mathbf{s}_{f}^{H} \tilde{\mathbf{h}}_{m,f}^* \}\leq I^{Threshold}
	_{m} & m \in \{1 ...m\}
		\label{interference_const}\\
        & E\{trace(\mathbf{s}_f\mathbf{s}_f^H)\}  \leq P_{f}^{\text{Total}}  \label{power_const}
        & \forall f \in \{1 ... f\}\\
        & p_{f,i} \geq 0 &  \forall i \in \{1 ...K_{f}\} \; \forall f \in \{1 ... F\}\label{pos_power_const}
	\end{align}
	\end{subequations}
\end{frame}

\section{Simulation Results}

\begin{frame}
\frametitle{Expected Results}
\begin{enumerate}
\setlength\itemsep{2em}

\item
	Power not limiting, at least one interference constraint should be active.
\item
	Power not limiting, increasing the number of antennas at the base stations should allow for higher utility.
\item
	The choice of the psuedoinverse, $\mathbf{U}_{f}$, should be further optimized.
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{Multiple Antennas with Constant Power}
\begin{figure}
	\includegraphics[width=\textwidth]{results/central_antenna}
	\caption{With $K_f = 5$ (users), increasing antennas allows players with constant power to increase utility.}
\end{figure}
\end{frame}

\begin{frame}
\frametitle{Increasing Power at FCBS}
\begin{figure}
	\includegraphics[width=\textwidth]{results/central_power}
	\caption{For $K_f = 5$ and $T_f = 15$, increasing FCBS power constraint is limited by interference.}
\end{figure}
\end{frame}

\begin{frame}
\frametitle{Selecting the Beamformer}
\begin{figure}
	\includegraphics[width=\textwidth]{results/central_beamformer}
\caption{With $K_f = 5$ (users) and $T_f = 10$ (antennas), choice of $\mathbf{U}_{f}$ may depend on the active system constraints.}
\end{figure}
\end{frame}

\section{Conclusion}
\begin{frame}
\frametitle{Continuing Work}
\begin{enumerate}
\item
	Implement distributed version.
\item
	Improve choice of beamformer using additional DOF.
\item
	Consider "fairness" with respect to FCBS utility.
\end{enumerate}
\end{frame}

\begin{frame}
  \centering \Large
  \emph{Thank You.}
  \\
	\bigskip
    \centering \Large
  \emph{Questions or Comments?}
\end{frame}

\end{document}


% !TeX root = ../../python-snippets.tex

\section{Search Algorithms}

This section contains implementations of certain search algorithms.

\subsection{Binary Search}

The binary search algortihm is a search algorithm, that finds the position of a target value within a sorted array.
It compares the target value to the middle element of the array.
If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found.

\lstinputlisting[caption=binary\_search.py]{../standard_lib/binary_search.py}


%!TEX root = ../thesis.tex
%*******************************************************************************
%*********************************** Fourth Chapter *****************************
%*******************************************************************************

\chapter{Lattice Configurations and the Gluon Propagator}\label{chapter:GluonPropagator}
\ifpdf
    \graphicspath{{Chapter4/Figs/Raster/}{Chapter4/Figs/PDF/}{Chapter4/Figs/}}
\else
    \graphicspath{{Chapter4/Figs/Vector/}{Chapter4/Figs/}}
\fi

Now that we have developed the required background understanding of lattice QCD and the topological objects of interest to this research, we can explain how our calculations are performed. This chapter will first describe how we calculate the Landau gauge gluon propagator on the lattice. This is the primary quantity of interest for the first part of the original research, and as such we will explicitly detail its calculation.  We will then motivate our choice of momentum variables, before proceeding to a description of the renormalisation scheme we employ. Finally, we will present the lattice parameters and data cuts utilised in this work.

\section{Lattice Definition of the Gluon Propagator}
In a gauge field theory the position-space propagator, $D_{\mu\nu}(x,y)$, of the gauge boson is the two-point correlation function. In the case of perturbative QCD this can be interpreted as the probability amplitude of a gluon being created at the space-time point $x$, propagating to $y$, and then being annihilated. The propagator therefore serves as a useful measure of the behaviour of gluons as a function of distance; or, correspondingly, as a function of momentum in the momentum-space representation. In this section we detail how the non-perturbative momentum-space Landau gauge gluon propagator is calculated on the lattice. We begin with the definition of the coordinate-space propagator as a two-point correlator~\cite{Zwanziger:1991gz,Cucchieri:1999sz,Langfeld:2001cz}.
\begin{equation}
D^{ab}_{\mu\nu}(x) = \langle A^a_\mu(x) \, A^b_\nu(0)\rangle.
\label{eq:coordGluonProp}
\end{equation}
The propagator in momentum space is simply related by the discrete Fourier transform,
\begin{equation}
D^{ab}_{\mu\nu}(p) = \sum_x e^{-ip\cdot x} \langle A^a_\mu(x) \, A^b_\nu(0) \rangle.
\end{equation}
Noting that the coordinate space propagator $D^{ab}_{\mu\nu}(x-y)$ only depends on the difference $x-y,$ such that
\begin{equation}
\langle A^a_\mu(x) \, A^b_\nu(0)\rangle = \langle A^a_\mu(x+y) \, A^b_\nu(y)\rangle\, ,
\end{equation}
we can make use of translational invariance to average over the four-dimensional volume to obtain the form for the momentum space propagator.
\begin{align}
D^{ab}_{\mu\nu}(p) &= \frac{1}{V}\sum_{x,y} e^{-ip\cdot x}\langle A^a_\mu(x+y) \, A^b_\nu(y) \rangle \nonumber \\
                &= \frac{1}{V}\sum_{x,y} \langle e^{-ip\cdot (x+y)} A^a_\mu(x+y) \, e^{+ip\cdot y}A^b_\nu(y) \rangle \nonumber \\
                &= \frac{1}{V}\langle A^a_\mu(p) \, A^b_\nu(-p) \rangle. \label{eq:gluPropxtop}
\end{align}

Hence we find that the momentum space gluon propagator on a finite lattice with four-dimensional volume $V$ is given by
%
\begin{equation}
D_{\mu\nu}^{ab}(p) \equiv \frac{1}{V}\left \langle A^a_\mu (p)\,A^b_\nu(-p)\right\rangle \, . \label{eq:gluonProp}
\end{equation}
%
In the continuum, the Landau-gauge momentum-space gluon propagator has the following form~\cite{Leinweber:1998im,Bonnet:2001uh}
%
\begin{equation}
D^{ab}_{\mu\nu}(p) = \left ( \delta_{\mu\nu} - \frac{p_\mu p_\nu}{p^2} \right )\,\delta^{ab}\,D(p^2) \, ,
\end{equation}
%
where $D(p^2)$ is the scalar gluon propagator.  Contracting Gell-Mann index $b$ with $a$ and
Lorentz index $\nu$ with $\mu$ one has
%
\begin{equation}
D^{aa}_{\mu\mu}(p) = (4-1)\,(n_c^2-1)\,D(p^2) \, ,
\end{equation}
%
such that the scalar function can be obtained from the gluon propagator via
%
\begin{equation}
D(p^2) = \frac{1}{3(n_c^2-1)}\,D^{aa}_{\mu\mu}(p) \, ,
\label{eq:scalarProp}
\end{equation}
%
where $n_c = 3$ is the number of colours.

As the lattice gauge links $U_\mu(x)$ naturally reside in the $3\times 3$ fundamental representation of $SU(3),$ we now wish to work in the matrix representation of $A_\mu(x)$, as introduced in Eq.~\eqref{eq:CovariantDerivative}. Using the orthogonality relation $\Tr(\lambda_a\lambda_b) = 2\delta_{ab}$ for the Gell-Mann matrices, it is straightforward to see that
%
\begin{equation}
2\Tr(A_\mu\,A_\mu) = A^a_\mu A^a_\mu\, ,
\end{equation}
%
which can be substituted into Eq.~\eqref{eq:scalarProp} to obtain the final expression for the lattice scalar gluon propagator,
%
\begin{equation}
D(p^2) = \frac{2}{3\,(n_c^2-1)\,V}\big\langle {\rm Tr}\, A_\mu(p)\,A_\mu(-p) \big\rangle \,. \label{eq:scalarProp2}
\end{equation}

To calculate Eq.~\eqref{eq:scalarProp2} on the lattice, we need to define $A_\mu(p)$. As defined in Eq.~\eqref{eq:GaugePotentialLat}, we make use of the midpoint definition of the coordinate-space gauge potential in terms of the lattice link variables such that
%
\begin{equation}
A_\mu\left(x+\frac{a}{2}\hat{\mu}\right) = \frac{i}{2ag}\left(U_\mu(x) - U_\mu^\dag(x)\right) - \frac{i}{6ag}\Tr\left(U_\mu(x) - U_\mu^\dag(x)\right)I + \mathcal{O}(a^2)\, .
\end{equation}
%
Once the link variables are fixed to Landau gauge following the procedure described in Sec.~\ref{sec:LandauGauge}, we can obtain the momentum-space gauge potential by performing a Fourier transform,
%
\begin{equation}
A_\mu(p) = \sum_x e^{-ip\cdot(x+\hat{\mu}/2)}\, A_\mu(x+\hat{\mu}/2)\, .
\end{equation}
%
We have now constructed a workable lattice definition to calculate the Landau gauge scalar gluon propagator within the lattice framework established in Chapter \ref{chapter:LatticeQCD}.

\section{Momentum Variables}\label{sec:MomentumVariables}
As discussed in Sec.~\ref{sec:Confinement}, it is understood that at high energies QCD is asymptotically free. With this understanding, we expect that at high momentum the Landau gauge gluon propagator will tend towards the Landau gauge photon propagator~\cite{ryder1996quantum}
%
\begin{equation}
D_\gamma(p^2) = \frac{1}{p^2}\, .
\end{equation}
%
However, lattice discretisation errors cause a deviation from this idealised behaviour that we would like to systematically account for. To do this, we follow the work of Refs.~\cite{Weisz:1982zw, Weisz:1983bn,Luscher:1985zq,Symanzik:1983dc,Symanzik:1983gh}. As we are considering the propagator at high momenta, it is sufficient to consider the behaviour of the photon propagator on the lattice. We therefore consider for this section only an Abelian theory. The commutator in the field strength tensor then vanishes, simplifying to
%
\begin{equation}
F_{\mu\nu} = \partial_\mu \,A_\nu - \partial_\nu\,A_\mu
\end{equation}
%
We consider this Abelian field to be on a lattice generated using the Wilson action (see Eq.~\eqref{eq:WilsonAction}). From Eq.~\eqref{eq:FieldStrengthPlaquette} we know that the Wilson action can be written as $\mathcal{S}_\text{W} = a^4\frac{1}{2}\sum_x F_{\mu\nu}F^{\mu\nu} + \mathcal{O}(a^4)$. As we are interested in the momentum-space propagator, we write the field strength tensor at the plaquette midpoint $\tilde{x}$ as
%
\begin{align}
F_{\mu\nu}(\tilde{x}) &= \frac{A_\nu\left(\tilde{x}+a\frac{\hat{\mu}}{2}\right) - A_\nu\left(\tilde{x}-a\frac{\hat{\mu}}{2} \right)}{a} - \frac{A_\mu\left(\tilde{x}+a\frac{\hat{\nu}}{2}\right) - A_\mu\left(\tilde{x}-a\frac{\hat{\nu}}{2} \right)}{a}\nonumber\\
&= \frac{1}{a} \sum_p e^{ip\cdot\tilde{x}} \left(\tilde{A}_\nu(p)\, e^{-iap\frac{\hat{\mu}}{2}} - \tilde{A}_\nu(p)\, e^{iap\frac{\hat{\mu}}{2}} - \tilde{A}_\mu(p)\, e^{-iap\frac{\hat{\nu}}{2}} + \tilde{A}_\mu(p)\, e^{iap\frac{\hat{\nu}}{2}}\right)\nonumber\\
&= -\frac{1}{a} \sum_p e^{ip\cdot\tilde{x}}\left(2i\sin\left(\frac{a p_\mu}{2}\right)\tilde{A}_\nu(p) - 2i\sin\left(\frac{a p_\nu}{2}\right)\tilde{A}_\mu(p)\right)\nonumber\\
&= - \sum_p e^{ip\cdot\tilde{x}}\tilde{f}_{\mu\nu}(p)\, ,
\end{align}
%
where
%
\begin{equation}
\tilde{f}_{\mu\nu}(p) = i\left(\hat{k}_\mu \tilde{A}_\nu(p) - \hat{k}_\nu \tilde{A}_\mu(p)\right)\, ,~\hat{k}_\mu = \frac{2}{a}\sin\left(\frac{ap_\mu}{2}\right)\, .
\end{equation}
%
The Wilson action can therefore be written as
%
\begin{align}
\mathcal{S}_\text{W} &= a^4\frac{1}{2}\sum_{\tilde{x}}\sum_{p,\,p^\prime}e^{i\tilde{x}(p+p^\prime)}\tilde{f}_{\mu\nu}(p) \, \tilde{f}^{\mu\nu}(p^\prime)\nonumber\\
&=a^4\frac{1}{2}\sum_{p,\,p^\prime} \delta(p+p^\prime)\tilde{f}_{\mu\nu}(p) \, \tilde{f}^{\mu\nu}(p^\prime) \nonumber\\
&= a^4\frac{1}{2}\sum_{p}\tilde{f}_{\mu\nu}(p) \, \tilde{f}^{\mu\nu}(-p) + \mathcal{O}(a^4)\, . \label{eq:WilsonMomentum}
\end{align}
%
We are now in a position to consider the propagator. Equivalent to the two-point correlator definition, the propagator is also the Green's function of the equations of motion, $M_{\mu\nu}$, satisfying
%
\begin{equation}
M_{\mu\nu}D^{\nu\lambda}(p) = \delta_\mu^\lambda\, .
\end{equation}
%
In the continuum, we can write the Abelian Lagrangian density in terms of momentum space variables as
%
\begin{align}
\mathcal{L} &= \frac{1}{2}\tilde{F}_{\mu\nu}\,\tilde{F}^{\mu\nu}\nonumber\\
&= \frac{1}{2}(p_\mu\,\tilde{A}_\nu - p_\nu\,\tilde{A}_\mu)\,(p^\mu\,\tilde{A}^\nu - p^\nu\,\tilde{A}^\mu)\nonumber\\
&= (p^2\delta_{\mu\nu} - p_\mu\,p_\nu)\tilde{A}^\mu\,\tilde{A}^\nu\, ,
\end{align}
%
and hence
%
\begin{equation}
M_{\mu\nu} = (p^2\delta_{\mu\nu} - p_\mu\,p_\nu)\, .
\label{eq:ContEquationsOfMotion}
\end{equation}
%
However, it is understood that in the continuum the equations of motion are not invertible unless an additional gauge fixing term is added, with a gauge fixing parameter $\alpha$. Hence, the equations of motion for the photon field in momentum space are given by Eq.~\eqref{eq:ContEquationsOfMotion} with an additional gauge fixing term~\cite{ryder1996quantum}
%
\begin{equation}
M_{\mu\nu} = p^2\delta_{\mu\nu} - \left(1-\frac{1}{\alpha}\right)p_\mu p_\nu\, .
\end{equation}
%
By inspection, we see that Eq.~\eqref{eq:WilsonMomentum} for the lattice Wilson action will have the same equations of motion, with the substitution $p_\mu\rightarrow \hat{k}_\mu$. In turn, this gives the propagator
%
\begin{equation}
D_{\mu\nu}(p) = \frac{1}{\hat{k}^2}\left[\delta_{\mu\nu} + (\alpha-1)\frac{\hat{k}_\mu \hat{k}_\nu}{\hat{k}^2}\right]\, .
\end{equation}
Landau gauge corresponds to setting $\alpha=0$, so we find that
%
\begin{equation}
D_{\mu\mu}(p) = \frac{3}{\hat{k}^2}\, ,
\end{equation}
%
and therefore by comparison with Eq.~\eqref{eq:scalarProp} we see that
%
\begin{equation}
D(p^2) = \frac{1}{\hat{k}^2}\, .
\end{equation}
%
This suggests that for the Wilson action we should make the substitution $p_\mu\rightarrow \hat{k}_\mu = \frac{2}{a}\sin\left(a p_\mu/2\right)$ so that at tree-level we observe the expected behaviour of the gluon propagator.\\

A similar analysis can be performed for the L\"uscher-Weisz action used in this work, taking into account the contributions from the rectangle terms. The L\"uscher-Weisz action written in the same form as Eq.~\eqref{eq:WilsonMomentum} is~\cite{Weisz:1982zw}
%
\begin{equation}
\mathcal{L}_\text{LW} = a^4\frac{1}{2}\sum_p \left(1+\frac{1}{12}a^2\hat{k}^2\right) \tilde{f}_{\mu\nu}(p) \, \tilde{f}^{\mu\nu}(-p) + \mathcal{O}(a^6)\, .
\end{equation}
%
The equations of motion then become
%
\begin{equation}
M_{\mu\nu} = \left(\hat{k}^2 + \frac{1}{12}a^2\hat{k}^4\right)\delta_{\mu\nu} - \left(1-\frac{1}{\alpha}\right)\left(\sqrt{\hat{k}_\mu^2 + \frac{1}{12}a^2\hat{k}_\mu^4}\right)\left(\sqrt{\hat{k}_\nu^2 + \frac{1}{12}a^2\hat{k}_\nu^4}\right)\, .
\end{equation}
Therefore the propagator is
%
\begin{equation}
D_{\mu\nu}(p) = \frac{1}{q^2}\left[\delta_{\mu\nu} + (\alpha-1)\frac{q_\mu q_\nu}{q^2}\right]\, ,
\end{equation}
with
\begin{equation}
q_\mu = \sqrt{\hat{k}_\mu^2 + \frac{1}{12}a^2\hat{k}_\mu^4} = \frac{2}{a}\sqrt { \sin ^ { 2 } \left( \frac { p _ { \mu } a } { 2 } \right) + \frac { 1 } { 3 } \sin ^ { 4 } \left( \frac { p _ { \mu } a } { 2 } \right) }\, .
\end{equation}
%
In Landau gauge, this tells us that the tree-level form for the scalar propagator is
%
\begin{equation}
D(p^2) = \frac{a^2}{4 \sin ^ { 2 } \left( \frac { p _ { \mu } a } { 2 } \right) + \frac { 1 } { 3 } \sin ^ { 4 } \left( \frac { p _ { \mu } a } { 2 } \right)} = \frac{1}{q^2}\, .
\label{eq:LWCorrection}
\end{equation}\\
Given Eq.~\eqref{eq:LWCorrection}, in this work we make the variable substitution $p_\mu\rightarrow q_\mu$ to ensure that at high momentum the gluon propagator tends towards tree level as required.

\section{Renormalisation}\label{sec:Renormalisation}
Before plotting the propagator, it is essential to discuss the issue of renormalisation. On the lattice, we calculate the bare dimensionless propagator $D_B(q^2,\Lambda)$, as the lattice introduces an explicit regularisation parameter in the form of the momentum cutoff, $\Lambda = \pi/a$. This is related to the renormalised propagator $D_R(q^2,\mu)$ through the relation
%
\begin{equation}
D_B(q^2,\Lambda) = Z_3(\mu, \Lambda)\, D_R(q^2,\mu)\, ,
\label{eq:LatticeRenormalisation}
\end{equation}
%
where $\mu$ is the renormalisation scale. To obtain the renormalisation constant $Z_3(\mu, \Lambda)$, and therefore the renormalised propagator, it is necessary to enforce a renormalisation scheme. Here we employ the momentum space subtraction (MOM) scheme~\cite{Bowman:2004jm,Leinweber:1998uu,Bonnet:2001uh}, which requires that for some sufficiently large $\mu$
%
\begin{equation}
D_R(q^2,\mu)\big|_{q^2=\mu^2}=\frac{1}{\mu^2}\, .
\end{equation}
%
This sets the value of the renormalisation constant to be
%
\begin{equation}
Z_3(\mu,\Lambda) = \, \mu^2 \, D_B(\mu^2,\Lambda)\, ,
\end{equation}
such that
%
\begin{equation}
D_R(q^2,\mu) = \frac{D_B(q^2,\Lambda)}{\mu^2 \, D_B(\mu^2,\Lambda)}\, .
\end{equation}
%
This renormalised propagator is what we plot in e.g. Fig.~\ref{fig:UntouchedPropagator}, and will be denoted as simply $D(q^2)$ hereafter. The value of $\mu$ is arbitrary, however to make contact with perturbation theory it is necessary that it is sufficiently large such that it is outside the infrared region where the gluon propagator exhibits substantial deviation from perturbative behaviour. Furthermore, $\mu$ must be away from the momentum cutoff, as the renormalisation constant is only independent of the cutoff in the limit that the cutoff tends towards infinity~\cite{Bonnet:2001uh,Boucaud:2006pc}.  Once the renormalisation scheme has been imposed, it is then possible to connect the lattice results with those obtained from perturbation theory by connecting the renormalisation constant from the MOM scheme with those obtained from the renormalisation schemes used in perturbation theory.\\

The crux of this argument is that it is the renormalised propagator, not the bare propagator, that carries the physical meaning.  More generally, it is the shape of the propagator that carries meaning, and we are free to impose a scaling constant without changing the physical significance of the result. To facilitate comparisons between vortex-modified ensembles, we make use of the original $Z_3(\mu, \Lambda)$ obtained for the untouched propagator unless specified otherwise. Maintaining this consistency is sufficient to comment on the qualitative shape of the propagator, which is the most significant point of interest in this research.\\

\section{Lattice Parameters and Data Cuts} \label{sec:LatticeParameters}
We calculate the gluon propagator on 100 configurations of a $20^3\times 40$ $SU(3)$ lattice with spacing $a=0.125\,\si{fm}$, as used in Refs.~\cite{Trewartha:2015nna,OMalley:2011aa}. The momentum variables chosen for both the Wilson and L\"uscher-Weisz action have been numerically verified to provide better tree level agreement in Refs.~\cite{Marenzoni:1994ap, Bonnet:2001uh}, and we present a comparison of the L\"uscher-Weisz and uncorrected variables in Fig.~\ref{fig:MomentumComparison}. To visualise this improvement, we plot $k^2\,D(k^2)$ (where $k_\mu=p_\mu,\,q_\mu$ is the momentum variable for the given case under consideration) such that the tree-level propagator appears as $k^2\,D(k^2)=1$, shown as the black dashed line. This choice of plotting $k^2\,D(k^2)$ against $ka$ has the benefit of aiding both the visualisation of the tree-level behaviour, and the onset of the non-perturbative infrared properties of the propagator. Via the method described in the previous section, we have renormalised the L\"uscher-Weisz corrected propagator such that $q^2\,D(q^2) = 1$ at $qa=6.0$, and applied this same renormalisation constant to the uncorrected propagator. While this choice of renormalisation point is near the cutoff, it provides a renormalised propagator that approaches tree-level from above. In subsequent sections we will select renormalisation points further away from the cutoff.\\

We can clearly see that at high momenta the corrected gluon propagator tends towards the expected tree-level behaviour, whereas the uncorrected propagator fans out considerably. This fanning is the result of asymmetry between the spatial and temporal components of the propagator, which is accounted for in the tree-level correction~\cite{Marenzoni:1994ap}. The results presented in Fig.~\ref{fig:MomentumComparison} clearly motivate the need for tree-level correction when calculating the gluon propagator on the lattice.\\
%
\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{./ScalarGluComp_q2_MomentumComparison.pdf}
\caption[The renormalised scalar gluon propagator is plotted with no tree-level momentum correction and the L\"uscher-Weisz correction.]{\label{fig:MomentumComparison} The scalar gluon propagator is plotted with no tree-level momentum correction (blue crosses) and the L\"uscher-Weisz correction (red dots) presented in Eq.~\eqref{eq:LWCorrection}. It is clear that the corrected momentum has improved tree-level behaviour, free from the fanning effect present in the uncorrected case.}
\end{figure}
%

When considering the gluon propagator we shall maintain the plotting convention introduced in Fig.~\ref{fig:MomentumComparison} of considering $q^2D(q^2)$ against $qa$ for the remainder of this work. To improve the momentum-corrected propagator presented in  Fig.~\ref{fig:MomentumComparison} we follow the procedure of Ref.~\cite{Bonnet:2001uh,Leinweber:1998im} and perform a momentum half-cut. The momentum half-cut corresponds to only considering lattice momenta in the range
%
\begin{equation}
p_\mu = \frac{2\pi n_\mu}{a N_\mu},~n_\mu\in \left(-\frac{N_\mu}{4},\,\frac{N_\mu}{4}\right]\, .
\end{equation}
%
This cut limits the positive range of the kinematically corrected $q_\mu$ to
%
\begin{equation}
q_\mu \in \left[0,\, \frac{2\sqrt{21}}{3a}\right]\approx\left[0,\frac{3.06}{a} \right]\, .
\end{equation}
%
Furthermore, a cylinder cut of radius $pa=2$ lattice units is performed, such that we only consider points within two lattice units of the diagonal. This cut is implemented by considering points satisfying
%
\begin{equation}
|pa|^2\, \sin(\theta_c) \leq 2\, ,
\end{equation}
%
where
%
\begin{equation}
\theta_c = \cos^{-1}\left(\frac{pa \cdot \hat{n}}{|pa|}\right)\, ,
\end{equation}
%
and $\hat{n} = \frac{1}{2}(1,\,1,\,1,\,1)$ is the unit vector along the diagonal. This is performed so that all directions are equally sampled, whilst omitting points where one direction dominates the signal. This reduces the impact of lattice cutoff artefacts. Finally, we can take advantage of the rotational symmetry of the scalar propagator to perform $Z(3)$ averaging over the Cartesian coordinates. This means that we average over all points with the same Cartesian radius; for example, we would average across the points $(n_x,n_y,n_z)=(2,1,1),\,(1,2,1)$ and $(1,1,2)$. These choices of cuts assist in producing a cleaner signal that accurately represents the behaviour of the continuum propagator. With the momentum half-cut, we now renormalise at $qa=3.0$. This choice of renormalisation point is both sufficiently large and away from the lattice momentum cutoff, as well as falling within the momentum half-cut range of $qa\in [0,\,3.06]$. This choice of renormalisation point will be used for the remainder of this work.\\

With these cuts implemented, the gluon propagator on the original untouched configurations appears as Fig.~\ref{fig:UntouchedPropagator}. We observe the expected tree-level behaviour at high momenta, with an infrared enhancement indicative of amplified low-momentum propagation. It should be noted that the difference in peak height observed between Fig.~\ref{fig:MomentumComparison} and Fig.~\ref{fig:UntouchedPropagator} is due to the different renormalisation constant. Due to the cuts we have made, we observe a much cleaner signal, particularly in the region $qa\geq 1.5$, in agreement with the results of Ref.~\cite{Bonnet:2001uh}. For the remainder of this work we will employ these data cuts and this choice of momentum variables when plotting the gluon propagator to ensure an accurate and clear signal.
%
\begin{figure}
\centering
\includegraphics[width=\linewidth]{./ScalarGluComp_q2_NoCoolU.pdf}
\caption[The untouched gluon propagator with all data cuts and correct momentum variables utilised.]{\label{fig:UntouchedPropagator} The untouched gluon propagator with all data cuts and correct momentum variables utilised. We observe a substantially cleaner signal when compared to the untouched propagator shown in Fig.~\ref{fig:MomentumComparison}.}
\end{figure}


Previous chapters introduced some of the fundamental concepts related to robotic perception, and specifically techniques for sensing the environment and extracting useful semantic information. While these techniques provide \textit{local} information that is crucial for robots to navigate autonomously, additional \textit{global} information is often required.
For example, distance measurements from a laser rangefinder might be useful for detecting objects in an environment, but they only provide information \textit{relative} to the robot's current position. Alternatively, object detection via computer vision only provides information about what is in the robot's \textit{current} view. Robotic autonomy, in particular autonomous decision making and planning, generally requires more than just local information to answer questions such as ``have I seen this object before?'' and ``have I been here before?''.
These new challenges, associated with building a global understanding of the environment from local measurements, are often referred to as \textit{localization and mapping}\footnote{Localization and mapping is the component of the ``think'' part of the ``see, think, act'' cycle that connects with robotic perception.}.

\notessection{Introduction to Localization and Filtering}

The problem of \textit{localization} is to endow the robot with the ability to understand its current position with respect to its environment in a global sense\cite{ThrunBurgardEtAl2005}\cite{SiegwartNourbakhshEtAl2011}.
One of the main classes of techniques for robot localization are \textit{map-based}, where the robot explicitly localizes its position with respect to a \textit{map} of the environment.
For example, consider the floor plan (the environment map) in Figure \ref{fig:sample-room}: before a robot can navigate to a particular room it must know where in the building it is currently located.\footnote{Other approaches to navigate in environments include \textit{behavioral} approaches, which rely on a specified set of behaviors that will result in a desired global behavior without the need for explicit mapping or localization. An example of this approach would be to have a left-wall following behavior for movement about a building.}
\begin{figure}[ht]
	\centering
    \includegraphics[width=0.9\textwidth]{tex/figs/ch13_figs/map.png}
    \caption{An example environment where localization is crucial for robotic autonomy. For a robot to move from location A to location B it must first understand which room it is in, and that the only path to B is through the hallway. Extracting such global information about the environment from local measurements (e.g. from a range sensor) requires specialized algorithms.}
    \label{fig:sample-room}
\end{figure}

There are two primary components to map-based localization: map representation and belief representation. This chapter focuses on belief representation, which addresses the problem of how to best represent the robot's belief of its current position with respect to the map. One simple approach would be to simply store a best guess of the robot's position (in some map-based coordinate system). However in practice localization information is often \textit{uncertain}, and representing the belief by only a best guess does not capture this important fact. Therefore one common approach is to use a \textit{probabilistic} representation of the robot's belief since probability distributions can be used to model uncertainty (and extract best guesses, for example by finding the mean of a unimodal distribution). A variety of probabilistic representations can be used, for example singe-hypothesis or multiple-hypothesis representations as well as continuous or discrete representations. A few examples showing the differences between these types of representations are given in Figure \ref{fig:belief-representation}.
\begin{figure}[ht!]
	\centering
    \includegraphics[width=0.6\textwidth]{tex/figs/ch13_figs/distributions.png}
    \caption{A graphical representation of different types of probabilistic representations: (a) a continuous single-hypothesis belief (e.g. from a single Gaussian distribution), (b) a continuous multiple-hypothesis belief (e.g. a mixture of Gaussians), (c) discrete representation with a finite number of possible values.}
    \label{fig:belief-representation}
\end{figure}
Some representations are more expressive than others, but there is usually a trade-off with computational complexity of the resulting algorithms that support the representation. Algorithms based on these different probabilistic representations will be presented in this chapter and in subsequent chapters.

\subsection{Basic Concepts in Probability}
Before discussing different types of robot localization algorithms it is useful to provide a review of some of the fundamental concepts from probability.

\subsubsection{Random Variables}
Uncertain quantities such as sensor measurements, robot state, and environment variables can be modeled as discrete or continuous \textit{random variables}.
\begin{definition}[Discrete Random Variable]
A discrete random variable $X$ is a random variable that can only take on values from a countable set. Discrete random variables are characterized by a probability mass function $p(x)$ (which can be read as $p(X=x)$, ``the probability that $X$ takes on value $x$'') that satisfies:
\begin{equation*}
    \sum_x p(x) = 1,
\end{equation*}
where the summation is over all possible values of $X$.
\end{definition}
\begin{definition}[Continuous Random Variable]
A continuous random variable $X$ is a random variable that can take on values from a continuous range. Continuous random variables are characterized by a probability density function $p(x)$ that satisfies:
\begin{equation*}
    \int_{-\infty}^\infty p(x) dx = 1.
\end{equation*}
The probability of the random variable taking on a value in the interval $[a,b]$ is similarly defined as:
\begin{equation*}
    P(a \leq X \leq b) = \int_{a}^b p(x) dx = 1.
\end{equation*}
\end{definition}
A common example of a discrete random variable is the result of a coin flip, which can only take on two values: heads or tails. In robotics, a common example of a continuous random variable may be the position of the robot, which could take on an infinite number of values.

\subsubsection{Joint Distributions, Independence, and Conditioning}
Many applications of probability theory rely on more than one random variable. In these instances it is useful to be able to quantify probabilities associated with multiple random variables at the same time. One of the most fundamental tools when dealing with multiple variables is the \textit{joint distribution}.
\begin{definition}[Joint Distribution]
The joint distribution of two random variables $X$ and $Y$ defines the probability associated with both taking on specific values at the same time. This is denoted mathematically as $p(x,y)$, which can be read as $p(X=x \:\:\text{and}\:\: Y=y)$.
\end{definition}
It is also useful to determine whether different random variables have any relationship to each other. In particular, two random variables that do not have any influence on each other in a probabilistic sense are considered to be probabilistically independent.
\begin{definition}[Independence]
Two random variables $X$ and $Y$ are independent if and only if:
\begin{equation} \label{eq:indep}
    p(x,y)=p(x)p(y).
\end{equation}
Independence holds when the occurrence of one value of a random variable does not affect the probability of another random variable taking on a specific value.
\end{definition}
Another useful tool that relates two random variables is the conditional probability, which defines the probability of a random variable when the value of a second random variable is \textit{known} or \textit{fixed}.
\begin{definition}[Conditional Probability]
The conditional probability of a random variable $X$ taking on a value given that a second random variable $Y$ has a specific value is defined as:
\begin{equation} \label{eq:condprob}
    p(x\:|\: y)\coloneqq \frac{p(x,y)}{p(y)}.
\end{equation}
This can be read as ``the probability of $X$ taking on value $x$ conditioned on the fact that $Y$ has taken on value $y$''.
\end{definition}
Notice that if the random variables $X$ and $Y$ are independent, then the conditional probability definition simplifies to $p(x\:|\: y) = p(x)$, which suggests that knowing that $Y$ has taken on value $y$ has provided no new information about the random variable $X$ (which of course is in line with the definition of independence).
Additionally, another notion of independence can be defined based on whether or not two random variables are independent when \textit{conditioned} a third random variable.
\begin{definition}[Conditional Independence]
Two random variables $X$ and $Y$ are conditionally independent given the value of a third random variable $Z$ if and only if:
\begin{equation} \label{eq:condindep}
    p(x,y\:|\: z) = p(x \:|\: z) p(y \:|\: z).
\end{equation}
\end{definition}
It is important to note however that conditional independence does not imply independence, and vice versa.

\subsubsection{Law of Total Probability}
The law of total probability defines a relationship between probabilities, joint probabilities, and conditional probabilities.
\begin{definition}[Law of Total Probability]
For discrete random variables $X$ and $Y$ the law of total probability states that:
\begin{equation*}
    p(x) = \sum_y p(x,y) = \sum_y p(x \:|\: y) p(y).
\end{equation*}
Similarly, for continuous random variables this law is given by:
\begin{equation*}
    p(x) = \int p(x,y) dy = \int p(x \:|\: y) p(y) dy.
\end{equation*}
\end{definition}
In words, this law says that the probability of a random variable $X$ taking on a value $x$ can be found by looking at the joint probabilities between $X$ and $Y$ and accounting for \textit{all} possible values of $Y$. The second part of the law is a direct result of applying the definition of conditional probabilities.

\subsubsection{Bayes' Rule}
The joint probability $p(x,y)$ between two random variables $X$ and $Y$ can be related to the conditional probabilities $p(x \:|\: y)$ and $p(y \:|\: x)$ via the definition of conditional probabilities \eqref{eq:condprob}. In particular, since the joint probability can be equivalently expressed in two ways it can be seen that:
\begin{equation*}
    p(x,y) = p(x \:|\: y)p(y) = p(y \:|\: x) p(x).
\end{equation*}
This relationship is commonly referred to as Bayes' rule:
\begin{definition}[Bayes' Rule]
For discrete random variables $X$ and $Y$, Bayes' rule states that:
\begin{equation} \label{eq:bayes}
    p(x \:|\: y) = \frac{p(y \:|\: x) p(x)}{p(y)}.
\end{equation}
\end{definition}
Bayes' rule is useful as it provides a relationship between the ``inverse'' conditional probabilities $p(x \:|\: y)$ and $p(y \:|\: x)$. This is particularly important for \textit{probabilistic inference}, which is the problem of inferring the value of a random variable from another.

For example, suppose you had a good initial guess of the probability distribution $p(x)$ for a random variable $X$ (the distribution $p(x)$ in this case is often called the \textit{prior}, because it is the guess that comes before any new information is taken into account). Then, suppose some new information regarding the value of a random variable $Y$ is obtained. Using Bayes' rule it is possible to update your belief about the probability distribution of $X$ based on this new information. In particular, the new belief is the conditional probability $p(x \:|\: y)$ (which is often called the \textit{posterior} because it comes after new information is introduced). These two distributions are related by Bayes' rule!

Bayes' rule can also be extended to cases with additional random variables. For example with three random variables $X$, $Y$, and $Z$, Bayes' rule is:
\begin{equation*}
    p(x \:|\: y, z) = \frac{p(y \:|\: x, z) p(x \:|\: z)}{p(y \:|\: z)}.
\end{equation*}

\subsubsection{Expectation and Covariance}
Probability distributions define in a vary precise way the probability associated with any particular value of a random variable. However, sometimes it is useful to aggregate this information into more practically useful metrics. Two of the most commonly used metrics are the \textit{expected value} and the \textit{covariance}.
\begin{definition}[Expected Value]
The expected value for a random variable $X$ is denoted as $E[X]$. For discrete random variables the expected value can be computed by:
\begin{equation*}
    E[X] = \sum_x x p(x).
\end{equation*}
Similarly, the expected value for a continuous random variable can be computed by:
\begin{equation*}
    E[X] = \int x p(x) dx.
\end{equation*}
\end{definition}
The expected value can be thought of as the average result of an experiment over an infinite number of trials, and is also sometimes referred to as the \textit{first moment} of the distribution.
Additionally, expectation is a \textit{linear operator}, such that:
\begin{equation*}
    E[aX + b]= aE[X] + b,
\end{equation*}
for any values $a$ and $b$.
In the case that the random variable $X$ is a vector-valued random variable, the expectation of the random vector is simply the vector of expectations of each element.

\begin{definition}[Covariance]
The covariance between two random variables $X$ and $Y$ is denoted $\text{cov}(x,y)$ and is computed by:
\begin{equation*}
    \text{cov}(x,y) = E[(X-E[X])(Y-E[Y])^\top ] = E[XY^\top ] - E[X]E[Y]^\top
\end{equation*}
\end{definition}
Covariance is a metric used to describe the relationship between random variables and is positive if greater values of one variable generally corresponds to greater values of the other (and same for lesser values). Similarly, it is negative if the variables tend to show opposite behavior of each other. If there is no general relationship between the two then their covariance is zero (e.g. independent random variables have zero covariance).

\subsection{Markov Models}
Recall from previous chapters the kinematic and dynamic models that were developed to describe the physical behavior of a robot. These models consisted of a robot state $\x$, and a set of equations that described how $\x$ varied in time given some control inputs $\bu$. In this section another type of model will be developed that is based on these same core ideas. These new models, referred to as \textit{Markov models}, are commonly used in robotics for localization tasks as well as higher level planning tasks.

\subsubsection{States, Measurements, and Controls}
Similar to previous chapters, the state $\x$ is a collection of variables that contains information required to define the physical state of the robot. However unlike previous chapters, the state might also include information about the environment (this state has a higher-level perspective). In the context of robotics, the state may include the robot pose (i.e. location and orientation information), velocity, as well as locations and features of surrounding objects in the environment.
Note that in general the state discussed in this section might be different from the state defined for robot kinematics and dynamics (even if the robot is the same). This is because the choice of model is usually specific to the task at hand, and while the kinematic and dynamic models are useful for control, they may not strictly be necessary (or sufficient) for use in localization and planning tasks.

A discrete time formulation is also used in this context, where the state is specified for discrete time instances and denoted by $\x_t$ (rather than $\x(t)$, as was done in previous chapters). The models developed in this section then describe the changes in the state between time steps, for example between $\x_t$ and $\x_{t+1}$. It is also useful to define the notation $\x_{t_1:t_n} \coloneqq \x_{t_1},\x_{t_2},...,\x_{t_n}$ for describing a sequence of states between times $t_1$ and $t_n$.

The robot interacts with the environment through control actions and by gathering information through measurements\footnote{In the context of robot localization, measurements increase the robot's knowledge and control actions tend to result in a loss of knowledge.}. In this context, the measurement data collected at a time $t$ will be denoted as $\z_t$, and the control data is denoted as $\bu_t$. Similar to the state, a useful notation for representing a sequence of measurements or controls is given by  $\z_{t_1:t_n} \coloneqq \z_{t_1},\z_{t_2},...,\z_{t_n}$ and $\bu_{t_1:t_n} \coloneqq \bu_{t_1},\bu_{t_2},...,\bu_{t_n}$. In general, the measurements can come from any number of the sensors discussed in previous sections on robotic perception, including cameras and laser rangefinders.

\subsubsection{Model}
The kinematic and dynamic models from previous chapters (expressed as a set of ordinary differential equations) were deterministic models. However, to leverage a probabilistic framework for robot localization it is typically required that the model also be probabilistic. In the most general sense a probabilistic model can be defined by:
\begin{equation} \label{eq:genprobmod}
p(\x_t \mid \x_{0:t-1}, \z_{1:t-1}, \bu_{1:t}),
\end{equation}
which defines a probability distribution over the possible current state $\x_t$ given the state, measurement, and control histories. Note that here the convention that will be used is that the robot executes control $\bu_t$ first, and then the measurement $\z_t$ can be made based on the resulting state $\x_t$. A general probabilistic measurement model can also be defined as:
\begin{equation} \label{eq:genmeasmod}
p(\z_t \mid \x_{0:t}, \z_{1:t-1}, \bu_{1:t}).
\end{equation}

In many cases however, the state is defined such that it is \textit{complete}. A state $\x_t$ is complete if no variables prior to $\x_t$ can influence the future states. In other words, $\x$ contains a sufficient amount of information that the history is not important. This is also known as the \textit{Markov property}. If the Markov property holds, the probabilistic model \eqref{eq:genprobmod} can be simplified to:
\begin{equation} \label{eq:markovprobmod}
p(\x_t \mid \x_{t-1}, \bu_{t}),
\end{equation}
and the measurement model \eqref{eq:genmeasmod} can be simplified to:
\begin{equation} \label{eq:markovmeasmod}
p(\z_t \mid \x_{t}).
\end{equation}

The resulting overall model with the Markov property, consisting of the state transition probability \eqref{eq:markovprobmod} and the measurement model \eqref{eq:markovprobmod} is referred to as a Bayes network model or a hidden Markov model. Graphically this model can be represented as shown in Figure \ref{fig:hmm}, where the sequencing of the control and measurements are more clearly shown (first control, then measurement).
\begin{figure}[ht]
	\centering
    \includegraphics[width=0.55\textwidth]{tex/figs/ch13_figs/hmm.png}
    \caption{Graphical representation of the Bayes network model (hidden Markov model). Note that the sequencing assumes that the control is applied, and then a measurement is taken.}
    \label{fig:hmm}
\end{figure}

\subsection{Bayes Filter}
Given a Bayes network model defined by a state transition model \eqref{eq:markovprobmod} and a measurement model \eqref{eq:markovmeasmod}, the next task is to determine a way to use this information for robot localization. In particular, the desired task is to estimate the current robot state $\x_t$ given the measurement and control information that is available. In the probabilistic framework this estimate is referred to as a \textit{belief distribution}, which is a probability distribution over $\x$. This distribution assigns a probability to each hypothesis with respect to the true state. Mathematically the belief distribution is denoted as $bel(\x_t)$ and is defined as:
\begin{equation} \label{eq:belief}
bel(\x_t):=p(\x_t\mid \z_{1:t}, \bu_{1:t}).
\end{equation}
In other words, the belief $bel(\x_t)$ is a posterior probability distribution over the state variables conditioned on the available data. A similar distribution, known as the \textit{prediction} distribution, can also be defined as:
\begin{equation} \label{eq:predbelief}
\overline{bel}(\x_t):=p(\x_t\mid \z_{1:t-1},\bu_{1:t}),
\end{equation}
which is does not include the most recent measurement $\z_t$. The process of computing a belief from a predicted belief (i.e. the process of accounting for the new measurement $\z_t$) is called a \textit{correction} or \textit{measurement update}.

The most general algorithm for computing beliefs $bel(\x_t)$ (which leverages Bayes network models that satisfy the Markov property) is known as the \textit{Bayes filter}. This filter is a recursive algorithm that consists of a prediction step for computing $\overline{bel}(\x_t)$ and a correction step for computing $bel(\x_t)$ given a new measurement $\z_t$.

\subsubsection{Algorithm}
The Bayes filter algorithm is given in Algorithm \ref{alg:bayes}. In this algorithm, the probability associated with each potential state $\x_t$ is updated via a prediction and a correction. The term $\eta$ in the correction step is simply a normalization constant that ensures the resulting posterior $bel(\x_{t})$ satisfies the requirements of a probability density function\footnote{In fact this normalization constant comes from the denominator in Bayes' rule.}. This algorithm is typically initialized with a prior distribution $bel(\x_{0})$ that may come from a best guess or simply a uniform distribution.
\begin{algorithm}[ht]
 \KwData{$bel(\x_{t-1}), \bu_{t},\z_{t}$}
 \KwResult{$bel(\x_{t})$}
 \ForEach{$\x_t$}{
    $\overline{bel}(\x_t) = \int p(\x_t\mid \bu_{t}, \x_{t-1}) bel(\x_{t-1}) d\x_{t-1}$ \\
    $bel(\x_t) = \eta p(\z_t\mid \x_{t})\overline{bel}(\x_t)$
 }
 \Return $bel(\x_{t})$
 \caption{Bayes Filter Algorithm}
 \label{alg:bayes}
\end{algorithm}
Note that the prediction step is essentially just using the state transition model \eqref{eq:markovprobmod} to guess what might happen to each state for the given control $\bu_t$. The correction step is then modifying the prediction to actually account for what was observed in the real world.

\subsubsection{Derivation}
Recall that the belief distribution is defined as \eqref{eq:belief}, which can be expanded using Bayes' rule to yield:
\begin{equation*}
\begin{split}
bel(\x_t) &\coloneqq p(\x_t\mid \z_{1:t}, \bu_{1:t}), \\
&=\eta p(\z_{t}\mid \x_{t},\z_{1:t-1},\bu_{1:t})p(\x_{t}\mid \z_{1:t-1},\bu_{1:t}),
\end{split}
\end{equation*}
where
\begin{equation*}
    \eta = \frac{1}{p(\z_{t}\mid \z_{1:t-1},\bu_{1:t})}.
\end{equation*}
The Markov property can then be leveraged to simplify $p(\z_{t}\mid \x_{t},\z_{1:t-1},\bu_{1:t}) = p(\z_{t}\mid \x_{t})$ and the definition of the prediction belief can be used to give:
\begin{equation*}
\begin{split}
bel(\x_t) = \eta p(\z_{t}\mid \x_{t}) \overline{bel}(\x_t),
\end{split}
\end{equation*}
which is precisely the second step of the Bayes filter algorithm. Now the derivation of the prediction can be given by again starting from its definition and leveraging the law of total probability:
\begin{equation*}
\begin{split}
 \overline{bel}(\x_t) &= p(\x_{t}\mid \z_{1:t-1},\bu_{1:t}), \\
 &= \int p(\x_{t}\mid \x_{t-1},\z_{1:t-1},\bu_{1:t}) p(\x_{t-1}\mid \z_{1:t-1},\bu_{1:t}) d\x_{t-1}.
\end{split}
\end{equation*}
Again the Markov property can now be used to simplify $p(\x_{t}\mid \x_{t-1},\z_{1:t-1},\bu_{1:t}) = p(\x_{t}\mid \x_{t-1},\bu_{t})$, and additionally the structure of the model makes it possible to remove the $\bu_t$ term from the prior distribution $p(\x_{t-1}\mid \z_{1:t-1},\bu_{1:t})$ since the control $\bu_t$ has no impact on the state $\x_{t-1}$ (see Figure \ref{fig:hmm}). Therefore the expression above can be simplified to:
\begin{equation*}
\begin{split}
 \overline{bel}(\x_t) = \int p(\x_{t}\mid \x_{t-1},\bu_{t}) bel(\x_{t-1}) d\x_{t-1},
\end{split}
\end{equation*}
since by definition $bel(\x_{t-1}) = p(\x_{t-1}\mid \z_{1:t-1}, \bu_{1:t-1})$. This result is precisely the prediction step from the Bayes filter algorithm.

\subsubsection{Practical Considerations}
The Bayes filter is a great starting point to derive many useful algorithms, but is itself often not practical to implement. In particular it is generally not reasonable to assume that the integrals in Algorithm \ref{alg:bayes} can be computed, and if they could be approximated via a numerical scheme this may computationally still be challenging.

\subsection{Discrete Bayes Filter}
The discrete Bayes filter is a discrete version of the Bayes filter previously introduced. This filter can be applied to problems where the state space is finite (i.e. only a finite number of values of $\x$ are possible). This makes the Bayes filter approach more tractable because the integrals do not need to be computed over an infinite set.

In the discrete Bayes filter the belief $bel(\x_{t})$ is represented using a probability mass function rather than a probability density function (as is the case with the \textit{continuous} Bayes filter). In particular, this probability mass function is simply a finite collection of probabilities $\{p_{k,t}\}$ where $p_{k,t}$ is the probability associated with state $k$ at timestep $t$. The algorithm generally follows the exact procedure as the Bayes filter in Algorithm \ref{alg:bayes}, but with summations replacing the integrals. In particular, the discrete Bayes filter algorithm is provided in Algorithm \ref{alg:discretebayes}.
\begin{algorithm}[ht]
 \KwData{$\{p_{k,t-1}\}, \bu_{t}, \z_{t}$}
 \KwResult{$\{p_{k,t}\}$}
 \ForEach{k}{
  $\overline{p}_{k,t}=\sum_{i} p(\x_{t}\mid \bu_{t}, \x_{i})p_{i,t-1} $\\
  $p_{k,t}=\eta p(\z_{t}\mid \x_{k})\overline{p}_{k,t}$\\
 }
 \Return $p_{k,t}$
 \caption{Discrete Bayes Filter Algorithm}
 \label{alg:discretebayes}
\end{algorithm}


\documentclass[letterpaper]{article}

\usepackage{fullpage}
\usepackage{nopageno}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage[utf8]{luainputenc}
\usepackage{aeguill}
\usepackage{setspace}

\tikzstyle{edge} = [fill,opacity=.5,fill opacity=.5,line cap=round, line join=round, line width=50pt]
\usetikzlibrary{graphs,graphdrawing}
\usegdlibrary{trees}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\allowdisplaybreaks

\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}

\begin{document}
\title{Notes}
\date{17 avril, 2015}
\maketitle
9.4 chromatic plynomials

the chromatic poly counts the number of \lambda-colorings of a graph $G$

notation $P(G,\lambda)$

polynomial starts at zero and then becomes positive. once positive it's positive forever. discrete poly (integer), not continuous.

leading coefficient is positive from end ending positive

zeros are factors

two colorings $C, C'$ are distinct if $\exists v\in V(G)$ such that $C(v)\ne C'(v)$

example:

\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph [tree layout] { 1 -- {2 -- 3} -- 1 --4--3}
  [shift=(0:1)];

let $\lambda=6$. how many ways can we color $G$ with 6 colors? 1 has 6, 3 has 5, 4 choices for 2 and 4. so 480.

we have shown:

$P(G,6)=480$

the enumeration of choices above, we can get $P(G,\lambda)=\lambda(\lambda-1)(\lambda-2)^2$

\subsubsection*{properties}
that should make sense
\begin{enumerate}
\item
chromatic number: $\chi(G)=3$
\item
what is the smallest $\lambda$ such that $P(G,\lambda)>0$? 3o
\item
convention: $P(G,0)=0\forall G$
\end{enumerate}

formally, if $P(G,\lambda)$ is the chrompoly of $G$ then $\chi(G)=\min\limits_\lambda(P(G,\lambda)>0)$

\subsubsection*{exercise}
find the $P(K_n,\lambda)$

$P(K_3,\lambda)=\lambda(\lambda-1)(\lambda-2)$

$P(K_4,\lambda)=\lambda(\lambda-1)(\lambda-2)(\lambda-3)$

$P(K_n,\lambda)=\prod\limits_{i=0}^{n-1}(\lambda-i)=\frac{\lambda!}{(\lambda-n)!}$

if $E_n$ is the empty graph (no edges) on $n$ vertices $P(E_n,\lambda)=\lambda^n$

\subsubsection*{exercise}
$P(C_4,\lambda)$
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph [tree layout] { 1 -- 2 -- 3 -- 4--1 }
  [shift=(0:1)];

  $P(C_4,\lambda)=\lambda(\lambda-1)^2(\lambda-2)$ unless the two adjacent to the starting count are the same then $\lambda(\lambda-1)^3$

  this leads to sums in $P(G,\lambda)$ and so we have graph theoretically two options
\begin{enumerate}
\item
if they are the same edge contraction
\item
if they are different then we can insert an edge with no change
\end{enumerate}

either choice leads to  a complete graph

\section*{theorem}
if $uv\not\in E(G)$ and $H$ is the graph $G+uv$ with $uv$ contracted, then $P(G,\lambda)=P(G+uv,\lambda)+P(H,\lambda)$

we are going to draw graphs instead of using this notation

\subsubsection*{example}
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 1;2--3 --1--2;4--5;2--4;5--3};
  =
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 1;2--3 --1--2;4--5;2--4;5--3;5--1};
  +
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2};

=
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 1;2--3 --1--2;4--5;2--4;5--3;5--1};
  +
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2};
+
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2;4--3};
+
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 3;4--3--5--4};

$\vdots$

=
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 1;2--3 --1--2;4--5;2--4;5--3;5--1;4--3;5--2};
  +
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2;4--3};
+
$3\cdot($
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 2--3;4--5;2--4;5--3;5--2;4--3};
+
\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph { 3;4--3--5--4};
$)$

homework is $1,6,7$
\end{document}


%!TEX program = xelatex
%!TEX root = ./thesis.tex
\chapter{Experiments}\label{chap:experiments}

% \yan{How about using the title ``Evaluations''?}
% No, thx.
% \yan{For grammar issues, do you mind using Grammarly \textit{https://app.grammarly.com/} to check your document? Our lab often uses it when writing English papers.}
% Yep, this whole thesis has already been revised on Grammarly.

The GreenEyes model is based on WaveNet and LSTM. Unlike computer vision models, which take 2D images as inputs, the GreenEyes model is trained on 1D sequential data arrays.

To build a data feeding pipeline, we built a slice data generator on the $PM_{2.5}$ IAQI data. Train data pairs as below are fed to the model:

\begin{equation}
\left\{
    \begin{array}{l}
    X_i=[D(t_i),D(t_{i+1}),...,D(t_{i+L-1})] \\
    y_i=P(t_{i+L})
    \end{array}
\right.
\end{equation}

% 实验目的是用window化的 IAQI 数据（注意是iaqi数据，不是原始pm数据）fit手动标注的 IAQI level

Where $D$ denotes the whole $PM_{2.5}$ IAQI data array, $P$ denotes the whole target function, i.e., the polygonized IAQI level we get in the last chapter. It is clear that our model takes a 1D array as input and outputs a scalar.

$L$ denotes the length of the slice when we sample sequences from the $PM_{2.5}$ IAQI data, and $t_i$, $t_{i+1}$ etc. are the discrete-time points. Note that to make the model to be \textbf{causal}, the target value $y_i$ in the train data pair is sampled at time point $t_{i+L}$, which is exactly next to the last time point in $X_i$.

In our experiment, as the total length of the $PM_{2.5}$ IAQI data is 219,989, setting different values for the length of the slice $L$ will firstly lead to variant input size for the GreenEyes model because the input size equals $L$, which will also make the number of training parameters larger or smaller. Secondly, as the length of the whole sequence data is limited, the larger $L$ is, the less the number of total train data is. Number of total train data is $(219,989-L+1)$.

We finally chose 7,200 as the length of the slice for the following reasons:
\begin{enumerate}
    \item 7,200 seconds equals 2 hours in the time axis, and we design the model to predict the next second's IAQI level by previous data within these 2 hours.
    \item The model's size (number of parameters, etc.) w.r.t. the input size of 7,200 is exactly appropriate both for learning and inferring.
\end{enumerate}

\section{Data Sampling and Splitting}

As described above, the number of total train data is $(219,989-L+1)$. When setting $L=7200$, it is 212,790, which is an enormous number when feeding the model. Hence, we introduced the sampling method and set stride when collecting train samples from the original data, and the size will be $\frac{\lfloor 219,989-L+1 \rfloor}{stride}+1$.

Moreover, we split the data into a training set and validation set, with a validation ratio of 0.2. The number of training/validation samples varies when stride varies. Out experiments use 10, 5, 2 as stride's value and Table \ref{table:N_samples} illustrates the number of training/validation samples.

\begin{table}[!htbp]
    \centering
    \begin{tabular}{|l|l|l|l|l|}
    \hline
    $L$ (The length of the slice) & Stride & $N_{samples}$ & $N_{train}$ & $N_{val}$ \\ \hline
    7200 & 10 & 21280  & 17024  & 4256  \\ \hline
    7200 & 5  & 42559  & 34048  & 8511  \\ \hline
    7200 & 2  & 106396 & 85117  & 21279 \\ \hline
    \end{tabular}
    \caption{The relationship between different strides and number of samples.}
    \label{table:N_samples}
\end{table}

Figure \ref{fig:model_feeding_pipeline} shows the model feeding pipeline of our GreenEyes model during training.

\begin{figure}[!htbp]
    \centering
    \includegraphics[width=2.9in]{graphs/data_slicing.pdf}
    \caption{Data feeding pipeline when training.}
    \label{fig:model_feeding_pipeline}
\end{figure}

\section{Sensor Data Augmentation}

As brought out before, we believe that with more data together, the model could learn better. Though these four data channels differ a little from each other, they approximately follow the same distribution. Hence, besides training the model on every single channel of \text{$PM_{2.5}$} data, we also \textbf{combined} all these channels' data together and fed it. The corresponding data is called \text{$PM_{2.5}$ (All)}.

\section{Experiments}
% 描述实验的组别，个数
As we sampled $PM_{2.5}$ data from 4 sensors, Sensor 0 to Sensor 3, so we have four channels of $PM_{2.5}$ IAQI data, and there are three different stride values. Finally, we have 12 experiments. Besides, we have a group of augmentation experiments in which all four sensors' data are fed to the model, yielding another three experiments.
% LR 配置
For each experiment, We optimized our GreenEyes model using Adam \cite{kingma2017adam} an initial learning rate of 0.0001, which is multiplied by 0.1 after 20 epochs. We trained our model to 100 epochs for each experiment.
% Loss 配置
We used mean squared error (MSE) as a loss metric and recorded mean absolute error (MAE). They are defined by equations below:

\begin{equation}
    MSE(p, y)=E((p_i-y_i)^2)
\end{equation}

\begin{equation}
    MAE(p, y)=E(|p_i-y_i|)
\end{equation}

Where $p$ is the prediction sequence and $y$ is the polygonized $PM_{2.5}$ IAQI sequence.

% four metrics, mean squared error (MSE), mean absolute percentage error (MAPE), mean squared logarithmic error (MSLE).

\subsection{Training and Validation} % 15 experiments

\subsubsection{Training Loss Curves}

Figure \ref{fig:training_mse} and Figure \ref{fig:val_mse} illustrate the training MSE curves and validation MSE curves respectively. It is observed that our system can fit the data well.
% \yan{Add a conclusion. } \yan{It is observed our system can xxx.}

% \yan{By the way, does your institution require inserting PDF figures?}

\begin{figure}[!htbp]
    \centering
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/train_curves_stride_10.pdf}
        \caption{stride=10.}
        \label{fig:train_stride_10}
    \end{subfigure}
    \hfill
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/train_curves_stride_5.pdf}
        \caption{stride=5.}
        \label{fig:train_stride_5}
    \end{subfigure}
    % \hfill
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/train_curves_stride_2.pdf}
        \caption{stride=2.}
        \label{fig:train_stride_2}
    \end{subfigure}
\caption{Training MSE curves.}
\label{fig:training_mse}
\end{figure}

\begin{figure}[!htbp]
    \centering
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/val_curves_stride_10.pdf}
        \caption{stride=10.}
        \label{fig:val_stride_10}
    \end{subfigure}
    \hfill
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/val_curves_stride_5.pdf}
        \caption{stride=5.}
        \label{fig:val_stride_5}
    \end{subfigure}
    % \hfill
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/val_curves_stride_2.pdf}
        \caption{stride=2.}
        \label{fig:val_stride_2}
    \end{subfigure}
\caption{Validation MSE curves.}
\label{fig:val_mse}
\end{figure}

% 讨论一个 Sensor，其它的放附录
% For Sensor 0, we fed the model with three different stride values. Figure
% the learning curves
% after the learning rate changes at the 20th epoch
% For more model training data, please refer to Appendix \ref{chapter:other_model_training_data}
% Figure \ref{fig:model_training_mse_mae_msle} shows the training process. We can infer that the model is already saturated after 100 epochs.

\subsubsection{Training Best Metrics}

As we used MSE as loss, i.e., the supervising metric, we extracted minimum train MSE and minimum validation MSE from all the training epochs. These best metric results reflect the model's fitting capability. They are all rounded to 4 decimals.

% We also record other metrics such as MAE during training.

Table \ref{table:best_metrics} lists each experiment's final best metrics during training.

\begin{table}[!htbp]
    \centering
    \begin{tabular}{|c|c|c|c|c|}
        \hline\hline
        Data & Stride & Minimum train MSE & Minimum validation MSE & ratio \\\hline
        \multirow{3}{*}{\text{$PM_{2.5}$(0)}} & 10 & 0.0223 & 0.0234 & 0.96 \\ \cline{2-5}
                                        & 5 & 0.0034 & 0.0114 & 0.30 \\ \cline{2-5}
                                        & 2 & \textbf{\textit{0.0006}} & \textbf{\textit{0.0035}} & 0.16 \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(1)}} & 10 & 0.0486 & 0.0510 & 0.95 \\ \cline{2-5}
                                        & 5 & 0.0058 & 0.0142 & 0.41 \\ \cline{2-5}
                                        & 2 & \textbf{\textit{0.0006}} & \textbf{\textit{0.0036}} & 0.17 \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(2)}} & 10 & 0.0171 & 0.0187 & 0.92 \\ \cline{2-5}
                                        & 5 & 0.0024 & 0.0092 & 0.27 \\ \cline{2-5}
                                        & 2 & \textbf{\textit{0.0012}} & \textbf{\textit{0.0066}} & 0.19 \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(3)}} & 10 & 0.0509 & 0.0468 & 1.09 \\ \cline{2-5}
                                        & 5 & 0.0074 & 0.0167 & 0.44 \\ \cline{2-5}
                                        & 2 & \textbf{\textit{0.0010}} & \textbf{\textit{0.0068}} & 0.15 \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(All)}} & 10 & 0.0068 & 0.0103 & 0.66 \\ \cline{2-5}
                                        & 5 & 0.0014 & 0.0022 & 0.67 \\ \cline{2-5}
                                        & 2 & \textbf{0.0007} & \textbf{0.0009} & 0.77 \\
        \hline
        \hline
    \end{tabular}
    \caption{Experiments' final best metrics.}
    \label{table:best_metrics}
\end{table}

We also define a generalization coefficient ratio as the equation below to measure the model's generalization capability during certain experiments. The larger the ratio,  the better the generalization capability is. The ratio results are rounded to 2 decimals.

\begin{equation}
    ratio=\frac{min(train\ MSE)}{min(validation\ MSE)}
\end{equation}

\subsection{Model Evaluation}

% Evaluation curves
\begin{figure}
    \centering
    \includegraphics[width=\linewidth]{fig/model_eval_pm25_0_stride_10.png}
    \caption{Evaluation of the GreenEyes model (\text{$PM_{2.5} (0)$}, stride=10).}
    \label{fig:model_eval_pm25_0_stride_10}
\end{figure}

As earthquake prediction aims to fit the model and learn time-series information, i.e., the triangular lines in coordination with the acoustic data, our model also fits the level lines regarding their air pollutant concentration data. Figure \ref{fig:model_eval_pm25_0_stride_10} proves that the model fits the labeled IAQI level lines well, except that its predictions differ from the ground truth a little on some parts of the lines, and especially on the turning corners of the piecewise linear function.

% Test results table here.
To quantify the testing results of our model by different parameters, we tested it on the whole $PM_{2.5}$ sequence by setting stride as 1, which is different from the training config. As stride is set to 1, the slice window will move one point after another. Hence, the model can make the inference on the whole source sensor data. When the stride is set a 10, 5, and 2 for different training data sampling configs, these sampled data slices form a subset of the sliced data when the stride is set to 1.

We performed the tests using two metrics, mean square error (MSE) and mean absolute error (MAE).

And we test all models trained under different stride parameters and on every channel of $PM_{2.5}$ data. Table \ref{table:test_mse_mae} lists the statistics of our tests. Digit in the brackets is the channel number. "All" means the model is trained by all channels together. All result values of MSE have rounded four decimals, and all MAE values are rounded to 2 decimals.

\begin{table}[!htbp]
    \centering
    \begin{tabular}{|c|c|c|c|}
        \hline\hline
        Data & Stride & MSE & MAE \\\hline
        \multirow{3}{*}{\text{$PM_{2.5}$(0)}} & 10 & 0.0266 & 0.13 \\ \cline{2-4}
                                        & 5 & 0.0144 & 0.11 \\ \cline{2-4}
                                        & 2 & \textbf{\textit{0.0037}} & \textbf{\textit{0.05}} \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(1)}} & 10 & 0.0517 & 0.18 \\ \cline{2-4}
                                        & 5 & 0.0113 & 0.10 \\ \cline{2-4}
                                        & 2 & \textbf{\textit{0.0036}} & \textbf{\textit{0.05}} \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(2)}} & 10 & 0.0188 & 0.11 \\ \cline{2-4}
                                        & 5 & 0.0092 & 0.09 \\ \cline{2-4}
                                        & 2 & \textbf{\textit{0.0069}} & \textbf{\textit{0.07}} \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(3)}} & 10 & 0.0501 & 0.16 \\ \cline{2-4}
                                        & 5 & 0.0108 & 0.09 \\ \cline{2-4}
                                        & 2 & \textbf{\textit{0.0070}} & \textbf{\textit{0.07}} \\ \hline
        \multirow{3}{*}{\text{$PM_{2.5}$(All)}} & 10 & 0.0118 & 0.09 \\ \cline{2-4}
                                        & 5 & 0.0026 & 0.04 \\ \cline{2-4}
                                        & 2 & \textbf{0.0010} & \textbf{0.02} \\ \hline
        \hline
        \hline

    \end{tabular}
    \caption{Test MSE and MAE under different strides.}
    \label{table:test_mse_mae}
\end{table}

The data on the table shows that for each channel of $PM_{2.5}$ data, the smaller the stride parameter is, the less the MSE and MAE are, which means the model can fit the target better. This is reasonable and consistent with our intuition.

Meanwhile, when put all channels' data together and feed the model, it can learn the best result.

Figure \ref{fig:test_mse} and Figure \ref{fig:test_mae} respectively present the test MSE and MAE results by bar plots. The plots are divided into three stride groups, which's stride is 10, 5, 2. Results from the different data channels (or all channels of the data) but sharing the same stride join into the same group for comparisons.

\begin{figure}[!htbp]
    \centering
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/test_mse.pdf}
        \caption{Test MSE.}
        \label{fig:test_mse}
    \end{subfigure}
    \begin{subfigure}[!htbp]{.45\textwidth}
        \centering
        \includegraphics[width=\textwidth]{fig/results/test_mae.pdf}
        \caption{Test MAE.}
        \label{fig:test_mae}
    \end{subfigure}
    \caption{Test MSE and MAE.}
    \label{fig:test_mse_mae}
\end{figure}

\subsection{Results Analyses}

From the results table and bar plots, we could draw at least two useful and meaningful conclusions. Firstly, for each kind of data, whichever $PM_{2.5}$ (i) or $PM_{2.5}$ (All), when the stride parameter decreases, the model can outcome better results.

Secondly, in each stride group, $PM_{2.5}$ (All)'s performance surpasses every single channel of $PM_{2.5}$ data, w.r.t. both MSE and MAE. And when the stride is 5 or 2, this conclusion is more significant.

The first conclusion is obvious. As Table \ref{table:N_samples} shows, the smaller the stride is, the number of training samples gets larger. More data will result in a better model's fitting performance. However, while we want the model to predict and fit more precisely, we don't want to sample sliced data from original data flow too frequently (set the stride too small). The model's capability is reflected by its relevant fitting results (MSE, MAE, etc.), while a rather less frequent sampling is configured (e.g., set stride to 10, not 2).

For our GreenEyes model, the evaluation curve in Figure \ref{fig:model_eval_pm25_0_stride_10} shows its fitting capability, as stride 10 is already enough.

During application, we could trade off on this stride parameter to balance the model's performance and the computation costs.