text:
\chapterquote{%
Remember that all models are wrong;\\[0.0ex] the practical question is how wrong\\[0.4ex] do they have to be to not be useful.}
{-- George E. P. Box, \textit{Empirical Model-Building and Response Surfaces} (1987)}

Now we present more notations and propose a general system model for random access wireless networks.
%
The main purpose of this model is to establish a common basis for all networks studied in this thesis and provide rigorous definitions for the following network metrics: throughput, traffic, transmission and packet success probability, and queueing load.
%
Then, we can make connections among different system models with varied architectures, such as synchronous and asynchronous scenarios, finite and infinite number of nodes, homogeneous and in-homogeneous networks.

All in all, we proposed a model that covered all scenarios studied in this manuscript while keeping in mind the following aspects: minimize the number of parameters, be a flexible model, and use a coherent, comprehensible, and compact notation.
%
All of these aspects are concurrent, so we hope to have attained a reasonable balance among them.

\newpage

% % % % % % % % % % % % % %
\section{System Model Definition} \label{sec:SysModDef}

% Let the transmission time for every packet of the network be given by $\tau>0$.
% %
% Once we fix $\tau$, we can assume without loss of generality that $\tau = 1$ unit of time.
% %
% Note this can be easily generalized to differ for each pair of transmitter and receiver.
%
Let the set $\T\subset\overline\R$ be the analyzed period of time, e.g. $\R_+$ in asynchronous scenarios and $\N$ when time is slotted.
%
Let the \textit{countable} sets $\cal{N}_\TX$ and $\cal{N}_\RX$ represent the set of transmitters and receivers, respectively. Then, we define the set of links as $\cal{L} \triangleq \cal{N}_\TX \times \cal{N}_\RX$.
%
Let $\S\subset \R^d$ be the analyzed region of the space where the network nodes are located.
%
Let $(\T,\cal{B}(\T),\mu_\T)$ and $(\S,\cal{B}(\S),\mu_\S)$ be \textit{measure spaces}. We assume all functions defined in the sequence are \textit{measurable}. % with respect to adequate \textit{measure spaces} equipped with a Borel $\sigma$-algebra.

\begin{remark}
    Usually, for an unslotted asynchronous network we choose $\T = \R_+$ and $\mu_\T$ as the Lebesgue measure on $\R$, i.e., it measures the length of a set. For example, for $a<b$, $\mu_\T([a,b]) = b-a$.
    %
    On the other hand, for a slotted synchronous network we usually choose $\T = \N$ and $\mu_\T$ as the counting measure, i.e., it counts the number of elements in a set. For example, $\mu_\T(\{2,5,8,9\}) = 4$.

    Regarding the measure $\mu_\S$, we almost always adopt the Lebesgue measure. Then, if $\S=\R^2$, $\mu_\S$ measures area; if $\S=\R^3$, $\mu_\S$ measures volume.
    %
    For example, the volume of the $d$-dimensional sphere of radius $1$ is given by
    \[\mu_\S(\{x\in\R^d: ||x||<1\}) = \frac{\pi^{d/2}}{\Gamma(\frac{d}{2} + 1)},\]
    %
    where $\Gamma$ is the gamma function.
    %
    The set $\S$ usually is the entire $\R^2$ plane, however, it is also common to choose a finite subset of $\R^2$, e.g. a circle of radius $r>0$. In this case $\S = \{x\in\R^2: ||x|| < r\}$ could represent the area covered by a base station.
\end{remark}

At time $t\in\T$, let $i\in\cal{N}_\TX$ be a transmitter and $j\in\cal{N}_\RX$ be a receiver, then we denote%
\begin{itemize}[itemsep=3pt,parsep=3pt,topsep=3pt,partopsep=3pt]
    % \item $\Phi_{\TX}(t)$ or $\{X_k(t)\}_{k\in \cal{N}_\TX} \subset \S$ the positions of the transmitters.
    % \item $\Phi_{\RX}(t)$ or $\{Y_k(t)\}_{k\in \cal{N}_\RX} \subset \S$ the positions of the receivers.
    \item $X_i(t) \in \S$ the position of transmitter $i$.
    \item $Y_j(t) \in \S$ the position of receiver $j$.
    \item $R_{ij}(t) \triangleq ||X_i(t) - Y_j(t)||\in\R_+$ the distance between $i$ and $j$.
    \item $\zeta_{ij}(t)\in\{0,1\}$ whether the link between $i$ and $j$ is active.
    \item $H_{ij}(t) \in \R_+$ the small scale fading\footnote{Some examples of fading models are Rayleigh, Nakagami-$m$, One-sided Gaussian, and Ricean distributions. A generalization of the aforementioned fading models was proposed in \cite{yacoub2007alpha,yacoub2007kappa}, namely the $\kappa$--$\mu$, $\eta$--$\mu$ and $\alpha$--$\mu$ distributions.} and shadowing coefficient of the signal from $i$ to $j$.
    \item $P_{ij}(t) \in \R_+$ the transmit power of the $i$th transmitter to the $j$th receiver.
    \item $\ell:\R_+\longrightarrow\R_+$ the omnidirectional path loss model\footnote{Some examples of path loss models are $\ell(r) = (A_0 \max\{r_0,r\})^{-\alpha}$, $\ell(r) = (1 + A_0 r)^{-\alpha}$ and $\ell(r) = (A_0 r)^{-\alpha}$, for $A_0>0$, $r_0>0$ and $\alpha>2$, where $\alpha$ is called the path loss exponent. The last one must be used with care due to the singularity at $r=0$. Note that all these models are asymptotically equivalent as $r\to\infty$.}.
    \item $\mathscr{S}:(\T\to\R_+)\longrightarrow\{0,1\}$ the transmission success probability model.
    \item $\tau_{ij}\in\R_+$ the transmission time of a packet from $i$ to $j$.
    \item $Q_{ij}(t)\in\N$ the number of queued packets in the buffer of transmitter $i$ for receiver $j$.
    \item $A_{ij} \subset \T$ the set of times for which a packet that arrives in $i$ will be transmitted to $j$.
    \item $T_{ij}\subset \T$ the set of times for which $i$ is allowed to start a transmission for $j$. % (gained channel access).
    \item $T_{ij}^*\subset T_{ij}$ the set of times for which $i$ starts a transmission for $j$.
\end{itemize}

Since we are dealing with interference limited networks, we define the \textit{signal-to-interference} ratio ($\SIR$) as follows\footnote{This definition is easily extensible to \textit{signal-to-interference-plus-noise} ($\mathrm{SINR}$) ratio.}.

\begin{definition}[\bm{$\SIR$}] \label{eq:SIR}
    At time $t\in\T$, the \textit{signal-to-interference} ratio at the receiver $j\in\cal{N}_\RX$ receiving a transmission from transmitter $i\in\cal{N}_\TX$ is defined as
    \begin{align*}
        \SIR_{ij}(t) \triangleq \zeta_{ij}(t)\,\frac{P_{ij}(t) H_{ij}(t)\, \ell(R_{ij}(t))}{I_{ij}(t)},
    \end{align*}
    with the convention $0/0 = 0$ and $1/0 = \infty$,
    %
    where $I_{ij}(t)$ is the aggregate interference received by $j$ while receiving a transmission from $i$ and is given by
    \begin{align*}
        I_{ij}(t) \triangleq \sum_{k\in\cal{N_\TX}\backslash\{i\}} \sum_{n\in\cal{N_\RX}\backslash\{j\}} \zeta_{kn}(t) P_{kn}(t) H_{kj}(t) \, \ell(R_{kj}(t)).
    \end{align*}
\end{definition}

It is worth noting that we are assuming that the propagation delay is negligible for tractability reasons.
%
However, this can be considered through a modification in the argument of the functions to e.g. $t-\Delta t$, where $\Delta t$ depends on the propagation distance.

To decide whether a given packet transmission is successful, we use the functional $\mathscr{S}$ which takes values on $\{0,1\}$ and receives as argument the $\SIR$ during the transmission of a packet.
%
Let $1$ represent success and $0$ represent failure.

\begin{remark}
    To input the correct argument in the functional $\mathscr{S}$ we need to constraint the domain of the $\SIR:\T\longrightarrow\R_+$ to the time for which a transmission occurs, for that we use the notation $\SIR\vert_T:T\longrightarrow\R_+$, which restricts the domain of $\SIR$ to $T$, where $T\subset\T$ is the set of times for which the transmission occurred.
\end{remark}

\begin{example}
Some examples of valid functionals $\mathscr{S}$ follows.
\begin{itemize}[itemsep=3pt,parsep=3pt,topsep=3pt,partopsep=3pt]
    \item Let $\T=\R_+$. Consider the model where the packet is successfully transmitted if and only if the $\SIR$ is above a given threshold $\theta$ at all times during the transmission. The functional that represents this rule is given by
    \begin{align*}
        \mathscr{S}(\SIR) = \ind_{(\theta,\infty]}\!\left(\inf \SIR\right).
    \end{align*}

    \item Consider the model where the packet is successfully transmitted if and only if the integral of the $\SIR$ with respect to the measure $\mu_\T$ is above a threshold $\theta$. Then
    \begin{align*}
        \mathscr{S}(\SIR) = \ind_{(\theta,\infty]}\!\left( \int \SIR\,\d\mu_\T \right). % \quad T = [0,\tau)\cap\T.
    \end{align*}

    \item From the above example, if $\T=\N$, $\tau=1$, and $\mu_\T$ is the counting measure, we recover the \textit{capture model}, where the packet is successfully received if $\SIR(t) > \theta$.

    \item Using again the same example, if we choose $\T=\R_+$ and $\mu_\T$ as the Lebesgue measure, we have a model where the packet is successfully received if the integral of the $\SIR$ is greater than $\theta$.
\end{itemize}
\end{example}

The functions $\zeta$, which represents the active links, and $Q$, which represents the number of queued packets, heavily depend on the adopted network protocols, so it is hard to define a general and simple equation for them.
%
However, below we provide an example that covers some standard scenarios.

\begin{example}
    Let the function $\zeta$ be given by
    \begin{align*}
        \zeta_{ij}(t) \triangleq \ind\{t\in T_{ij}^*\oplus[0,\tau_{ij})\}, \quad t\in\T, i\in\cal{N}_\TX, j\in\cal{N}_\RX,
    \end{align*}
    where $T_{ij}^* \triangleq \{t\in T_{ij}: Q_{ij}(t)>0\}$ and the operator $\oplus$ denotes set addition and is defined as $U\oplus V \triangleq \{u+v : u\in U, v\in V\}$.
    %
    The above equation says that the link between $i$ and $j$ is active if the corresponding queue is non-empty and the link has gained medium access. % and there is no other active link for that transmitter.
    %
    Note that $\zeta$ can be generalized to vanish when some other conditions are met.
    %
    For example, in a carrier-sensing multiple-access (CSMA) scheme we can use an indicator function that vanishes when there is another active transmitter nearby.
    %
    Another example is to limit the transmitters to transmit to a single receiver at a time.

    Let the number of queued packets for receiver $j\in\cal{N}_\RX$ on the queue of transmitter $i\in\cal{N}_\TX$ be given by
    \begin{align*}
        Q_{ij}(t) \triangleq \sum_{t_a\in A_{ij}} \ind\{t_a < t\} - \sum_{t^*\in T_{ij}^*} \ind\{t^* < t-\tau_{ij}\}\,\mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})}) , \quad t\in\T,
    \end{align*}
    % where $D_{ij}(t)$ is the number of successfully transmitted packets from $i$ to $j$ until time $t$,
    % \begin{align*}
    %     D_{ij}(t) \triangleq \sum_{t^* \in T_{ij}}\,\ind\{t^* < t-\tau_{ij}\} \ind\{Q_{ij}(t^*) > 0\}\,\mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})}).
    % \end{align*}
    The term $\mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})})$ verifies whether the $\SIR$ in $[t^*,t^*+\tau)$ is enough for a successful packet transmission, and the set $A_{ij}$ contains the time arrivals of the packets.
    % Each $t^*\in T_{ij}$ is a time for which transmitter $i$ gained access to transmit a packet for receiver $j$.
    Then, we count all the successful transmissions that happened before $t-\tau_{ij}$, because we do not know if packets that started being transmitted after $t-\tau_{ij}$ are successful given the information until time $t$.
    %
    % Note that $Q$ depends on $\zeta$ and vice versa. But, this is not a problem because $Q$ depends only on past values of $\zeta$.
\end{example}

Now let us introduce the source of the network model randomness.
%
Let $(\Omega,\cal F, \P)$ be a \textit{probability space} and let each one of the aforementioned functions (except $\ell$ and $\mathscr{S}$) in this chapter also depend on the outcome $\omega\in\Omega$, e.g. $\SIR(t) = \SIR(\omega;t)$.
%
Therefore, these functions are not only \textit{measurable functions}, they are random variables as well.
%
However, as usual, we omit the dependence on the outcome $\omega$.

\begin{note}
    The reader that is not interested in mathematical details and formal definitions can skip to Section~\ref{sec:poisson_network}.
\end{note}

For the \textit{probability space} $(\Omega,\cal F, \P)$, let $\Phi_\TX(t)\stackrel{*}{=}\{X_k(t)\}_{k}$ and $\Phi_\RX(t)\stackrel{*}{=}\{Y_k(t)\}_{k}$ be point processes\footnote{Let us be wary of the misleading notation, because we usually do not write the dependence of a point process on the space nor on the outcome. Indeed, we have that $\Phi_\TX,\Phi_\RX: \Omega\times\S\times\T\longrightarrow \N$.} on $\S$ for each $t\in\T$.
%
Let $\{H_{ij}(t)\}_t$ be a stochastic process on state space $\R_+$ and index space $\T$ for each $i\in\cal{N}_\TX$ and $j\in\cal{N}_\TX$.
%
Let $A_{ij}$ and $T_{ij}$ be point processes on $\T$ for each $i\in\cal{N}_\TX$ and $j\in\cal{N}_\TX$, and $T_{ij}^*$ be a \textit{thinning} of $T_{ij}$.
%

Now we can define some important network metrics such as mean transmission success probability, traffic, and throughput.
%
Note that we cannot simply sum some quantities and divide by others when we have $\mu_\T(\T) = \infty$ or $\mu_\S(\S) = \infty$ (for example, $\T=\R$ or
$\S=\R^2$), because we may end up with an indetermination of the kind $\infty/\infty$. That is why we need the following sequences of sets.
%
Let $\{\T_k\}_{k\in\N}$ be an increasing sequence of $\mu_\T$-finite sets that converges to $\T$, i.e., $\T_k\subset\T_{k+1}\subset\T$ and $\mu_\T(\T_k)<\infty$ for all $k\in\N$, and see Remark~\ref{rem:set_convergence}. Let $\{\S_n\}_{n\in\N}$ be an increasing sequence of $\mu_\S$-finite sets that converges to $\S$. Let $\{\cal{L}_n\}_{n\in\N}$ be an increasing sequence of finite sets that converges to $\cal{L}$.
%
Then, we can use these sequences of sets to avoid indeterminations.

\begin{remark} \label{rem:set_convergence}
    A sequence of sets $\{A_n\}_{n\in\N}$ is said to converge to set $A$ if and only if $\liminf_n A_n = \limsup_n A_n = A$, where
    \begin{align*}
        \liminf_{n\to\infty} A_n = \bigcup_{n\ge 1} \bigcap_{j\ge n} A_j, \quad
        \limsup_{n\to\infty} A_n = \bigcap_{n\ge 1} \bigcup_{j\ge n} A_j.
    \end{align*}
\end{remark}

Now we can define the mean transmission success probability.
\begin{definition}[\textbf{Transmission success probability}]
    % The mean transmission success probability from $i\in\cal{N}_\TX$ to $j\in\cal{N}_\RX$ is defined as
    % \begin{align*}
    %     p_{s,ij} \triangleq \lim_{k\to\infty} \E\!\left[ \frac
    %     {\displaystyle\sum_{t^*\in T_{ij}^*}\ind_{\T_k}(t^*) \, \mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})})}
    %     {\displaystyle\sum_{t^*\in T_{ij}^*}\ind_{\T_k}(t^*) }\right]
    % \end{align*}
    % with the convention $0/0=0$.
    The mean transmission success probability of the set of links $L\subset\cal{L}$ is defined as
    \begin{align*}
        p_{s,L} \triangleq \lim_{\substack{n\to\infty\\k \to \infty}} \E\!\left[ \frac
        {\displaystyle \sum_{(i,j)\in\cal{L}_n\cap L} \sum_{t^*\in T_{ij}^*} \ind_{\T_k}\!(t^*) \, \mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})})}
        {\displaystyle \sum_{(i,j)\in\cal{L}_n\cap L} \sum_{t^*\in T_{ij}^*}\ind_{\T_k}\!(t^*)}\right],
    \end{align*}
    with the convention $0/0=0$.

    The mean transmission success probability of the network is denoted as $p_s \triangleq p_{s,\cal{L}}$.
\end{definition}

Despite the cumbersome notation, the above definition simply counts the number of successful transmissions and divides by the total number of transmissions in such a way we do not get the indetermination $\infty/\infty$.
%
The term $\ind_{\T_k}\!(t^*)$ represents if a transmission happened in $\T_k$ and the term $\mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})})$ represents if it was successful.
%
Also, we used $\E[\cdot/\cdot]$ instead of $\E[\cdot]/\E[\cdot]$ because we want to weigh on the network realizations instead of on the number of transmissions of the network realizations.

\begin{definition}[\textbf{Packet success probability}]
    The mean packet success probability of the set of links $L\subset\cal{L}$ is defined as
    \begin{align*}
        p_{p,L} \triangleq \lim_{\substack{n\to\infty\\k \to \infty}} \E\!\left[ \frac
        {\displaystyle \sum_{(i,j)\in\cal{L}_n\cap L} \sum_{t^*\in T_{ij}^*} \ind_{\T_k}\!(t^*) \, \mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})})}
        {\displaystyle \sum_{(i,j)\in\cal{L}_n\cap L} \sum_{t_a\in A_{ij}}\ind_{\T_k}\!(t_a)}\right],
    \end{align*}
    with the convention $0/0=0$.

    The mean transmission success probability of the network is denoted as $p_p \triangleq p_{p,\cal{L}}$.
\end{definition}

Note that the mean transmission success probability $p_s$ is different from the mean packet success probability $p_p$. The former is relative to the number of transmissions, while the latter is relative to the number of generated packets.

\begin{definition}[\textbf{Traffic}] \label{def:traffic}
    % The traffic (of packets per unit of time) between the link formed by transmitter $i\in\cal{N}_\TX$ and receiver $j\in\cal{N}_\RX$ is defined as
    % \begin{align*}
    %     \lambda_{ij} \triangleq \lim_{k \to \infty} \frac{1}{\mu_\T(\T_k)}\,\E\!\left[  \sum_{t^*\in T_{ij}^*} \ind_{\T_k}\!(t^*)
    %     \right].
    % \end{align*}
    % The traffic of the network is defined as
    % \begin{align*}
    %     \lambda \triangleq \lim_{n\to\infty} \lim_{k \to \infty} \frac{1}{\mu_\T(\T_k)\mu_\S(\S_n)} \E\!\left[  \sum_{(i,j)\in\cal{L}}\sum_{t^*\in T_{ij}^*} \ind_{\S_n}\!(X_i(t^*))\,\ind_{\S_n}\!(Y_j(t^*))\, \ind_{\T_k}\!(t^*) \right].
    % \end{align*}
    %
    We define the (spatio-temporal) occupation rate of the channel by the set of links $L\subset\cal{L}$ as
    \begin{align*}
        \upsilon_L \triangleq \lim_{\substack{n\to\infty\\k \to \infty}} \frac{1}{\mu_\T(\T_k)\mu_\S(\S_n)} \E\!\left[  \sum_{(i,j)\in{L}}\sum_{t^*\in T_{ij}^*} \tau_{ij} \ind_{\S_n}\!(X_i(t^*))\,\ind_{\S_n}\!(Y_j(t^*))\, \ind_{\T_k}\!(t^*) \right].
    \end{align*}

    The network occupation rate of the channel is denoted as $\upsilon \triangleq \upsilon_\cal{L}$.
\end{definition}

Analogously to what the term $\ind_{\T_k}\!(t^*)$ does for time, the terms $\ind_{\S_n}\!(X_i(t^*))$ and $\ind_{\S_n}\!(Y_j(t^*))$ do for space, i.e., they represent if transmitter $i$ and receiver $j$ are located within $\S_n$, respectively.

In this manuscript, we also use the term \textit{traffic} to designate the rate of packet transmissions per unit of area in slotted-based systems with discrete $\T$ and transmission time $\tau = 1$.
%
However, we only do that when the numerical value coincides with Definition~\ref{def:traffic}.

\begin{note}
    The calculation $\displaystyle\lim_{k\to\infty}\frac{1}{\mu_\T(\T_k)} \int_{\T_k} f(x) \,\d\mu_\T(x)$ represents a general form of the well known temporal average $\displaystyle\lim_{t\to\infty}\frac{1}{t} \int_0^t f(x) \,\d x$.
    %
    It is more general because is valid for slotted (discrete) systems, we can extend to $-\infty$ without changing the equation, and it can be used in bounded periods of time. Beyond being more general, we also chose to adopt this to keep a uniform notation, i.e., we do the same for the spatial average over $\S$ which could correspond to any region of the space (finite or infinite).
\end{note}

% We consider the \textit{packet model}, where the throughput on a link is measured in packets per unit of time.
% %
% However, this can be easily modified to take into account the data contained in each packet.
% %
% The definition follows.

\begin{definition}[\textbf{Throughput}] \label{def:throughput}
    The (spatial) throughput of the set of links $L\subset\cal{L}$ is
    \begin{align*}
        \mathscr{T}_L \triangleq \lim_{\substack{n\to\infty\\k \to \infty}} \frac{1}{\mu_\T(\T_k)\mu_\S(\S_n)} \E\!\left[  \sum_{(i,j)\in{L}}\sum_{t^*\in T_{ij}^*} \tau_{ij} \ind_{\S_n}\!(X_i(t^*))\,\ind_{\S_n}\!(Y_j(t^*))\, \ind_{\T_k}\!(t^*)\,\mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})}) \right].
    \end{align*}

    The throughput of the whole network is denoted as $\mathscr{T} \triangleq \mathscr{T}_\cal{L}$.
\end{definition}

The above definition resembles Definition~\ref{def:traffic} with the sole and important difference that it only counts the successful transmissions, because it has the term $\mathscr{S}(\SIR_{ij}\vert_{[t^*,t^*+\tau_{ij})})$.

\begin{definition}[\textbf{Queue load}]
    The mean occupation of the queues for the set of transmitters $N_\TX\subset\cal{N}_\TX$ is given by
    \begin{align*}
        \rho_{N_\TX} \triangleq \lim_{\substack{n\to\infty\\k \to \infty}} \frac{1}{\mu_\T(\T_k) \left|N_\TX^{(n)}\right|} \E\!\left[  \sum_{i\in N_\TX^{(n)}} \int_{\T_k} \ind\!\left\{\max_{j\in\cal{N}_\RX} Q_{ij}(t) > 0\right\} \d\mu_\T(t) \right],
    \end{align*}
    where $\left\{N_\TX^{(n)}\right\}_{n\in\N}$ is a crescent sequence of finite sets that converges to $N_\TX$.

    The mean occupation of the queues for the whole network is denoted by $\rho \triangleq \rho_{\cal{N}_\TX}$.
\end{definition}

The above definition calculates the mean proportion of time the queues are not empty. The term inside the integral indicates if the queue of transmitter $i$ is not empty, then we take the average over time and over the queues of set $N_\TX$.
%
% The limits on $n$ and $k$ are necessary to avoid the indeterminations $\infty/\infty$.

% \begin{definition}
%     A \textit{network} is a $4$-tuple $(\T,\mathscr{N},\mathscr{G},\mathscr{Q})$, where
%     \setlist{nolistsep}
%     \begin{itemize}[noitemsep]
%         \item $\mathscr{N}$ defines the set of transmitters and receivers
%     \end{itemize}
% \end{definition}

% \begin{note}
%     Despite the assumption of \textit{measurable} functions in the system model, certainly it is still possible to find ``pathological'' examples using this model.
%     %
%     However, it is out of the scope of this manuscript to analyze such cases.
% \end{note}

\section{Network Models} \label{sec:poisson_network}

First of all, let us define a stationary and an ergodic network.
%
According to Definitions \ref{def:stationary} and \ref{def:ergodic_process} it is redundant to say ``stationary and ergodic'', because ergodicity is a special case of stationarity, i.e., ergodicity implies stationarity.
%
However, we found important to include both when speaking about ergodicity for clarity.

The class of stochastic processes we study in this thesis are not stationary and ergodic by definition. However, as the time $t\in\T$ tends to positive infinity, then the system states probabilities, under certain conditions, converge to a probability distribution that entails stationarity and ergodicity.
%
Therefore, whenever we say a network system is stationary and ergodic we mean that the system state probabilities converge to a probability distribution that makes the corresponding stochastic process stationary and ergodic as time tends to positive infinity.
%
The formal definitions follow.

\begin{definition}[\textbf{Stationary network}]
    Let $\T=\R_+$ or $\T=\N$. A network system model is stationary if and only if for every $i\in\cal N_\TX, j\in\cal N_\RX$ the stochastic process $\{Q_{ij}(t)\}_{t\in\T}$ converges in distribution to a stationary stochastic process as $t\to\infty$ and the point processes $A_{ij}$ and $T_{ij}$ on $\T$ are also stationary.

    Then, we denote by $a_{ij} \ge 0$ the constant that satisfies $\E[A_{ij}(B)] = a_{ij} \,\mu_\T(B)$ and $p_{ij} \ge 0$ the constant that satisfies $\E[T_{ij}(B)] = p_{ij} \,\mu_\T(B)$ for every $B\in\cal{B}(\T)$.
\end{definition}

In general terms, the constant $a_{ij}$ represents the arrival rate of packets for the link $(i,j)$ and the constant $p_{ij}$ represents the medium access rate for the link $(i,j)$.

\begin{definition}[\textbf{Ergodic network}]
    Let $\T=\R_+$ or $\T=\N$. A stationary network is ergodic if and only if for every $i\in\cal N_\TX, j\in\cal N_\RX$ the stochastic process $\{Q_{ij}(t)\}_{t\in\T}$ converges in distribution to an ergodic stochastic process as $t\to\infty$ and the point processes $A_{ij}$ and $T_{ij}$ on $\T$ are also ergodic.
\end{definition}

% If the network is stationary and ergodic the equations to calculate transmission and packet success probability, traffic, throughput, and queue load simplifies significantly.

Now, let us define a Poisson network, which is a network that has the stationary property across space.
%
\begin{definition}[\textbf{Poisson network}]
    A Poisson network is a network that, for every $t\in\T$, the position of the transmitters $\Phi_\TX(t)$ and receivers $\Phi_\RX(t)$ follow a homogeneous Poisson point process with densities $\lambda_\TX > 0$ and $\lambda_\RX > 0$ on $\R^d$, respectively.
\end{definition}

Here an essential problem arises, which is the behavior of the point processes $\{\Phi(t)\}_{t\in\T}$ over time, which represents the user's locations over time.
%
Usually, we need independence across time to have ergodicity, however, that is not always the case.
%
The following network definition includes this desirable property.
%
\begin{definition}[\textbf{High-mobility/static network}]
    A \textit{high-mobility} network is a network for which the position of the transmitters $\Phi_\TX(t)$ and receivers $\Phi_\RX(t)$ are independent across time $t\in\T$.
    %
    More precisely, for every finite set $\{t_i\}_{i=1}^n \subset\T$, $n\in\N$ we must have that $\{\Phi_\TX(t_i)\}_{i=1}^n$ forms a collection of independent random measures\footnote{A collection of random measures are independent if for every subset of the space, they form a collection of independent random variables.}.

    On the other hand, let $t_0\in\T$, when $\Phi_\TX(t) = \Phi_\TX(t_0)$ and $\Phi_\RX(t) = \Phi_\RX(t_0)$ for all $t\in\T$, then we say that we have a \textit{static} network.
\end{definition}

In high-mobility networks, we shall use the assumption that when a transmission starts, we consider the positions of the nodes static for calculation of the $\SIR$.
%
This is a reasonable assumption because usually the transmission time $\tau$ is small if compared with the rate of change of the nodes' position.
%
Thus, effectively, the nodes' positions will not change for every instant of time.

\begin{definition}[\textbf{Bipolar network}]
    A network is bipolar if each transmitter $i\in\cal{N}_\TX$ has a dedicated receiver $j\in\cal{N}_\RX$.
    %
    Then, we can represent each link transmitter-receiver $(i,j)$ by simply the index $i$ or $j$.

    In a bipolar Poisson network, we represent the density of the transmitters and receivers by the same density $\lambda > 0$.
\end{definition}

Then, for a bipolar network, instead of writing the queue size as $Q_{ij}$ we can simply write $Q_i$ because there is only one receiver for each transmitter $i$.
%
Note, however, that the coefficient $H_{ij}$ must still be indexed by $(i,j)$ because this random variable appears in the interference caused by transmitter $i$ on receiver $j$ and they are not linked.

A commonly used network model is the stationary and ergodic Poisson network with one user class, which means that we have stationarity across users, i.e., the random variables associated with each user follow the same distribution across the index of users.
%
If we further assume that the shot-noise process related to the aggregate interference is stationary across space, then the transmission success probability is the same for all users and it is --\textit{ceteris paribus}-- a  function of the network traffic $\upsilon$, in the sense that for a given system model we can determine the transmission success probability $p_s$ (as defined in Definition~\ref{def:traffic}) only knowing the network \textit{traffic} $\upsilon$.
%
Further, we can show that in this scenario the network \textit{throughput} (as defined in Definition~\ref{def:throughput}) is simply given by $\mathscr{T}(\upsilon) = \upsilon\,p_s(\upsilon)$.
%
See Example~\ref{ex:classic_network}, for which this applies, once $\upsilon=\lambda\tau$.

For this scenario, we proved the following theorem that guarantees existence and uniqueness of a \textit{traffic} that achieves the maximum \textit{throughput}.

\begin{theorem}\label{th:unique_opt}
    Let $p_s:\R_+\longrightarrow (0,1]$ be a continuously differentiable function. Let us define the function $\psi(\upsilon) \triangleq -\upsilon \frac{\d}{\d\upsilon} \ln (p_s(\upsilon))$, $\nu\in\R_+$.
    %
    If $\psi$ is a monotonous increasing function and \vspace{-6mm}
    \begin{align} \label{eq:aux_th1}
        \lim_{\upsilon\to\infty} \psi(\upsilon) > 1,
    \end{align}
    then the throughput $\mathscr{T}(\upsilon) = \upsilon\,p_s(\upsilon)$ has a unique local maximum, which is a global maximum.
\end{theorem}
%
\begin{proof}
    The derivative of the throughput at $\upsilon\in\R_+$ is
\begin{align*}
    \mathscr{T}'(\upsilon)
        = p_s(\upsilon) \left(1 - \upsilon \left(\frac{-p_s'(\upsilon)}{p_s(\upsilon)}
            \right)\right)
        = p_s(\upsilon) \, (1-\psi(\upsilon)).
    \end{align*}
    Since $p_s$ is a continuously differentiable function, $\mathscr{T}'$ is a continuous function. In addition, there exists $\upsilon^*\in\R_+$ such that $\mathscr{T}'(\upsilon^*) = 0$ by the intermediate value theorem (Theorem~\ref{th:IVT}), because $\mathscr{T}'(0) = p_s(0) > 0$ and there exists a $\upsilon_0 > 0$ such that $\mathscr{T}'(\upsilon_0) < 0$, by \eqref{eq:aux_th1}.
    %
    Then, using that $\psi$ is a monotonous function, we have that if $\upsilon < \upsilon^*$, then $\mathscr{T}(\upsilon)$ increases monotonically. Otherwise, if $\upsilon > \upsilon^*$, then $\mathscr{T}(\upsilon)$ decreases monotonically, which concludes the proof.
\end{proof}

The above theorem can be used in any scenario that we can express the transmission success probability as a function of the traffic and packets have the same transmission time.

\begin{remark}
    Theorem~\ref{th:unique_opt} only gives a sufficient condition to the existence and uniqueness of an optimal. However, it is a ``tight'' sufficient condition, in the sense it is also a necessary condition for a family of ``smooth'' decreasing functions, which is usually the case for wireless networks.

    Take, for example, $p_s(\upsilon) = (1+\upsilon)^{-\alpha}$, $\alpha>0$. Then, $\psi(\upsilon) = \alpha\upsilon/(1+\upsilon)$, which satisfies the theorem if $\alpha>1$. In this case, if $\alpha\le 1$, the optimum does not exist, thus it is also a necessary condition.
\end{remark}

Now we present a conjecture that we are still not able to prove, which is a generalization of Theorem~\ref{th:unique_opt} for the case of several user classes and different packet transmission times.
%
The mathematical statement follows.

\begin{conjecture} \label{conj:unique_opt}
    Let $\bm{p}_s: \R_+^n \longrightarrow (0,1]^n$ be a continuously differentiable function.
    %
    Let the function
    \begin{align*}
        \psi_j(\bm{\upsilon}) \triangleq - \sum_{i=1}^n \upsilon_i \frac{p_{s,i}(\bm{\upsilon})}{p_{s,j}(\bm{\upsilon})} \frac{\partial}{\partial \upsilon_j} \ln(p_{s,i}(\bm{\upsilon})), \qquad \bm{\upsilon}\in\R^n, j\in\{1,2,\dots,n\},
    \end{align*}
    where $p_{s,j}$ and $\upsilon_j$ are the $j$th component of $\bm{p}_{s}$ and $\bm{\upsilon}$, respectively.

    If for every $j\in\{1,2,\dots,n\}$, $\psi_j(\bm{\upsilon})$ is a monotonic increasing function of $\upsilon_j$ and
    \begin{align*}
        \liminf_{||\bm{\upsilon}||\to\infty} \psi_j(\bm{\upsilon}) > 1,%
    \end{align*}%
    then the total throughput of the system $\mathscr{T}(\bm{\upsilon}) = \bm{\upsilon} \cdot \bm{p}_s(\bm{\upsilon}) \in \R_+$ has a unique local maximum, which is a global maximum.
\end{conjecture}

The conjecture is inspired in the proof of Theorem~\ref{th:unique_opt}, and it represents the case of $n$ classes of users.
%
Note that $p_{s,i}$ represents the success probability of the $i$th user class.
% The $i$th user class have a success probability given by $p_{s,i}(\bm{\upsilon})$, thus the throughput of that class is $\mathscr{T}_i = \upsilon_i\,p_{s,i}(\bm{\upsilon})$.

% \begin{proposition}
%     Consider a stationary and ergodic Poisson network with density of users $\lambda>0$ on $\R^d$.
%     %
%     If we further assume stationarity and ergodicity across the users, i.e., for any random variable $\cdot_i$ that is indexed by $i\in\cal{N}_\TX$ we have that $\{\cdot_i\}_{i\in\cal{N}_\TX}$ forms a stationary and ergodic stochastic process.
%     %
%     Then, we have that the transmission success probability is given by
%     \begin{align*}
%         p_{s} &= \lim_{t\to\infty} \P(\mathscr{S}(\SIR_0\vert_{[t,t+\tau_0)}),
%     \end{align*}
%     where $i=0$ is a typical user of the network.
% \end{proposition}

% $\mathscr{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}$

% $\mathcal{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}$

% % % % % % % % % % % % % %
\section{Summary} \label{sec:summ_P2_00}

In this chapter, we have proposed a general system model that covers all system models presented in this manuscript.
%
Then, we defined some important and general network metrics that are used throughout different models until the end of the thesis.
%
Further, we provided rigorous definitions for some commonly used terms for wireless networks, such as stationary, ergodic, Poisson, high-mobility, static, and bipolar.

In this framework, we proved a theorem that guarantees existence and uniqueness of an optimal throughput; and presented a conjecture that is a generalization of the proved theorem.


text:
\usetypescript[antykwa-poltawskiego]
\setupbodyfont[antykwa-poltawskiego,10pt]

\setuphead
	[section]
	[style=\bfc,numberstyle=\bfc]
\setuphead
	[subsection]
	[style=\bfb,numberstyle=\bfb]
\setuphead
	[subsubsection]
	[style=\bfa,numberstyle=\bfa]
\setuphead
	[title]
	[style=\bfd]
\setuppagenumbering
	[location={footer,right},style=\os]
\setuplayout
	[backspace=1in,width=middle,
	 header=0pt,headerdistance=0pt,height=24.5cm]

\def\sc{\addff{smallcaps}}
\def\os{\addff{oldstyle}}

\def\eTeX{ε-\TeX}
% TODO
\def\XeLaTeX{Xe\LaTeX}
\def\LuaLaTeX{Lua\LaTeX}
\def\pTeX{p\TeX}

\definecolor
	[verylightgray]
	[s=.95]
\defineframedtext
	[framedCODE]
	[frame=off,
	 strut=yes,
	 offset=2mm,
	 width=.9\textwidth,
	 location=middle,
	 background=color,
	 backgroundcolor=verylightgray]
\definetyping
	[TEX]
	[option=TEX,
	 before={\startframedCODE},
	 after={\stopframedCODE}]

\starttext

\title{The {\tt hyph-utf8} package and hyphenation with \TeX}

\blank[big]

\startnarrower
{\bf Maintainers} of the {\tt hyph-utf8} package and collectors of patterns:
\startnarrower
\startitemize[packed,joinedup]
\item {\it Mojca Miklavec, Arthur Reutenauer}
\item With contributions by {\it Khaled Hosny, Manuel Pégourié-Gonnard, Élie Roux}
\stopitemize
\stopnarrower
\stopnarrower

\blank

\startnarrower
{\bf Main description}:
\startnarrower
June 2011
\stopnarrower
\stopnarrower

\startnarrower
{\bf Latest editorial change}:
\startnarrower
16 Mars 2018
\stopnarrower
\stopnarrower

\blank

\startnarrower
{\bf Abstract}:
\startnarrower\sl
In 2008 all the existing hyphenation patterns from \TeX\ distributions have
been collected in a single package {\tt hyph-utf8}, converted into UTF-8
encoding and adapted for use in different \TeX\ engines. The patterns can be
used directly by Unicode-aware engines such as \LuaTeX\ and \XeTeX, and there
is a mechanism to convert the patterns to the appropriate 8-bit encoding when
used with \pTeX, \pdfTeX\ or Knuth's \TeX.
\stopnarrower
\stopnarrower

\blank

\startnarrower
{\bf Table of Contents}:
\blank
\startnarrower
\setuplist[section]      [width=10mm,textstyle=\bf\sc,numberstyle=\bf\os,pagestyle=\os]
\setuplist[subsection]   [width=15mm,textstyle=normal,numberstyle=\os,pagestyle=\os]
\setuplist[subsubsection][distance=20mm,headnumber=no,textstyle=italic,pagestyle=\os]

\placecontent[criterium=all,alternative=c]
\stopnarrower
\stopnarrower

\page
\section{Using hyphenation patterns}

\subsection{Plain \TeX}

In engines that support \eTeX\ you can select the desired hyphenation patterns with:
\startTEX
\uselanguage{langname}
\stopTEX
where \type{langname} is the string identifying a particular hyphenation file in \type{language.def} (see Section \in[sec:languages]).

\subsection{\LaTeX}

\subsubsection{\LaTeX\ with Babel}

You can switch the language in \LaTeX\ with:

\startTEX
\usepackage[languagename]{babel}
\stopTEX

In 8-bit engines you also need to make sure that you load the proper font encoding which supports all the characters used in the language of your choice, for example:
\startTEX
\usepackage[T1]{fontenc}
\stopTEX
% TODO: reference to encoding list

{\it N.B.:}\/ You can use Babel with any \TeX\ engine, however it has never been properly adapted to work well with Unicode engines. If you are using \XeTeX\ it is advisable to use Polyglossia instead.

\subsubsection{\LaTeX\ with Polyglossia}

Polyglossia should be the preferred choice when using \XeLaTeX. It doesn't support \LuaLaTeX\ yet, but it is planned to extend it in future.

\startTEX
\usepackage{polyglossia}
\setmainlanguage[optional settings]{langname}
\setotherlanguages{otherlangname}

\begin[optional settings]{otherlangname} ... \end{otherlangname}
\stopTEX

See Polyglossia manual for extensive list of options.

\subsubsection{Low-level commands}

Since Babel's \type{hyphen.cfg} is built into the \LaTeX\ format, hyphenation patterns can be used without even loading Babel or Polyglossia. At the low-level this simply corresponds to defining
\startTEX
\language=\l@<langname>
\stopTEX
The user command is supposed to be
\startTEX
\hyphenrules{langname}
\stopTEX
or
\startTEX
\begin{hyphenrules}{langname} ... \end{hyphenrules}.
\stopTEX
and {\it should}\/ work with any flavour of \LaTeX, however we couldn't make it work.

\subsection{\ConTeXt}

\ConTeXt\ doesn't load patterns for all the language that {\tt hyph-utf8} provides. If you miss any language, please contact the mailing list. The general syntax for supported languages is the following:

\startTEX
% language of the main document
\mainlanguage[language]

% to switch to another language locally
{\language[otherlanguage] language of some short fragment}
\stopTEX

You can use full language name or the two-letter language code.

\subsubsection{\ConTeXt\ MkII}
When using \ConTeXt\ MkII the EC/T1 font encoding is used by default already, but you might need to change the encoding when using Polish, languages written in Cyrillic scripts, etc. For example:

\startTEX
\usetypescript[iwona][qx]
\setupbodyfont[iwona]
\mainlanguage[polish]
\stopTEX

\ConTeXt\ loads hyphenation patterns in several encodings. The Czech or Slovak patterns can be used with both EC and IL2 font encoding for example. The right hyphenation patterns will be chosen based on current font encoding.

\subsection{Some advanced examples}

\subsubsection{Example for Polyglossia}

\startTEX
\usepackage{polyglossia}
% the language used for main document
\setmainlanguage{asturian}
% American English with extended hyphenation patterns
\setotherlanguage[variant=usmax]{english}
% German with experimental patterns "ngerman-x-latest"
\setotherlanguage[spelling=new,latesthyphen=true]{german}
\setotherlanguages{spanish,catalan,french}

\begin{document}

Long Asturian text ... (Hyphenation for Asturian is not available,
but polyglossia automatically falls back on Catalan for now,
which seems to be a reasonable choice.)

\begin{german}
Deutscher Text ... (with the hyphenation patterns selected above:
"ngerman-x-latest")
\end{german}

\begin[script=fraktur,spelling=old]{german}
Deutſcher Text ... (set in Fraktur, with traditional hyphenation).
\end{german}

\end{document}
\stopTEX

\page
\section[sec:languages]{List of supported languages}

For several languages, there is additional documentation in a separate file: see

\startitemize[packed]
\item For German, \type{dehyph-exptl.pdf}
\item For Spanish, \type{division.pdf}
\stopitemize

\def\lanname#1{\hbox to \textwidth{\bf#1\hss}}
\def\landata#1#2#3{\hbox to \textwidth{\hbox to 3mm{}\hbox to 6.5em{#1\hss}\hbox to 7em{#2}\hbox{#3}\hss} }

\lanname{English}
\landata{-}{\bf english}{usenglish, USenglish, american}
\landata{en-us}{usenglishmax}{}
\landata{en-gb}{ukenglish}{british, UKenglish}

\startcolumns[n=2]
\lanname{Afrikaans}
\landata{af}{afrikaans}{}
\lanname{Ancientgreek}
\landata{grc}{ancientgreek}{}
\landata{grc-x-ibycus}{ibycus}{}
\lanname{Arabic}
\landata{ar}{arabic}{}
\lanname{Armenian}
\landata{hy}{armenian}{}
\lanname{Assamese}
\landata{as}{assamese}{}
\lanname{Basque}
\landata{eu}{basque}{}
\lanname{Belarusian}
\landata{be}{belarusian}{}
\lanname{Bengali}
\landata{bn}{bengali}{}
\lanname{Bulgarian}
\landata{bg}{bulgarian}{}
\lanname{Catalan}
\landata{ca}{catalan}{}
\lanname{Chinese}
\landata{zh-latn-pinyin}{pinyin}{}
\lanname{Church Slavonic}
\landata{cu}{churchslavonic}{}
\lanname{Coptic}
\landata{cop}{coptic}{}
\lanname{Croatian}
\landata{hr}{croatian}{}
\lanname{Czech}
\landata{cs}{czech}{}
\lanname{Danish}
\landata{da}{danish}{}
\lanname{Dutch}
\landata{nl}{dutch}{}
\lanname{Esperanto}
\landata{eo}{esperanto}{}
\lanname{Estonian}
\landata{et}{estonian}{}
\lanname{Ethiopic}
\landata{mul-ethi}{ethiopic}{amharic, geez}
\lanname{Farsi}
\landata{fa}{farsi}{persian}
\lanname{Finnish}
\landata{fi}{finnish}{}
\column
\lanname{French}
\landata{fr}{french}{patois, francais}
\lanname{Friulan}
\landata{fur}{friulan}{}
\lanname{Galician}
\landata{gl}{galician}{}
\lanname{Georgian}
\landata{ka}{georgian}{}
\lanname{German}
\landata{de-1901}{german}{}
\landata{de-1996}{ngerman}{}
\landata{de-ch-1901}{swissgerman}{}
\lanname{Greek}
\landata{el-monoton}{monogreek}{}
\landata{el-polyton}{greek}{polygreek}
\lanname{Gujarati}
\landata{gu}{gujarati}{}
\lanname{Hindi}
\landata{hi}{hindi}{}
\lanname{Hungarian}
\landata{hu}{hungarian}{}
\lanname{Icelandic}
\landata{is}{icelandic}{}
\lanname{Indonesian}
\landata{id}{indonesian}{}
\lanname{Interlingua}
\landata{ia}{interlingua}{}
\lanname{Irish}
\landata{ga}{irish}{}
\lanname{Italian}
\landata{it}{italian}{}
\lanname{Kannada}
\landata{kn}{kannada}{}
\lanname{Kurmanji}
\landata{kmr}{kurmanji}{}
\lanname{Latin}
\landata{la}{latin}{}
\landata{la-x-classic}{classiclatin}{}
\landata{la-x-liturgic}{liturgicallatin}{}
\lanname{Latvian}
\landata{lv}{latvian}{}
\lanname{Lithuanian}
\landata{lt}{lithuanian}{}
\lanname{Malayalam}
\landata{ml}{malayalam}{}
\column
\lanname{Marathi}
\landata{mr}{marathi}{}
\lanname{Mongolian}
\landata{mn-cyrl}{mongolian}{}
\landata{mn-cyrl-x-lmc}{mongolianlmc}{}
\lanname{Norwegian}
\landata{nb}{bokmal}{norwegian, norsk}
\landata{nn}{nynorsk}{}
\lanname{Occitan}
\landata{oc}{occitan}{}
\lanname{Oriya}
\landata{or}{oriya}{}
\lanname{Panjabi}
\landata{pa}{panjabi}{}
\lanname{Polish}
\landata{pl}{polish}{}
\lanname{Piedmontese}
\landata{pms}{piedmontese}{}
\lanname{Portuguese}
\landata{pt}{portuguese}{portuges}
\lanname{Romanian}
\landata{ro}{romanian}{}
\lanname{Romansh}
\landata{rm}{romansh}{}
\lanname{Russian}
\landata{ru}{russian}{}
\lanname{Sanskrit}
\landata{sa}{sanskrit}{}
\lanname{Serbian}
\landata{sr-latn}{serbian}{}
\landata{sr-cyrl}{serbianc}{}
\lanname{Slovak}
\landata{sk}{slovak}{}
\lanname{Slovenian}
\landata{sl}{slovenian}{slovene}
\lanname{Spanish}
\landata{es}{spanish}{espanol}
\lanname{Swedish}
\landata{sv}{swedish}{}
\lanname{Tamil}
\landata{ta}{tamil}{}
\lanname{Telugu}
\landata{te}{telugu}{}
\lanname{Thai}
\landata{th}{thai}{}
\lanname{Turkish}
\landata{tr}{turkish}{}
\lanname{Turkmen}
\landata{tk}{turkmen}{}
\lanname{Ukrainian}
\landata{uk}{ukrainian}{}
\lanname{Uppersorbian}
\landata{hsb}{uppersorbian}{}
\lanname{Welsh}
\landata{cy}{welsh}{}
\stopcolumns

\blank[2*big]

Babel defines a few more synonyms (which consequently only work in \LaTeX):

\def\lansyn#1#2{\hbox to \textwidth{\hbox to 3mm{}\hbox to 6.5em{\bf#1\hss}\hbox{#2}\hss}}
\lansyn{english}{canadian}
\lansyn{british}{australian, newzealand}
\lansyn{german}{austrian}
\lansyn{ngerman}{naustrian, nswissgerman}
\lansyn{portuguese}{brazilian, brazil}

% TODO: bibliography

\stoptext

ext: tex


text:
\subsection{Evaluation of Objectives}
Not all of objectives originally set out for the program have been completed due to time-constraints on the programming and the need to rewrite the entire program from scratch.

\subsubsection{System}
The original target for performance was 60 frames per second with 500 bodies in the simulation when running on low end hardware, in fact the program is able to maintain this frame rate with closer to 1300 bodies, far more than I initially expected. The rendering does make use of very basic circular shapes so the main limitation here is the simulation computation.

\paragraph{}
As I am writing this, the application has currently not been built for Windows, because libraries have been used there is some complexity in setting up a build environment that is capable of building for 32-Bit Windows. All of the libraries are able to be built for 32-Bit Windows however. The Linux version that I currently have the build system set up is statically linking the libraries into the program, while this does increase the final size it means no external dependencies are required. (The compiled Linux binary is 1MB in size.)

\paragraph{}
During testing I had found that the simulation was still capable of basic past a distance of 1E22, however rendering was limited to rough point approximations at this point, the limitation was put in at 1E15, it is very unlikely a simulation of this size will be carried out, but this supports the full integer precision of double floating point. This scale allows for a full size simulation of the solar system to be entered into the program.

\subsubsection{Processing}

\paragraph{}
The way that the forces are calculated still makes use of the originally intended calculation, however a vector form is now used, removing the use of the trigonometric functions from the simulation, this likely increased the final performance, however the full use of the trigonometric functions has not been tested as a comparison. (Because of difficulties with sign.)

\paragraph{}
Collisions are implemented in the form of perfectly inelastic collisions where momentum is completely conserved, the final method also adds together the area of the bodies and calculates a new position based on the weighted mean mass.

\paragraph{}
It turns out that the original limit on memory is extremely high, in order to reach 100MB, the program requires about 210000 bodies in the simulation, this is by far extremely unlikely to ever be reached. At this number of bodies, performance is not in anyway practical. (On the previous system with the force matrix, this limit would be reached by just 3500 bodies.)

\paragraph{}
The final program makes use of basic OpenGL in order to accelerate the rendering of the interactive GUI and scenario. The program is making use of relatively old OpenGL, meaning it should be supported even on old hardware. (Another reason for this is that new (3.0+) OpenGL requires a lot more custom code to be written even for basic rendering.)

\paragraph{}
The system was designed around the idea of separating the main rendering and interface from the simulation, this was achieved by running the simulation on a second thread, meaning that the simulation can be completely loaded down and the rendering thread will still be completely responsive to inputs.

\paragraph{}
The simulation remained 2D, however the actual computational complexity that would be required to simulate in 3D is actually not that much, and would just require an extra set of operations for the z axis. The main issue would be ensuring that the interface is usable.

\subsubsection{User}
The final interface is close to the original plan, the user is able to place down bodies using the mouse or by way of the GUI. The values in the GUI can be adjusted by the keyboard or the mouse through features of AntTweakBar.

\paragraph{}
One of the major omissions from the final program is the ability to save and load scenarios from a file. While the initial format was set in the design stage, time constraints meant that the feature could not be included.

\paragraph{}
The simple graphics that have been implemented mean that the simulations should be quite visible on a projector, by default colours are white and have good contrast against the black background, the user has the ability to change the colour of these as intended.

\paragraph{}
Due to the difficulty that would be associated with allowing the user to change properties of objects while the simulation is running, the simulation must be paused before the user can make any changes to the bodies. One of the contributing factors to this is the way that the GUI library works, requiring direct access to variables in order to modify them, as well as how the data is updated. (It is difficult to get signals out of the GUI library that a value has been changed.)

\paragraph{}
The one saving grace here is that the variables that are not changed constantly by the simulation and only update one way, control variables such as gravitational constant and delta time, are possible to change on the fly. They have a relatively large range to allow for many different scales to be simulated, including real-scale.

\pagebreak

\subsection{User Feedback}
The final version of the program was demoed to Mr Snowden using the currently working Linux version. A small amount of feedback was given by email. \\
\hrule
\begin{small}
{\parskip=10pt

Hi Byron,

Thanks for demoing your program.

A great piece of work - well done!

If I were to be very picky, here's some feedback:

1) Excellent UI - powerful and very customisable, but not immediately intuitive

2) User needs a "quick start" guide if they are to be swiftly shown the power of the simulation - e.g. a library of exemplar starting point, such as a binary system, 2 colliding galaxies, etc.

3) Ideally, all parameters might be toggled with a "slider" and could be altered whilst the simulation was running.

4) An "undo" button would be very helpful (difficult to implement, I imagine)

5) The ability to pan/zoom whilst the simulation is running is very powerful and useful.

Hope this helps,

Best wishes,

SDS \\
}
\hrule
\end{small}
\subsubsection{Analysis of Feedback}
To start with, I will note that throughout this project, Mr Snowden has been incredibly positive about the project and the direction that it has gone in, I provided occasional updates to the progress of the project, evidence of which can be found in Appendix B.

\paragraph{}
On the feedback given here, I would agree that the UI does require some explanation, there is a basic description of its used in the user manual. (Not provided at time of getting feedback.) In my opinion after using AntTweakBar, as a developer I feel that the UI is quite clunky. I would probably err against using this library in the future, especially as the library has seen no active development since 2013.

\paragraph{}
There are some potential alternative routes that could be taken for the development of a much cleaner UI, both in terms of user presentation but also making programming easier, this is discussed in the possible extensions section.

\paragraph{}
The idea of having a quick start system inbuilt is something that I had intended on implementing, however the time was not available to do so. AntTweakBar has a utility which would allow the user to open up a help window which can be made to contain custom help text. This could serve as a basic quick start guide for the program.

\paragraph{}
I also feel that it would be useful to make use of the tool tip functionality that AntTweakBar allows for, putting text at the bottom of the Tweak Bar whenever a particular input box is moused over, this could provide a small amount of extra insight into the particular usage of a particular attribute, such as its minimum and maximum values.

\paragraph{}
Having a library of predefined scenarios is also something that could have some use, in essence it is fairly similar to the initial plan of having a system that allowed the storage and loading of scenarios from files. However in this case Mr Snowden is referring to having a window containing some predefined scenarios that can be selected.

\paragraph{}
This is a feature that would not take much to implement, as most of the ground work for this is already in place and while there is no ability currently to provide a preview of the simulation that will be loaded. It would be straightforward to have a button automatically clear the current scenario and then load in a hard coded simulation. This is not a particularly elegant approach but it would serve as a basic feature.

\paragraph{}
This feature ties in well to the potential need to investigate a GUI library that allows more custom features and could potentially allow for a small preview of the scenario to be displayed, either by reading in the scenario and actually producing a true representation or by an image file loaded in, the first is far more complex but has a lot more flexibility and extensibility.

\paragraph{}
Having an alternate form of adjusting the variables inbuilt into the GUI is something that could provide a more intuitive interface. Currently the AntTweakBar library does provide a 'roto-slider' which is a circular style slider which adjusts the value when the user rotates their mouse around a circle, however this is hidden and requires the user to click and hold on a small circle to activate it.

\paragraph{}
Having a linear slider next to values which allows a 'variable' joystick style drag where the speed at which the attribute changes is related to how far the slider is from the center, returning to the center when released.

\paragraph{}
Also of note is the idea of allowing adjustment of the scenario while it is running, while this would be possible, in the current UI, this would be quite difficult to achieve because it is difficult to get a trigger of when the variable actually changes.

\paragraph{}
An undo button is an interesting idea for a feature, and not something that I had initially considered. However in my time during the testing of the project, I agree that this would be a very useful feature to implement into the program and would save a lot of time should the user make a mistake. The main issue with including a feature such as this is figuring out where to 'save' the states. Saving the last user action might seem to be the most logical action. Keeping an extra set of data in memory would not be something that is to difficult to implement. (Having more than one undo states could start to pose more of a challenge, however it could be implemented using a stack.)

\subsection{Possible Extensions}
\subsubsection{UI}
As mentioned several times in the previous section, I feel strongly that the user interface requires a complete overhaul, starting from scratch using a completely different library. The issue comes in that it needs to be rendered inside the OpenGL context, something that reduces the amount of options somewhat.

\paragraph{}
Several alternatives do exist such as CEGUI (Crazy Eddie's GUI), which is an extremely flexible custom GUI library that allows for fully custom skins, it uses QT5 as a back-end (A very comprehensive and widely used standard GUI library), meaning that the GUI itself is described in an XML style format.
This also means that there is an graphical editor available for the design of the particular GUI. (CEED) The potential issue with this library is that there is a lot of work to actually do to get a basic UI working.

\paragraph{}
The benefit of this library it is written in C++, meaning that it does seem to make full use of the object-orientated language, something that could lead to implementing the library a lot easier.

\paragraph{}
Another more lightweight option may be NanoGUI, this is a very recently released library that is similar in design to AntTweakBar, but seems far more polished and could present a much simpler and more familiar interface to the user. Further investigation would need to be carried out before deciding on any particular library.

\paragraph{}
If a complete change in direction was made, one potential option would be to make use of a library like QT5, this is a GUI library that makes use of the normal window system of the current operating system, having a traditional fixed user interface with menus and boxes outside the normal OpenGL user interface could potentially allow for a much cleaner and more organised user interface, as well as giving a clearer view of the rendered display.

\subsubsection{Simulation}
\paragraph{}
Throughout this project I have made repeated reference to the importance and potential that is available in modern processors in the form of concurrent execution or parallel computing. The idea that multiple tasks can be carried out at the same time in order to compute more in a given amount of time. Theoretically, on a CPU that supports 4 concurrent executing threads, it should be possible to double the number of bodies and get a similar amount of performance out of the simulation. However this is a best case scenario and would require major changes to the algorithms being used.

\paragraph{}
During one point early in the project, I created a separate branch of code in which I tried to produce a multi-threaded simulation system. I found that I was only able to get a very small increase in performance and it seemed as though there was a large decrease in the stability of the simulation. These issues are likely related to incorrect programming of the system.

\paragraph{}
On a CPU, the benefits to be gained from multi-threading of the simulation are relatively limited, even on a machine supporting 12 threads, the 2000 bodies cap only rises to approximately 7000 bodies. While it is not something that could really apply to this project due to the hardware cost of such a system, I find the investigation of CUDA/OpenCL or GPU Computing to be quite an interesting route to take.

\paragraph{}
The main reason for this is that GPUs have core counts in the magnitude of 1000s, an example n-body simulator running on a current generation top end graphics card is capable of running a brute force 3D simulation of over 100000 bodies at 15 fps. The power also comes when the ability to use multiple graphics processors in tandem to further increase computational ability.

\paragraph{}
The difficulty comes in splitting up the bodies to be able to evenly distribute them, as well an managing separate memory stores, as an external GPU has its own separate bank of very high bandwidth memory. GPUs are optimised for doing a large amount of very simple calculations. Code that runs on a GPU must be written in a way that allows the exact same code to be run on every single GPU core, forcing a very different style of programming.

\paragraph{}
Another potential algorithms that doesn't apply itself all that well to this project is the Barnes Hut algorithm, this has been mentioned previously as something that can greatly reduce the computational complexity of very large simulations, albeit at added cost to memory. It reduces the time order complexity from $O(n^2)$ to $O(nlogn)$.

\paragraph{}
The algorithm works by dividing space up into a quadtree, similar in essence to a binary tree but each not has potential for 4 more nodes as opposed to 2, allowing space to be divided up into squares. Each node can contain a single body, if more than one body ends up getting added to the same square it divides up that space into more sections until each body is contained in its own square.

\paragraph{}
The management of the quadtree does add some overhead, particularly when it comes to memory costs, it also only really makes sense for very large simulations, which are unlikely to need to be used in this case.


text:
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{book}
\title{GI Surgical Oncology}
\author{Jonathan C Salo MD}
\date{2021-11-27}

\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
  pdftitle={GI Surgical Oncology},
  pdfauthor={Jonathan C Salo MD},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
\usepackage{booktabs}

\ifLuaTeX
  \usepackage{selnolig}  % disable illegal ligatures
\fi
\usepackage[]{natbib}
\bibliographystyle{apalike}

\begin{document}
\maketitle

{
\setcounter{tocdepth}{1}
\tableofcontents
}
\hypertarget{part-esophageal-cancer}{%
\part*{Esophageal Cancer}\label{part-esophageal-cancer}}
\addcontentsline{toc}{part}{Esophageal Cancer}

\hypertarget{introduction}{%
\chapter*{Introduction}\label{introduction}}
\addcontentsline{toc}{chapter}{Introduction}

We hope you find this orientation manual helpful. Please let us know about errors or needed updates.

\hypertarget{EsoIntro}{%
\chapter{Overview}\label{EsoIntro}}

Esophageal cancers can be grouped into 4 treatment categories:

\begin{itemize}
\tightlist
\item
  \protect\hyperlink{superficial}{Superficial} \(\rightarrow\) Endoscopic therapy
\item
  \protect\hyperlink{localized}{Localized} \(\rightarrow\) Primary surgery
\item
  \protect\hyperlink{locally_advanced}{Locally Advanced} \(\rightarrow\) Trimodality therapy
\item
  \protect\hyperlink{metastatic}{Metastatic} \(\rightarrow\) Systemic therapy
\end{itemize}

Patients with minimal dysphagia, no weight loss, and small (\textless3cm length) tumors are evaluated with endoscopic ultrasound:

\begin{itemize}
\tightlist
\item
  If uT1 on EUS and \textless2cm in size, \protect\hyperlink{emr}{endoscopic mucosal resection} yields more information and may be therapeutic for tumors with negative margins and without high-risk features.
\item
  If uT2N0 on EUS, and PET scan shows a small tumor (MTV \textless10cm\textsuperscript{3}), \protect\hyperlink{primary_surgery}{primary surgery} is preferred in patients who are good surgical risks
\item
  If T3 or N+ on EUS, if PET shows no metastatic disease, \protect\hyperlink{trimodality}{trimodality therapy} is optimal)
\end{itemize}

Patients with dysphagia to solids or weight loss or tumor length \textgreater3cm are unlikely to have T1-2 tumors and can be evaluated with \protect\hyperlink{pet}{PET scan}.

\begin{itemize}
\tightlist
\item
  If PET shows disease confined to the esophagus and regional nodes, \protect\hyperlink{trimodality}{trimodality therapy} (chemoradiation followed by surgery) is optimal.
\item
  If PET shows metastatic disease, patients are eligible for palliative chemotherapy with radiation for treatment of symptoms of dysphagia.
\item
  If PET shows extra-regional lymph node disease, patient is at high risk for distant disease and can be treated with induction chemotherapy followed by chemoradiation and surgical evaluation.
\end{itemize}

\hypertarget{staging}{%
\chapter{Staging}\label{staging}}

The staging workup begins once a diagnosis is made on endoscopy.

The first step is to make a preliminary determination whether the tumor is early stage (and can be treated with endoscopy or primary surgery) or later stage (and treated with chemoradiation followed by surgery or with)

The diagnostic studies needed for these treatment groups are different, so the workup can be make more efficient by sorting patients at presentation in to two groups:

Patients with minimal dysphagia, no weight loss, and tumors with less than 3cm cranio-caudal extent have a reasonable change of being T1 or T2 tumors. Tumors \textless3cm in length are much more likely to represent T1-2 lesions than those \(\geq\) 3cm\citep{hollis1114}

Superficial and Localized tumors generally present with minimal dysphagia or weight loss. These tumors may present with bleeding, or dysphagia without weight loss. For these patients, determining the precise T stage is important in their workup, so \textbf{endoscopic ultrasound} is the most frequent staging study after diagnosis.

Locally-advanced or metastatic tumors tend to present with dysphagia and weight loss. At first approximation, these tumors are usually clinical T3 lesions, and the important bifurcation in their treatment is the presence or absence of metastatic disease. For patients with dysphagia and weight loss, \textbf{PET} is the most frequent initial staging study after diagnosis.

Patients who present with dysphagia are likely to have T3 or T4 disease, which is generally treated with neoadjuvant chemoradiation followed by surgery. Data from Memorial Sloan Kettering {[}Ripley 226{]} among 61 patients with esophageal cancer who presented with dysphagia, 54 (89\%) were found on EUS to have uT3-4 tumors. On the other hand, among 53 patients without dysphagia, 25 (47\%) were uT1-2, and were potentially candidates for primary surgery. Their conclusion was that EUS could be omitted from the workup of patients with dysphagia, but is useful in patients without dysphagia.

PET can be helpful in evaluating patients who may have T1-2 disease, and might be candidates for primary surgical therapy. A comparison of PET and EUS {[}malik,claxton,1{]} showed that uT1-2 tumors had median metabolic tumor volume (MTV) of 6.7cm\textsuperscript{3}, compared with uT3-4 tumors, with a median SUV of 35.7cm\textsuperscript{3}.

\hypertarget{superficial}{%
\chapter{Superficial Esophageal Cancer}\label{superficial}}

Superficial esophageal cancer is usually asymptomatic, which means that the diagnosis is generally made in the context of surveillance for Barrett's esophagus.

Nodular Barrett's esophagus can be best evaluation with endoscopic mucosal resection, which can provide further staging information if an adenocarcinoma is found, such as depth of invasion, differentiation, and lymphovascular invasion.

Larger lesions should first be evaluated with endoscopic ultrasound (EUS)?

EUS is less sensitive for T1 lesions \citep{bergeron765} -\textgreater{} use EMR for diagnosis \citep{maish1777}

(Should nodular Barrett's be evaluated with EUS prior to EMR?)

T1a tumors have a low risk of nodal metastasis \citep{dunbar850}

\hypertarget{emr}{%
\section{Endscopic Mucosal Resection (EMR)}\label{emr}}

For patients with nodular Barrett's esophagus or small tumors judged to be T1 by endoscopic ultrasound, endoscopic mucosal resection (EMR) can be diagnostic and potentially curative.\citep{thomas1609}

EMR also helps establish the difference between T1a and T1b compared with pathology \citep{worrell484}

EMR is likely sufficient for small tumors with favorable patholgic factors\citep{pech652} \citep{nurkin1090}:

\begin{itemize}
\tightlist
\item
  Size less than 2cm
\item
  Lateral and deep margins clear
\item
  Absence of lymphovascular invasion
\item
  Well- or moderately- differentiated
\end{itemize}

EMR: \citep{soetikno4490}

See MOlina JTCVS 153:1206

EMR for high-grade dysplasia \citep{shaheen2277}

EMR for low-grade dysplasia \citep{phoa1209} resulted in 25\% riskd reduction in progression go HGD.

Endoscopic submucosal dissection is a technique for deeper endoscopic removal of esophageal lesions using endoscopic cautery, which dissects through the submucosa. ESD has a higher rate of curative resection \citep{cao751} albiet at the cost of prolonged operative times and increased risk of complications such a bleeding. \citep{repici715}

ESD takes more time and has higher R0 resection rate but similar recurrence erate at 2 eyars \citep{terheggen783}

Need for RFA of Barrett's after EMR: \citep{haidry87} Combination therapy with EMR and RFA results in lower rate of recurence than EMR alone.\citep{pech1200}

RFA for Barrett's national registry \citep{ganz35}

\hypertarget{localized}{%
\chapter{Localized Tumors}\label{localized}}

\hypertarget{t1b-tumors}{%
\section{T1b Tumors}\label{t1b-tumors}}

\hypertarget{t2n0-tumors}{%
\section{T2N0 Tumors}\label{t2n0-tumors}}

Multiple studies have failed to show the additional benefit of chemotherapy or chemoradiation for pT2N0M0 esophageal cancer patients treated with radiation.

Neoadjuvant chemo not likey to be helpful for early stage disease - FFCD 9901 {[}Mariette 2416{]} enrolled patients with T1-2 or T3N0 tumors to chemoradiation followed by surgery versus surgery alone. The majority of the tumors (72\%) were squamous cell carcinoma.Postoperative mortality was significaly increased in the chemoradiation arm (11.1\% vs 3.4\%).

Meta-analysis of 5265 patients in 10 studies showed that while neoadjuvant therapy was associated with a reduction in positive margin rate, there was no difference in terms of recurrence or survival.{[}MOta 176{]}

French trial FREGAT\citep{markar59}

Retrospective review of the National Cancer DataBase failed to demonstrate a difference in survival of cT2N0M0 esophageal cancer with or without preoperative chemoradiation.\citep{speicher1195}

A retrospective report from Johns Hopkins examined outcomes of T2N0 squamous cell carcinoma patients and showed equivalent outcomes for primary surgery vs neoadjuvant chemoradiation followed by surgery \citep{zhang429}

\hypertarget{staging-of-t2n0-tumors}{%
\section{Staging of T2N0 Tumors}\label{staging-of-t2n0-tumors}}

The challenge for treatment decision-making is the limited sensitivity of endoscopic ultrasound in ruling out pT3 or pN+ disease. In other words, if a patient who is thought to have cT2N0 disease undergoes resection, and is found on pathology to have pT3 or pN\textsuperscript{+} disease, this would dictate the need for postoperative chemoradiation. In general, chemoradiation after esophagectomy is difficult for patients to tolerate, with a \_\_\_ \% chance of failure to complete therapy.

Data from the Cleveland Clinic looked at 53 patients judged to be T2N0 by endoscopic ultrasound (uT2N0) were treated with primary surgery. Pathologic examination showed that 17 (37\%) were understaged by endoscopic ultrasound, and were pathologic (pT3) in 4 or node positive (pN\textsuperscript{+}) in 13 cases. These patients were treated with postoperative adjuvant chemoradiation.\citep{rice317}

It is critical, therefore, in patients for whom primary surgery is contemplated, to attempt to identify those with occult T3 or N+ disease.

Patients who appear to have limited stage disease benefit from evaluation with a combination of

See also \url{PMID:25047477}

(MTV)

(Tumor Length)

(dysphagia)

\#\#Primary Surgery \{\#primary\_surgery\}

NCCN recommends PET scanS

Most common sites of metastasis are liver, lung, bones, adrenal.

PET detects occult metastasis in 10-20\% of cases \citep[\citet{kim403}]{kato921}. Among 129 patients with esophageal cancer, PET detected additional sites of disease in 41\% and changed management in 38\% \citep{chatterton354}

PET for restaging detects interval development of metastatic disease in 8-17\% of cases \citep{vanvliet547}

\hypertarget{locally_advanced}{%
\chapter{Locally Advanced Cancer}\label{locally_advanced}}

Tumors that are T2N\textsuperscript{+}M0 or T3NxM0 are considered locally-advanced. The high rate of failure with surgery alone has led to development of adjunctive therapies.

\hypertarget{trimodality}{%
\section{Trimodality Therapy}\label{trimodality}}

Trimodality therapy consists of chemoradiation followed by surgery.

CROSS trial randomized 364 patients with resectable esophageal and gastroesophageal junction tumors (75\% adenocarcinoma) to neoadjuvant chemoradiation consisting of 4,140 cGy of radiation with concurrent carboplatin and paclitaxel or surgery alone.\citep{vanhagen2074} Clinical node-positive disease was present in 16\%. Pathologic complete response was seen in 23\% of adenocarcinoma and 49\% of squamous cell carcinomas. Median overall survival was 49 months after trimodality vs 24 months after surgery alone (p=0.003). Squamous cell carcinomas appeared to have particular benefit, with a hazard ratio of 0.42 for squamous cell vs 0.74 for adenocarcinoma. Median survival was improved for adenocarcinoma from 27.1 months to 43.2 months, but the median survival for squamous cell increased from 27.1months to 81.6 months for squamous cell. Rate of R0 resection was higher with chemoradiation (92\% vs 69\% p\textless0.001) andlocal recurrence rates lower (14\% vs 34\% P\textless0.001), and peritoneal recurrence lower (4\% vs 14\% P\textless0.001). Despite the relatively low dose of radiation, in-field recurrences were less than 5\%. The primary cause of failure was distant disease (31\%) and local/regional failure (14\%).\citep{oppedijk385}

Alternative to carbotaxol is FOLFOX (SOG trial \citep{leichman4555})

Ogoing PROTECT trial ompares FOLFOX to paclitaxel and carbo \citep{messager318}

\hypertarget{neoadjuvant-chemort-for-scca}{%
\subsection{Neoadjuvant chemoRT for SCCA}\label{neoadjuvant-chemort-for-scca}}

NeoCRTEC5010 \citep{yang2796}

Meta-abalysis of chemoRT vs chemo \citep{zhaoe0202185}

\hypertarget{chemort-vs-trimodality-therapy}{%
\section{ChemoRT vs Trimodality therapy}\label{chemort-vs-trimodality-therapy}}

The sensitivity of squamous cell carcinoma of the esophagus to chemoradiation has raised the question whether

Stahl Locally advanced squamous cell carcinoma randomized to induction chemotherapy (cisplatin, etopiside, 5FU with leuocovrin) followed by chemoradiation (4000cGy with concurrent ciplatin and etopiside) followed by surgery compared with induction chemotherapy followed by chemoradiation (6400cGy with concurrent cisplatin and etopiside).\citep{stahl2310} progression-free survival was better in the trimodality group (64.3\% vs 40.7\%) Treatment-related morality was substantial in the surgery arm (13\% vs 4\%). This would be considered an excessive rate of operative mortality by modern standards. Unsurprisingly, there was no difference in overall survival between groups, in part because the surgical group had an excess 9\% mortality rate from treatment. Two-year survival in the surgery arm was 40\% vs 35\% in the definitive chemoradiation arm. \citep{stahl4530}

In the French FFCD trial, 444 patients with carcinoma of the esophagus (90\% squamous cell) were treated with two cycles of 5-FU and cisplatin with concurrent radiation.\citep{bedenne1160} Patients with a partial or complete clinical response to chemoradiation were randomized to either surgery or a boost of radiation. Patients who did not respond to chemoradiation were treated with surgery and were eliminated from the study. Only 259 of the original 444 patients (59\%) went on to randomization, with the remainder (those not responding to chemoradiation) treated with surgery. Of the randomized group, median survival was 17.7months in the surgery arm versus 19.3months in the definitive chemoradiation arm. Like the Stahl study, treatment-related mortality in the surgical arm was high (9\% versus 1\%).

\hypertarget{neoadjuvant-chemotheraphy-followed-by-surgery}{%
\subsection{Neoadjuvant chemotheraphy followed by surgery}\label{neoadjuvant-chemotheraphy-followed-by-surgery}}

POET Trial (Pre-Operative therapy in Esophageal adenocarcinoma Trial) treated patients with adenocarcinoma of the gastroesophageal junction with either neoadjuvant chemotherapy (5-FU, leucovorin, cisplatin) followed by surgery or induction chemotherapy with the same agents, followed by chemoradiation (4000cGy with concurrent cisplatin and etoposide). The study failed to meet its accrual goal, but there was a suggestion of improved 3-year survival with preoperative chemoradiation (47.4\% vs 27.7\% \emph{p}=0.07) as well as improved local control (76.5\% vs 59\%). In addition, chemoradiation was associated with a higher pathologic complete response rate (15.6\% vs 2\%)\citep{stahl851}. A meta-analysis of 33 randomized trials further suggested a greater benefit from neoadjuvant chemoradiation followed by surgery compared with neoadjuvant chemotherapy followed by surgery\citep{pasquali481} and a similar meta-analysis \citep{sjoquist681}

\#Active Surveillance

EGD is poor predictor of pCR \citep{sarkaria764}

\hypertarget{ge-junction}{%
\section{GE Junction}\label{ge-junction}}

\citep{siewert260}

\hypertarget{induction-chemotherapy-followed-by-chemort}{%
\section{Induction chemotherapy followed by chemoRT}\label{induction-chemotherapy-followed-by-chemort}}

See NCCN pages M-25 and M-26

Stahl \citep{stahl851} randomized patients to preoperative chemotherapy (A) vs preoperative chemotherapy followed by preoperative chemoradiation (B). Higher pcR rate in arm B (15.6\% vs 2\%) and ypN0 resection (64.4\% vs 37.7\%).

\hypertarget{postoperative-chemoradiation}{%
\section{Postoperative chemoradiation}\label{postoperative-chemoradiation}}

Intergroup-0116 \citep{macdonald725} \citep{smalley2327} treated 556 patients with adenocarcinoma of the stomach or GE junction with surgery along vs surgery followed by postoperative chemoradiation. After a median followup of over 5 years, median overall survival iin the surgery alone group was 27 months vs 36 months in the postoperative chemoradiation group (p=0.005) Decrease in local failure as the first site of failure in the chemoradiation group (19\% versus 29\%).

Chemoradiation afte resectdion of GE junction tumors \citep{kofoed26} among a group of 211 patients with GE junction adenocarcinoma with positive lymph nodes with improved 3-year disease-free survival (37\% s 24\%).

\hypertarget{definitive-chemort}{%
\chapter{Definitive ChemoRT}\label{definitive-chemort}}

\hypertarget{phase-ii-studies}{%
\section{Phase II Studies}\label{phase-ii-studies}}

Experience with patients who refuse surgery or are medically unfit:

\citep{taketa300} \citep{taketa95} \citep{furlong107}

Castoro\citep{castoro1375}

preSANO\citep{chirieac1347} Clinical Response evaluation after chemoRT for esophageal cancer with PET and EGD.

\hypertarget{chemort-vs-trimodality-therapy-1}{%
\section{ChemoRT vs Trimodality therapy}\label{chemort-vs-trimodality-therapy-1}}

The sensitivity of squamous cell carcinoma of the esophagus to chemoradiation has raised the question whether

Stahl Locally advanced squamous cell carcinoma randomized to induction chemotherapy (cisplatin, etopiside, 5FU with leuocovrin) followed by chemoradiation (4000cGy with concurrent ciplatin and etopiside) followed by surgery compared with induction chemotherapy followed by chemoradiation (6400cGy with concurrent cisplatin and etopiside).\citep{stahl2310} progression-free survival was better in the trimodality group (64.3\% vs 40.7\%) Treatment-related morality was substantial in the surgery arm (13\% vs 4\%). This would be considered an excessive rate of operative mortality by modern standards. Unsurprisingly, there was no difference in overall survival between groups, in part because the surgical group had an excess 9\% mortality rate from treatment. Two-year survival in the surgery arm was 40\% vs 35\% in the definitive chemoradiation arm. \citep{stahl4530}

In the French FFCD trial, 444 patients with carcinoma of the esophagus (90\% squamous cell) were treated with two cycles of 5-FU and cisplatin with concurrent radiation.\citep{bedenne1160} Patients with a partial or complete clinical response to chemoradiation were randomized to either surgery or a boost of radiation. Patients who did not respond to chemoradiation were treated with surgery and were eliminated from the study. Only 259 of the original 444 patients (59\%) went on to randomization, with the remainder (those not responding to chemoradiation) treated with surgery. Of the randomized group, median survival was 17.7months in the surgery arm versus 19.3months in the definitive chemoradiation arm. Like the Stahl study, treatment-related mortality in the surgical arm was high (9\% versus 1\%).

\#Active Surveillance

EGD is poor predictor of pCR \citep{sarkaria764}

\hypertarget{radiation-for-esophageal-cancer}{%
\chapter{Radiation for esophageal cancer}\label{radiation-for-esophageal-cancer}}

RTOG 94-05 clinical trial \citep{minsky1167}

\hypertarget{salvage-esophagectomy}{%
\section{Salvage esophagectomy}\label{salvage-esophagectomy}}

\citep{markar922}

\citep{swisher175}

\hypertarget{surgery}{%
\chapter{Surgery}\label{surgery}}

Three general approaches exist for surgical therapy.

Trans-thoracic or Ivor Lewis esophagectomy\citep{visbal1803} removes the intrathoracic portion of the esophagus and constructs an anastomosis within the chest. The approach include an abdominal phase, during which an esophageal substitute is constructed (usually from stomach). A thoracic phase then removes the intrathoracic esophagus and constructs an anastomosis within the chest cavity.

A McKeown esophagectomy utilizes three surgical fields: abdomen, right chest, and neck. The right chest approach allows dissection of peri-esophageal lymph nodes, and the cervical incision allows removal of the total esophagus.\citep{mckeown259} This approach is useful for tumors which involve the proximal thoracic esophagus, to ensure a negative margin. The cervical anastomosis carries a higher risk of anastomotic leak than a thoracic anastomosis, although the morbidity of a cervical anastomosis leak is less serious than that of a leak of a thoracic anastomosis.

A transhiatal esohpagectomy approaches the esophagus from the abdomen through the hiatus and from neck. By blunt dissection the esophagus is freed up without the need for thoracotomy. An esophageal substute is then brought from the abdomen to the neck through the mediastinum\citep{orringer643} \citep{orringer363}\textless! -- Orringer Ann Surg 2007 --\textgreater{} The operation is designed to avoid the pulmonary toxicity of the right chest approach. On the other hand, the blunt nature of the mediastinal dissection means that fewer lymph nodes are harvested than with a trans-thoracic approach.

Randomized trial of transthoracic esophagectomy with extended lymph node dissection versus transhiatal esohpagectomy showed fewer pulmonary complications with the transhiatal approach. \citep{hulscher1662} Fewer lymph nodes were havested with a transhiatal appraoch. A post-hoc analysis showed that among patients with 1-8 positive lymph nodes, survival with improved with the extended lymph node dissection.\citep{omloo992}

Minimally-invasive approaches to esophagectomy are now common, with evidence for less perioperative morbidity than an open approach \citep{biere1887} \citep{zhoue0132889}

Randomized trial of a hybrid MIE (with laparoscopy and thoracotomy) was associated with lower postoperative complications than open esophagectomy \citep{mariette152}

High volume \citep{birkmeyer2117} \citep{wouters1789}

Siwert III lesions are considered gastric cancers \citep{rusch444} \citep{siewert260}

Laparoscopy may be helpful in Siewert III tumors \citep{degraaf988}

\hypertarget{preoperative-evaluation}{%
\subsection{Preoperative Evaluation}\label{preoperative-evaluation}}

Dysphagia can be scored accordgin to Mellow et al \citep{mellow1443}:

\begin{itemize}
\tightlist
\item
  0 No dysphagia
\item
  1 Dysphagia to normal solids
\item
  2 Dysphagia to soft solids (ground beef, poultry,fish)
\item
  3 Dysphagia to solids and liquids
\item
  4 Inability to swallow saliva
\end{itemize}

\hypertarget{minimally-invasive-esophagectomy}{%
\section{Minimally-invasive Esophagectomy}\label{minimally-invasive-esophagectomy}}

Higher lymph node yield with MIE vs open approach {[}Kalff{]}

\hypertarget{transthoracic}{%
\section{Transthoracic}\label{transthoracic}}

\hypertarget{transhiatal}{%
\section{Transhiatal}\label{transhiatal}}

\hypertarget{three-hole}{%
\section{Three-hole}\label{three-hole}}

\hypertarget{extended-lymphadenectomy}{%
\section{Extended lymphadenectomy}\label{extended-lymphadenectomy}}

\hypertarget{eso_metastatic}{%
\chapter{Metastatic}\label{eso_metastatic}}

\hypertarget{palliative-radiation}{%
\section{Palliative radiation}\label{palliative-radiation}}

Palliative radiation vs chemoradiation \citep{penniment114}

Radiation along favored over chemoradiation in the palliaitve setting \citep{penniment114}

\hypertarget{chemoradiation-vs-chemotherapy-in-stage-iv}{%
\section{Chemoradiation vs chemotherapy in Stage IV}\label{chemoradiation-vs-chemotherapy-in-stage-iv}}

\citep{guttmann1131}

\hypertarget{stents-for-malignant-disease}{%
\chapter{Stents for malignant disease}\label{stents-for-malignant-disease}}

\citep{vakil1791}

Review of guidelines 2010 Am Society GI \citep{sharma258}

\hypertarget{eso_surveillance}{%
\chapter{Surveillance}\label{eso_surveillance}}

\hypertarget{t1a-treated-with-endoscopic-resection}{%
\section{T1a treated with endoscopic resection}\label{t1a-treated-with-endoscopic-resection}}

EGD every 3 mo for first year, then every 6 months for second year, then annually\citep{shaheen30}

\hypertarget{tib-treated-with-endoscoic-resection}{%
\section{Tib treated with endoscoic resection}\label{tib-treated-with-endoscoic-resection}}

EGD every 3 mon for first year, then every 4-6 months for seond year, then annually
CT chest/abdomen every 12 months for up to 3 years (as clinically indicated)

\hypertarget{t1b-treated-with-esophagectomy}{%
\section{T1b treated with esophagectomy}\label{t1b-treated-with-esophagectomy}}

EGD every 3-6 months for first 2 years, then annually for 3 more years.
CT every 6-9 months for first 2 years, then annually up to 5 years.

\hypertarget{stage-ii-or-iii-treated-with-chemoradiation.}{%
\section{Stage II or III treated with chemoradiation.}\label{stage-ii-or-iii-treated-with-chemoradiation.}}

These patients are at risk for local recurrence \citep{sudo3400} and some may be candidates for salvage esophagectomy. Most relapses (95\%) occur within 24 months. See also \citep{taketa1139}

\hypertarget{locally-advanced-treated-with-trimodality-therapy}{%
\section{Locally-advanced treated with trimodality therapy}\label{locally-advanced-treated-with-trimodality-therapy}}

Local/regional relapses are uncommon. \citep{dorth2099} \citep{oppedijk385} \citep{sudo4306} =\textgreater{} NCCN does not recommend EGD. 90\% of relapses occur within 36 months of surgery.

CT every 6 months up to 2 years (if patient is a candidate for additional curative-intent therapy)

\hypertarget{eso_survivorship}{%
\chapter{Survivorship}\label{eso_survivorship}}

\hypertarget{nutritional-consequences}{%
\section{Nutritional consequences}\label{nutritional-consequences}}

\citep{baker987}

Weight loss
\citep{martin1308}
\citep{ouattara1088}

\hypertarget{cardiac-toxicity-of-radiation}{%
\section{Cardiac toxicity of radiation}\label{cardiac-toxicity-of-radiation}}

\citep{beukema85} \citep{frandsen516} \citep{gharzaie0158916}

\hypertarget{part-gastric-cancer}{%
\part*{Gastric Cancer}\label{part-gastric-cancer}}
\addcontentsline{toc}{part}{Gastric Cancer}

\hypertarget{overview}{%
\chapter{Overview}\label{overview}}

\hypertarget{gast_superficial}{%
\chapter{Superficial}\label{gast_superficial}}

\hypertarget{locally-advanced-gastric}{%
\chapter{Locally-Advanced Gastric}\label{locally-advanced-gastric}}

Locally-advanced gastric cancer (T3 or N\textsuperscript{+}) is generally treated with some form of adjuvant therapy, which has been shown to improve upon the outcomes with surgery alone.

\hypertarget{preoperative-chemotherapy}{%
\section{Preoperative Chemotherapy}\label{preoperative-chemotherapy}}

FLOT chemotherapy \citep{al-batran1948}

MAGIC study randomized 503 patients to perioperative `sandwich' therapy consisting of epirubicin, cisplatin, and 5-FU versus surgery alone. In the perioperative chemotherapy group, 4 cycles were administered prior to surgery, and 4 cycles afterwards. Tumors of the esophagus or gastroesophageal junction comprised 26\% of the study population. While over 90\% of patients assigned to the chemotherapy arm completed their preoperative chemotherapy, only 66\% completed their postoperative therapy. Survival at 5 years was 36\% in the perioperative chemotherapy group, compared with 24\% in the surgery group (p\textless0.001).\citep{cunningham11}

CLASSIC clinical trial randomized 1033 patients with stage II or III gastric cancer after D2 gastrectomy to 6 months of adjuvant chemotherapy versus surgery alone. Three-year survival was improved in the chemotherapy group (74\% \emph{v} 59\%).\citep{bang315}

The FFCD trial randomized patients to preoperative chemotherapy with 2 or 3 yccles of cisplatin and 5-FU versus surgery alone. Tumors of the lower esophagus or gastroesophageal junction comprised 75\% of the study population. Survival at 5 years was longer in the chemotherapy group (38\%) versus 24\% in the surgery alone group (p=0.02).\citep{ychou1715}

\hypertarget{postoperative-chemotherapy}{%
\section{Postoperative chemotherapy}\label{postoperative-chemotherapy}}

CLAASIC trial \citep{noh1389} \citep{bang315} patients with II or IIIB gastric cancer received gastrectomy with D2 node dissection randomized to postoperative chemotherapy with capecitabine and oxaliplatin. Chemotherapy group had improved 3-year DFS (74\% vs 59\% P\textless.0001)

\hypertarget{locally-advanced-gastric-ca}{%
\chapter{Locally Advanced Gastric Ca}\label{locally-advanced-gastric-ca}}

\hypertarget{postoperative-chemoradiation-1}{%
\section{Postoperative chemoradiation}\label{postoperative-chemoradiation-1}}

Intergroup 0116 trial \citep{macdonald725}
Surgical quality control was poor, as 90\% were treated a limited lymph node dissection. Long-term followup, however \citep{smalley2327} showed a persistent benefit of postoperative chemoradiation.

ARTIST trial 450 patients treated with a D1 \(\alpha\) gastrectomy were randomized to adjuvant capcitibine and cisplatin versus chemoradiation consisting of two cycles of capcitabine/oxalipaltin followed by chemoradiation followed by chemotherapy. Overall 3- year survival did differ between groups (78.2\% vs 74.2\% p =0.86). A post-hoc analysis of patients with positive nodes showed a beneficial effect of chemoradiation (77.5\% \emph{v} 72.3\% p=0.365).\citep{lee268}

CRITICS trial treated all patients with preoperative chemoterhapy followed by surgery. Postoperative patients were then randomized between additional chemotherapy versus chemoradiation.

\hypertarget{preoperative-chemoradiation}{%
\section{Preoperative chemoradiation}\label{preoperative-chemoradiation}}

\citep{ajani3953}

\hypertarget{neoadjuvant-chemotherapy-for-colon-cancer}{%
\chapter{Neoadjuvant Chemotherapy for colon cancer}\label{neoadjuvant-chemotherapy-for-colon-cancer}}

Seymour MT, Morton D. FOxTROT: an international randomised controlled trial in 1052 patients (pts) evaluating neoadjuvant chemotherapy (NAC) for colon cancer. J Clin Oncol. 2019 May;37(15 Suppl):3504-3504.

\hypertarget{extended-node-dissection-for-colon-cancer}{%
\chapter{Extended Node dissection for colon cancer}\label{extended-node-dissection-for-colon-cancer}}

Short-term outcomes of complete mesocolic excision versus D2 dissection in patients undergoing laparoscopic colectomy for right colon cancer (RELARC): a randomised, controlled, phase 3, superiority tria

Short-term outcomes of a multicentre randomized clinical trial comparing D2 versus D3 lymph node dissection for colonic cancer (COLD trial).
Karachun A, Panaiotti L, Chernikovskiy I, Achkasov S, Gevorkyan Y, Savanovich N, Sharygin G, Markushin L, Sushkov O, Aleshin D, Shakhmatov D, Nazarov I, Muratov I, Maynovskaya O, Olkina A, Lankov T, Ovchinnikova T, Kharagezov D, Kaymakchi D, Milakin A, Petrov A.
Br J Surg. 2020 Apr;107(5):499-508. doi: 10.1002/bjs.11387. Epub 2019 Dec 24.
PMID: 31872869 Clinical Trial.

  \bibliography{XPS.bib}

\end{document}


text:
\subsection{Empirical Bayes}

\subsubsection{Bayes rule}

We can calculate the posterior probability for \(\theta \), but we need a prior \(P(\theta )\).

\(P(\theta | X)=\dfrac{P(X|\theta )P(\theta )}{P(X)}\)

\subsubsection{Empirical Bayes}

With empirical Bayes we get our prior from the data.

We have \(P(X|\theta )\)

And \(P(\theta |\rho )\)

We observe \(X\) and want to estimate \(\theta \).

\(P(\theta |X)=\dfrac{P(X|\theta)P(\theta )}{P(X)}=\dfrac{P(X|\theta)}{P(X)}\int P(\theta | \rho )P(\rho )d\rho \)

max_stars_repo_name: adamdboult/nodeHomePage

max_issues_repo_name: adamdboult/nodeHomePage

max_forks_repo_name: adamdboult/nodeHomePage


text:
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{csquotes}

\title{Homework 4: Multi-label Classification}
\author{
  Shishido, Juan\\
  \texttt{juanshishido}
}

\begin{document}
\maketitle

\section{Introduction}

In multi-\textit{label} classification, each instance is assigned a set of
labels. This is suitable for text data, for example, where each document might
be about several topics. In this assignment, we explore two possible approaches
to multi-label classification, discussing how each method handles the
correlations that exist between labels or features and how each method scales
as the cardinality of $y$ increases.

\section{Model I}

In the first approach, each combination of labels---that is, each unique
\textit{vector} of labels---is considered its own class. Each resulting
``class'' is trained with its own classifier, using a one-vs.-rest approach.
This representation allows any classifier capable of multi-\textit{class}
classification to be used. Using logistic regression, for example, the
predicted vector of labels for a given instance would correspond to the
``class'' with the highest probability across the various classifiers. While
this method accounts for correlations in the labels, there are several
drawbacks. The \textit{minimum} number of classifiers that must be trained, for
instance, is equal to the number of unique labels. In practice, though, this
will be much higher. Second, with the large number of potential combinations,
it is likely that the number of instances for a given ``class'' is small. This
makes it more difficult for a classifier to discern class membership. This
problem is related to the ``Curse of Dimensionality.''

\section{Model II}

Given the issues with cardinality in Model I, the second approach seeks to
reduce the dimensionality of $y$ by using principle component analysis (PCA).
Up to now, we have not described the form of $y$. For a given instance, $y$ is
a vector $\vec{y}$. However, across the data set, $y$ is an $n \times m$ matrix,
where $n$ is the number of samples and $m$ is the number of unique labels. This
label matrix would be projected onto a lower-dimensional space, reducing the
cardinality of $y$. A classifier is then trained on these ``reduced'' labels.
Finally, these labels are transformed to the original label-space. This
approach is able to handle the correlation in the labels and is able to scale
with the cardinality of $y$.

\end{document}