text:
\documentclass[a4paper,12pt]{article}

% Font
\usepackage[T1]{fontenc}
\usepackage{gentium}

% Math packages
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{bm}

% Define symbol shortcuts
\newcommand{\cc}{\mathcal{C}}
\newcommand{\dd}{\mathcal{D}}
\newcommand{\hh}{\mathcal{H}}
\newcommand{\xx}{{\bm x}}
\newcommand{\yy}{{\bm y}}

% Math environment
\newtheorem*{thm}{Theorem}

% Better list management:
% - vertical spacing in lists
% - items in lists start with dash not bullet point.
\usepackage{enumitem}
\setlist{label=\textemdash,
  itemsep=0pt, topsep=3pt, partopsep=0pt}

% Include graphics
\usepackage{graphicx}
\graphicspath{ {figures/} }
\usepackage{subcaption}

% Page format
\usepackage[top=2cm,left=2cm,right=2cm,bottom=2cm]{geometry}
\setlength{\parindent}{0pt}

\begin{document}
%%% HEADER
\raisebox{0.6in}[0in]{\makebox[\textwidth][r]{\it Unproofed version }}
\vspace{-0.7in}

\begin{center}
\bf\large MA2823: Foundations of Machine Learning \\
Chapter 4: Bayesian Learning Theory
\end{center}

\noindent
Lecturer: Chlo\'e-Agathe Azencott
\hfill
Scribes: LOH Mathias \\
\null \hfill KIM Taehyun \\
\null \hfill MEHDI Tomas

\noindent
\rule{\textwidth}{1pt}

\medskip

%%% NOTES START HERE
\section{Introduction}
In this chapter, we aim to \textit{apply Bayes rule} for simple inference and decision problems and explain the correlation between \textit{Bayes decision rule, empirical risk minimization, maximum a priori and maximum likelihood.} In doing so, express conditional independence among random variables and finally, we aim to apply \textit{Naive Bayes algorithm}.
\section{Bayes Decision Theory}
\subsection{Probability and inference}
\textbf{Definition.}$\quad$We define a random variable $X: \Omega \rightarrow E$ an application from the set of possible outcome $\Omega$ to some set $E$. \\

Although $X$ is usually a real-valued function ($E=\mathbb{R}$), it \textit{does not} return a probability. Rather, $X$ describes some numerical property that outcomes in $\Omega$ may have - e.g, the number of heads in a random collection of coin flips. The probability that $X$ takes value $\leq 3$ is the measure of the set of outcomes $\{\omega \in \Omega : X(\omega) \leq 3\}$, denoted $P(x\leq3)$ \\

\textbf{Example (Coin toss).}$\quad$Let us suppose the result of tossing a coin is $x \in \{heads , tails\}$. Because this is a random process, we have \textit{incomplete information about it}. Since the result is either heads or tails, we can define this as a random variable $X$ to follow that of a \textit{Bernoulli distribution}, defined by
\begin{equation*}
X =
\begin{cases}
1, & \text{outcome is heads}\\
0, & \text{outcome is tails}
\end{cases}
\end{equation*}
To find the probability of obtaining $x$, we just have to find the probability $P(X=x)$
\subsection{Classification}
\textbf{Definition.}$\quad$ We define $C = (C_1, ..., C_k) \in \mathbb{R}^k $ the family of classes in our classification problem and a family of random variables $\xx = (X_1, ..., X_k)$ observable data which we believe is sufficient in giving us ample information about each of our classes $C_i$.\\

\textbf{Example (Credit-scoring).$\quad$} In banks, according to their past transactions, some customers are \textit{low-risk} in that they paid back their loans and the bank profited from them and other customers are \textit{high-risk} in that they defaulted. The bank would thus like to learn the class "high-risk customer"so that in the future, when there is a new application for a loan, we can check that the person obeys the class description or not and thus accept or reject the application. \\

\pagebreak
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{creditscoring}
\caption{A classification problem with two pieces of observable information \textit{income} and \textit{savings}}
    \label{fig:creditscoring}
\end{figure}

For the simplicity of this problem, let us suppose that only two pieces of information are observable (and we observe them because we have reason to believe they give us an idea bout their credibility). These two information are \textit{income} and \textit{savings}, which we represent by two random variables $X_1$ and $X_2$. The credibility of a customer is denoted by a Bernoulli random variable $C$ conditioned on the observable $\bm{x} = [X_1, X_2]^T$ where $C=1$ indicates a high risk customer and $C=0$ indicates a low risk customer. Thus if we know $P(C|X_1, X_2)$, when a new application arrives with $X_1 = x_1$ and $X_2 = x_2$, we can
\begin{equation*}
\text{Choose}
\begin{cases}
C = 1, & \text{if } P(C=1|x_1, x_2) > 0.5 \\
C = 0, & \text{otherwise}
\end{cases}
\end{equation*}
or equivalently
\begin{equation*}
\text{Choose}
\begin{cases}
C = 1, & \text{if } P(C=1|x_1,x_2) > P(C=0|x_1,x_2)\\
C = 0, & \text{otherwise}
\end{cases}
\end{equation*}
\subsection{Decision rules}
\subsubsection{Bayes decision rule}
\begin{thm}{Bayes Theorem.}
We say the probability of obtaining a class $C$ given knowledge of $\xx$
\begin{equation*}
P(C|\bm{x}) = \frac{P(C)p(\bm{x}|C)}{p(\bm{x})}
\end{equation*}
where
\begin{itemize}
	\item $P(C|\xx)$ defined as the \textit{posterior}
    \item $P(C)$ defined as the \textit{prior},
    \item $p(\xx|C)$ defined as the \textit{likelihood}
    \item $p(x)$ defined as the \textit{evidence}
\end{itemize}
\end{thm}
Indeed, we have in fact already seen Bayes' decision rule for a simplified case. Bringing us back to the problem of credit-scoring, the \textit{Bayes' decision rule} is simply
\begin{equation*}
\text{Choose}
\begin{cases}
C = 1, & \text{if } P(C=1 | \xx = (x_1,x_2)) > P(C=0|\xx = (x_1,x_2))\\
C = 0, & \text{otherwise}
\end{cases}
\end{equation*}
\subsubsection{MAP decision rule}
For this decision rule, we want to pick the hypothesis that is the most probable, i.e., maximize the posterior $P(C|\xx) = \frac{P(C)p(\xx|C)}{p(\xx)}$. Again, in a 2 classifier problem, we denote $\Lambda_{\text{MAP}}(\xx) = \frac{P(C=1|\xx)}{P(C=0|\xx)}$. The MAP decision rule thus state
\begin{equation*}
\text{Choose}
\begin{cases}
C=1, & \text{if } \Lambda_{\text{MAP}}(\xx) > 1 \\
C=0, & \text{otherwise}
\end{cases}
\end{equation*}
\subsubsection{Likelihood ratio test (LRT)}
For this decision rule, we would want to test whether the likelihood ratio $\Lambda(\xx) = \frac{p(\xx|C=1)}{p(\xx|C=0)}$ is larger than or equal to ratio of priors $\frac{P(C=0)}{P(C=1)}$, i.e.
\begin{equation*}
\text{Choose}
\begin{cases}
C = 1, & \text{if } \frac{P(\xx|C=1)}{P(\xx|C=0)} > \frac{P(C=0)}{P(C=1)}\\
C = 0, & \text{otherwise}
\end{cases}
\end{equation*}

\textbf{Example (LRT with Gaussian).$\quad$}
\textit{Suppose we have $P(\xx|C=1) \sim N(4,1)$ and $P(\xx|C=0) \sim N(10,1)$ two Gaussian likelihoods with equal priors. \textbf{Derive a decision rule based on the LRT.}} \\

We first note that priors are equal, our decision rule hence becomes
\begin{equation*}
\Lambda(\xx) = \frac{p(\xx|C=1)}{p(\xx|C=0)} = \frac{e^{-(x-4)^2 /2}}{e^{-(x-10)^2 /2}} > \frac{P(C=0)}{P(C=1)} = 1
\end{equation*}
The condition that determines the decision boundary is therefore $\frac{e^{-(x-4)^2 /2}}{e^{-(x-10)^2 /2}} >1$. By taking the logarithm on the above equation, we thus obtain:
\begin{equation*}
log(\Lambda(\xx)) = 84 - 12x > 0
\end{equation*}
Which gives the decision boundary $x<7$, i.e.
\begin{equation*}
\text{Choose}
\begin{cases}
C = 1, & \text{if } x < 7\\
C = 0, & \text{otherwise}
\end{cases}
\end{equation*}
\begin{figure}[h]
\centering
\includegraphics[scale=0.4]{lrtgaussian}
\caption{Graphical solution of the LRT with Gaussian.}
    \label{fig:creditscoring}
\end{figure}
\subsubsection{Bayes' rule for multiple classes}
In the general case, we have $K$ mutually exclusive and exhaustive classes; $C_i, i=1,...,K$. We have prior probabilities satisfying
$$ P(C_i) \geq 0 \quad \text{and} \quad \sum\limits_{i=1}^K P(C_i)=1$$
$p(\xx|C_i)$ is the probability of seeing $\xx$ as the input when it is known to belong to class $C_i$. The posterior probability of class $C_i$ can be calculated as
$$P(C_{k}|\xx) = \dfrac{P(\xx|C_{k})P(C_{k})}{\sum\limits_{1 \leq l \leq K}{P(\xx|C_{l})P(C_{l})}}$$ and for minimum error, the \textit{Bayes' classifier} chooses the class with the highest posterior probability; that is, we
$$ \text{Choose } C_i \text{ if } P(C_i|\xx) = \max \limits_k P(C_k|\xx)$$

\subsection{Losses and risks}
It may be the case that decisions that we make are not equally good or costly. A financial firm for example, must take into account the potential gain and loss when making a decision for a loan applicant. An accepted low-risk appplicant increases profit, while a rejected high-risk applicant decreases loss. In the following sections we could consider these losses and risks and we consider that there exists $K$ different classes classes, noted $C_{i}, i = 1,...,K$.

\subsubsection{Penalization}
\textbf{Definition. $\quad$} Let us define action $\alpha_i$ as the decision to assign the input to class $C_i$ and $\lambda_{kl}$ as the \textit{quantity of loss} for taking action $\alpha_k$ when the input actually belongs to $C_l$. The \textit{expected risk} is the sum of the risks for all the classes that the point could belong to times the probability that it belongs to the given class, that is,

\begin{equation*}
R(\alpha_k|\xx) = \sum_{l = 1}^{K}{\lambda_{kl}P(C_l|\xx)}
\end{equation*}

We note that this becomes the case of choosing the \textit{actions with minimal risks}, i.e., we choose $\alpha_i$ if  $R(\alpha_i|\xx) = \min\limits_k R(\alpha_k|\xx)$ or alternatively
\begin{equation*}
R(\alpha_k|\xx) = \arg \min\limits_ R(\alpha_k|\xx)
\end{equation*}

\subsubsection{0/1 Loss}
\textbf{Definition. $\quad$}Let us define $K$ actions $\alpha_i, i=1,...,K$. In the special case of the 0/1 \textit{loss case} where
\begin{equation*}
\lambda_{kl} =
\begin{cases}
0, & \text{if } k = l\\
1, & \text{if } k \neq l
\end{cases}
\end{equation*}
\textit{where all correct decisions have no loss and all errors are equally costly.} The risk of taking action $\alpha_i$ is
$$ R(\alpha_i|\xx) = 1 - P(C_i|x)$$
Thus to minimize risk, we choose the most probable class. Note that this is a \textit{special case} and rarely do applications have a symmetric 0/1 loss. This however serves as a simple model for analysis in this course!

\subsubsection{Reject}
In some applications, wrong decisions may have very high cost, and it is generally required that a more complex (e.g, manual classification) be made if automation dictates a \textit{low certainty of its decision}. We thus create an additional \textit{action of reject} $\alpha_{K+1}$ which is the option to not take any decision. A possible loss function is thus (following the example of 0/1 loss),
\begin{equation*}
\lambda_{kl} =
\begin{cases}
\lambda \text{ if } k = K+1
\\
0 \text{ if } k = l
\\
1 \text{ otherwise}
\end{cases}
\end{equation*}
The decision is therefore taken according to:
\begin{equation*}
\begin{cases}
\text{Choose } C_l, & \text{if } R(\alpha_l|\xx) < R(\alpha_k|\xx)\, \forall k \neq l \textbf{ and } R(\alpha_l|\xx) < R(\alpha_{K+1}|\xx) \\
\text{reject } & \text{otherwise}
\end{cases}
\end{equation*}

We choose $0 \leq \lambda \leq 1$, otherwise $\lambda = 0$ will always reject whereas $\lambda = 1$ will never reject!
\subsubsection{Bayes Risk}
We have thus far seen the different ways we could construct the risks of our problems. In this section, we introduce the notion of the total expected risk that we should expect in a classification problem. \\

\textbf{Definition. $\quad$}We call \textbf{Bayes' risk} the overall expected risk, the sum of all risks of taking any action $\alpha_k$:
\begin{equation*}
R(\xx) = \sum_{k=1}^{K} R(\alpha_k|\xx) = \sum_{k=1}^{K}{\sum_{l = 1}^{K}{\lambda_{kl}P(C_{l}|\xx)}}
\end{equation*}

\subsubsection{Discriminant functions}
\textbf{Definition. $\quad$}Classification can also be seen as implementing a set of \textit{discriminating functions}, \linebreak $f_i(\xx), i = 1,...,k$, such that we choose $C_i$ if $f_i(\xx) = \max_k f_k(\xx)$. We represent the Bayes' classifier by setting:
\begin{equation*}
f_{k}(\xx) = - R(\alpha_k| \xx)
\end{equation*}
Furthermore, we can define these discriminant functions into $K$ \textit{decision regions} $\mathcal{R}_1,...,\mathcal{R}_K$, which separated by \textit{decision boundaries} which separates one class from another. These decision regions are given by
$$R_{k} = \{ x : f_{k}(\xx) = \max\limits_{l}f_{l}(\xx) \}$$
\begin{figure}[h]
\centering
\includegraphics[scale=0.25]{boundaries}
\caption{Example of 3 decision boundaries}
    \label{fig:creditscoring}
\end{figure}
\subsubsection{Supplement: losses for regression}
We introduce the following losses commonly seen and used in regression
\begin{itemize}
\item \textbf{Square loss}: $L(f(\xx),y) = (f(\xx) - y)^{2}$. \\This loss functions has the problem of penalizing heavily outliers, which results in increasing the numerical error with unclean data. The two next loss functions seek to solve that problem.
\item $\bm{\epsilon}$ - \textbf{insensitive loss}: $L(f(\xx),y) = (|f(\xx) - y| - \epsilon)_{+}$

\item \textbf{Huber Loss:}
$
L_{\delta}(f(\xx),y) = \begin{cases}
\dfrac{1}{2}(y-f(\xx))^{2},& \text{ if } | y - f(\xx) | \leq \delta
\\
\delta |y - f(\xx)| - \delta^{2}/2,& \text{otherwise}
\end{cases}$ \\
However, these two functions are not smooth, which can cause problems in algorithms which seek to minimize them.
\end{itemize}
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{errorsummary}
\caption{Summary of regression errors}
    \label{fig:creditscoring}
\end{figure}
\subsection{Empirical risk minimization}
The main idea is that the loss function $L(f(\xx),y)$ is small when $f(\xx)$ predicts y well. We have
\begin{itemize}
\item Expected risk: $R = \mathbb{E} [ L(f(\xx),y) ]$
\item Empirical risk: $R_n = \frac{1}{n} \sum_{i=1}^{n} L(f(\xx^i),y^i)$
\item ERM estimator of the functional class F is the solution, when it exists, of
$\hat{f}_n = \arg \min\limits_{f \in \mathcal{F}} R_n(f)$
\end{itemize}
However ERM is ill posed and it can be that an infinite number of solutions minimize the empirical risk to zero. ERM is also not statistically consistent. Law of large numbers is only true if capacity (VC-dimension) of $f$ is not too large.
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{erminfinite}
\caption{Ill posed problem: infinite solutions!}
    \label{fig:creditscoring}
\end{figure}
\section{Multivariate classification: Naive Bayes}
\subsection{Naive Bayes}
Naive Bayes is a \textit{multivariate classification}, which is to say, $\xx$ is multidimensional. We also have an assumption that the variables $\xx = (x_1, x_2,...,x_p)$ are conditionally independent, i.e.,
$$p(x_i|C_k,x_j) = p(x_i|C_k)$$
By applying this property to Bayes' rule that we have seen previously,
\begin{align*}
P(C_k|\xx) &= \frac{p(\xx|C_k)P(C_k)}{\sum_{k=1}^{K}p(\xx|C_k)P(C_k)} \\
		   &= \frac{P(C_k)p(x_1|C_k)p(x_2|C_k)\cdot \cdot \cdot p(x_p|C_k)}{\sum_{k=1}^{K}p(\xx|C_k)P(C_k)}\\
           &= \frac{1}{Z}P(C_k)p(x_1|C_k)p(x_2|C_k)\cdot \cdot \cdot p(x_p|C_k)
\end{align*}
Where we note $\frac{1}{Z}$ a scaling factor independent of $C_k$.
\subsection{Algorithms}
\subsubsection{Maximum a posteriori (MAP) estimation}
We recall in a \textit{MAP decision rule}, we pick the hypothesis that is most probable (Homework 3!). For Naive Bayes, the \textit{MAP decision rule} is defined by
\begin{align*}
\hat{y} = \arg \max\limits_{k=1,..,K}p(C_k) \Pi_{i=1}^n p(\xx^i|C_k)
\end{align*}
\subsubsection{Bernoulli Naive Bayes}
In the case of a \textit{binary classification problem} (2 classes), we can define each sample as the outcome of $p$ Bernoulli trials, with the assumption that each trials are \textit{independent} from the others. Then the decision rule for Bernoulli Naive Bayes is based on
$$p(x_j|C_k) = p_j^{x_j}(1-p_j)^{(1-x_j)}$$
\subsubsection{Gaussian Naive Bayes}
We further assume that $p(x_j|C_k)$ is a \textit{univariate Gaussian} and the decision rule is defined as
$$p(x_j|C_k) = \frac{1}{\sigma \sqrt{2\pi}}e^{-(x-\mu)^2/(2\sigma^2)}$$
where $\mu$ and $\sigma$ are estimated using maximum likelihood.
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{naivegaussian}
\caption{Naive Gaussian examples with varying $\mu$ and $\sigma$}
    \label{fig:creditscoring}
\end{figure} \pagebreak
\subsection{Bayesian model selection}
The key idea of this section is that we can also take priors on models, and we denote it as $p$(model). Similar to previous sections, we can thus define a decision rule
\begin{equation*}
p(\text{model}|\text{data}) = \frac{p(\text{data}|\text{model})p(\text{model})}{p(\text{data})}
\end{equation*}
In addition, if we take the log on both sides of the equation, we obtain,
$$\log p(\text{model}|\text{data}) = \log p(\text{data}|\text{model}) + \log p(\text{model}) - \log {p(\text{data})}$$
where we can further define $\log p(\text{data}|\text{model})$ as the \textit{training error} and $\log p(\text{model})$ the \textit{complexity} of our model. We can also take the maximum a posteriori (MAP) which is similar to minimizing
$$E' = \text{empirical error } + \bm{\lambda} \text{ model complexity}$$
\end{document}


text:
\section{Experience}

\outerlist{

\entrybig
	{\textbf{ETH Zurich}}{Zurich, CH}
	{Student Research Assistant at Data Analytics Lab}{Summer 2019}
\innerlist{
	\entry{Interpretability in adversarial word embeddings for text}
	\entryextra{Adapted the codebase for adversarial attacks on embeddings, conducted qualitative and \\ quantitative analyses, worked on adversarial text generation via embedding projection}
}

\entrybig
	{\textbf{Imperial College London}}{London, UK}
	{Research Intern at Intelligent Behaviour Understanding Group (iBUG)}{Summer 2017}
\innerlist{
	\entry{\link{https://ibug-avs.eu}{A novel audiovisual dataset} for normal, whispered and silent speech}
	\entryextra{Created tools for data collection and analysis, analysed the collected data, implemented \\ fixes, worked on the reimplementation of the existing network in a different library}
}

\entrybig
	{\textbf{École Polytechnique Fédérale de Lausanne}}{Lausanne, CH}
	{Research Intern at Data Intensive Applications and Systems Laboratory (DIAS)}{Summer 2016}
\innerlist{
	\entry{Microarchitectural analysis of OLAP database systems}
	\entryextra{Examined the changes in microarchitectural utilization of different column-oriented \\ database systems on distinct workloads}
}

}

ext: tex


text:
\chapter{Acknowledgments}

\apsq has been developed and is maintained by

\begin{itemize}
\item Koen Wolters, CERN
\item Daniel Hynds, CERN
\item Simon Spannagel, CERN
\end{itemize}

The following authors, in alphabetical order, have contributed to \apsq:

\begin{itemize}
\item  Thomas Billoud, Université de Montréal
\item Neal Gauvin, Université de Genève
\item  Moritz Kiehn, Université de Genève
\item  Salman Maqbool, CERN Summer Student
\item  Andreas Matthias Nürnberg, CERN
\item  Marko Petric, CERN
\item  Edoardo Rossi, DESY
\item  Andre Sailer, CERN
\item  Paul Schütze, DESY
\item  Mateus Vicente Barreto Pinto, Université de Genève
\end{itemize}

The authors would also like to express their thanks to the developers of AllPix~\cite{ap1wiki,ap1git}.

max_stars_repo_name: schmidtseb/allpix-squared

max_issues_repo_name: schmidtseb/allpix-squared

max_forks_repo_name: schmidtseb/allpix-squared


text:
\section{Audio Spectrum Analyzer (ASA)}
\label{sect:ASA}
The AVNA project started with impedance and transmission analysis which is the normal set for a network analyzer.  However, the same hardware is capable of supporting other tests with the only changes being in the firmware.  This leads to a more general descriptor of "Audio Instrument."  One of the resulting instruments is the Spectrum Analyzer, covered here.  Note that, in addition to displaying spectra,  there some specialized tests for the measurement of Signal-to-Noise Ratio and SINAD.  These measurements are covered in this section as well, since they work as part of the Spectrum Analyzer.
\subsection{Description}
\label{subsect:ASADescr}
Within a frequency range of 10 Hz to 40 kHz, the power at the \q{T} input terminals is displayed.  Unlike instruments like the AVNA1, the display is graphical with power in dBm (relative to a milliwatt).  The frequency runs along the bottom axis and is always 0.0 at the left edge and up to 3, 6, 12, 24 or 48 kHz on the right side as chosen from the bottom-row menu.

The dBm calibration assumes an input resistance of 50-Ohms and that resistor should be switched in for the scale reference to be meaningful.  If the input does not have the 50-Ohms switched in, it has a 1-Megohm input impedance.  For the high impedance case, the 0 dBM line at the top corresponds to 0.223 V rms or 0.632-V p-p.

The dB per division and the dB offset for the dBm scale can be varied by the bottom-row menu.

As will be described in detail below, the spectrum analyzer can also do noise and  distortion measurements.

\subsection{Instructions}
\label{subsect:ASAInstr}
Everything starts with the Instrument Home screen shown in  Figure \ref{AVNA_000-label},  from which the user has a choice of four Audio Test Instruments. In this case we select, "\textsf{Spectrum Analyzer}"  which comes up sweeping with a 48 kHz width displaying an 80 dB range.   This is fine for many purposes and an input can be connected to the \q{T} input terminals.  Be careful to not input more than about 1-Volt p-p input or the ADC will be driven past its range, causing spurious response signals and inaccurate levels to be displayed.  Additionally, if the input level is very excessive,  damage can occur to the instrument.

\begin{figure}[H]
\begin{center}
\includegraphics[scale=0.75]{./images/AVNA_019.pdf}
\caption{Spectrum Analyzer  showing a 996 Hz sine wave.  The frequency range has been reduced to 3 kHz by selecting a 6 kHz sampling rate. }
\label{AVNA_019-label}
\end{center}
\end{figure}
%
The screen should look somewhat like that in Figure \ref{AVNA_019-label}.  There will be no spike, as seen at about 1 kHz since there is no signal being applied and the frequency scale will default to 48 kHz.  The frequency scale will be different due to adjustments we will discuss in the next paragraph.  It is normal for the noise line to be higher on the left half of the screen and to rise to roughly -50 dBm at the very left edge.

\subsection{Frequency Coverage} To change the frequency range being displayed, we tap on the "\textsf{Freq}" button on the bottom row.  This brings up a screen allowing changes to the maximum frequency and describing the parameters  being used.  We have been talking about the maximum display frequency that has been set initially to 48 kHz.  The frequency changing control screen works in terms of "Sample Rate" that is twice the maximum display frequency being displayed.  In addition, a parameter, "\textsf{Maximum Frequency}" is shown that is 5/6 of the maximum display frequency.  This is unnecessarily confusing, but reflects that we can only work with inputs up to half of the ADC sampling frequency and further that there is a low-pass filter as part of the ADC that starts cutting off at about 5/6 of the half sampling frequency.  For the 96 kHz sampling frequency, this all means that the highest accurate measurement frequency is about 40KHz.  We show the full frequency range on the display, but we need to remember that the last two divisions on the screen are attenuated and should not be considered as numerically accurate.

So now we can change the total frequency range by adjusting the "\textsf{Sample Frequency}" down with the button on the bottom row.  The first button tap cuts the sample rate in half to 48 kHz.  If we continue tapping this button, we will get to the lowest range with a Sample Frequency of 6 kHz.  This will display 0 to 3 kHz as was seen in Figure  \ref{AVNA_019-label}.  We will later, under Signal Generators, see how to generate a sine wave as seen in the figure.

On the ASA frequency control screen,  we also see a numerical value for the Resolution Bandwidth.  This reflects the sampling rate as well as the 1024 point FFT being used.  In addition, resolution shown includes the 1.5 factor due to the Hann window function that is always used.\footnote{The resolution bandwidth of the FFT without windowing is the sampling rate divided by the number of sampling points per FFT, which in our case is 1024.  Windowing is used to reduce the spurious side signals due to taking a finite sample of the waveform.  See, \linebreak \textbf{\texttt{https://en.wikipedia.org/wiki/Window\_function}}}
%
Note that the FFT only gives 512 data points across the half-sample rate region.  There are 256 pixels available to display the data, so each pixel includes a little more than a single unit of FFT resolution.    The only setting involved with this is the Sample Rate setting and the remainder is automatic.

Finally, on the frequency screen there is provision for changing the amount of data averaging.  The advantage of averaging is to reduce the amount of noise seen on the spectral trace.  There are many times when this  increases the accuracy of measurements.  The penalty is slowness in the screen updates.

\subsection{Amplitude control} The vertical axis, when starting up, covers 80 dB of range with 10 dB per division.  The "\textsf{Amplitude}" button at the bottom of the Spectrum Analyzer screen brings up controls for dB per division (dB/div) and dB offset.  The db/div can be set to 20, 10, 5, or 2.  The offset comes in 5 dB increments and can be used to move the screen display up or down.  In all cases, the scale of dBm on the left axis tracks these changes.

\subsection{Marker annotation} Still looking at the Spectrum Analyzer screen, Figure  \ref{AVNA_019-label},  observe the "\textsf{-6.41}" notation at the top.  This is a measure, in dBm, of the amplitude of the strongest signal on the screen.  It assumes that the signal being measured is narrow band like the sine wave shown.  Over on the right side is a marking "\textsf{996.1}".  This is the estimated frequency of the same strongest signal using a clever method of interpolating the Hann windowed FFT.  \footnote{See, "A New Accurate FFT Interpolator for Frequency Estimation," \linebreak {\footnotesize\ \textbf{\texttt{ https://forum.pjrc.com/threads/36358-A-New-Accurate-FFT-Interpolator-for-Frequency-Estimation}}.}}
%
For reasonably strong signals, this estimated frequency is superior to conventional frequency counters. The estimate is being made in a fraction of a second, but accurate to around 0.1 Hz.   As you might expect, the accuracy diminishes at low signal-to-noise ratio, but still gives a useful estimate.

\subsection{SINAD and S/N} The last button on the main Spectrum Analyzer screen is a toggle that activates, or de-activates, some specialized measurements.  These use the same data as is displayed.  The measurement width is automatically set to 6 kHz (12 kHz sample rate) and the special measurements are made near 1 kHz.  There is no FFT bin centered on 1 kHz, so the nearest bin center of 996 Hz is really the center.  The display now looks like Figure \ref{AVNA_020-label}, but missing the signal.
%
\begin{figure}[H]
\begin{center}
\includegraphics[scale=0.75]{./images/AVNA_020.pdf}
\caption{Spectrum Analyzer screen including SINAD measurements.}
\label{AVNA_020-label}
\end{center}
\end{figure}
%

SINAD is a measurement term that is used primarily to evaluate radio receiver performance.  Rather than trying to cover the definitions and uses of these terms here, please refer to the foot-noted references.\footnote{\textbf{\texttt{https://en.wikipedia.org/wiki/SINAD}}}\footnote{{\scriptsize\ \textbf{\texttt{https://www.electronics-notes.com/articles/radio/radio-receiver-sensitivity/what-is-sinad-signal-to-noise-and-distortion.php}}}}
%
For our ASA, the measurement bandwidth for noise is fixed at 300 to 4000 Hz.  The frequency center, as discussed above, is 996 Hz.  To allow for frequency errors in the signal generator for the 996 Hz tone (this may be an external generator that is part of an RF signal generator), the signal measurement adds 3 FFT bin powers together which is equivalent to a simple band-pass filter of about 40 Hz width, centered on 996 Hz.  The noise plus distortion power measurement excludes 5 bins, or about 60 Hz centered at 994 Hz.

With no signal present, the SINAD should show very close to 0.0 dB.  With increasing signal the SINAD will increase, representing the reduced competition of noise.

The other measurements shown are "\textsf{S/N}" which is the ratio, in dB, of the power in the signal bins to that in the sum of the two noise bands, scaled back to a single bin bandwidth.   The "\textsf{NBW}"  line is for the calculated Noise Band Width in Hz and refers to the noise in a single FFT bin (including windowing effects).   The "\textsf{S/N 2500}" is the same as "\textsf{S/N}" except 21.5 dB lower to reflect the wide band.  The reason for posting this tightly coupled number is the popular WSJT series of programs\footnote{\textbf{\texttt{https://physics.princeton.edu/pulsar/k1jt}}}that use this wide band S/N extensively.

\subsection{Discussion}
\label{subsect:ASADiscus}
Multiple FFT are averaged together to produce the ASA graph.  The width of the display can be varied in 2:1 steps from 3 to 48 kHz with the resolution bandwidth varying proportionally.  The normal scale is 80 dB which is 10 dB/div, but a 5 dB/div option is available along with offsets in 5 dB steps.  The peak level on the screen is indicated at the top left and the frequency of this peak is at the top right.  The level may be higher than the graphics peak as it is the sum power of the peak "bin" and the two adjacent ones.  The frequency indication includes interpolation between bins and has counter accuracy for stronger sine waves.  The input goes into the \q{T} Transmission port.  The calibration is in dBm into 50 Ohms and assumes that the 50 Ohm input terminator is switched in.


text:
\documentclass[%singlesided,
               doublesided,
               paper=a4,
               fontsize=10.5pt
              ]{my-resume}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set geometry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength\highlightwidth{8cm}
\setlength\headerheight{3cm}            % note that margintop gets added to this value, i.e. the header bar is 5cm
\setlength\marginleft{1cm}
\setlength\marginright{\marginleft}      % needs to be 1.5 times to be actually equal. why?
\setlength\margintop{1cm}
\setlength\marginbottom{1cm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% FONTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\RequirePackage{fontspec}
\setmainfont{Carlito}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% COLORS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\colorlet{highlightbarcolor}{white}
\colorlet{headerbarcolor}{white}

\colorlet{headerfontcolor}{black}
\colorlet{accent}{awesome-red}
\colorlet{heading}{black}
\colorlet{emphasis}{black}
\colorlet{body}{black}
\colorlet{link-color}{black}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\name{Justin Napolitano}
\tagline{Analyst experienced in legal, socioeconomic, and policy research seeking opportunity \\to leverage technical skill set in order to model complex socioeconomic systems.}
\photo[round]{head_shot.jpeg}{\dimexpr 4cm-\marginbottom}   % make photo exactly match the header with margintop/marginright/marginbottom as margin

\makeheader

\highlightbar{

    \section{Contact}
    \email{justin@jnapolitano.io}
    \phone{+1-832-299-0372}
    \location{Houston, Texas}
%    \vspace{0.5em}
    \homepage{jnapolitano.io}{https://jnapolitano.io}
    \github{justin-napolitano}{https://github.com/justin-napolitano}
    \linkedin{justin-napolitano}{https://www.linkedin.com/in/justin-napolitano}
%    \orcid{0000-0003-0745-6521}{https://orcid.org/0000-0003-0745-6521}
%    \ads{NASA/ADS publication list}{https://ui.adsabs.harvard.edu/search/fq=\%7B!type\%3Daqp\%20v\%3D\%24fq\_database\%7D&fq\_database=database\%3A\%20astronomy&p\_=0&q=pubdate\%3A\%5B2016-01\%20TO\%209999-12\%5D\%20author\%3A(\%22Krieger\%2C\%20Nico\%22)&sort=date\%20desc\%2C\%20bibcode\%20desc}

    \section{Education}
    \subsection{{Bachelor of Political Science \hfill Aug 2018}}
    \subtext{University of Central Florida \hfill Orlando, Florida}

    \section{Certificates}
    \subsection{{\href{https://coursera.org/share/aaa9e82dd6bea4bdfe173395c46a7d6e}{Python Specialization} \hfill February 2020}}
    \subtext{University of Michigan \hfill Coursera}

    \section{Technical Skills}

    \vspace{0.5em}
    \skillsection{Programming}
    \skill{Python}{4}
    \skill{C}{3}
%    \skill{GoLang}{2}
%    \skill{Java}{2}
%    \skill{Javascript}{2}
%    \skill{Scala}{2}

    \vspace{0.5em}
    \skillsection{Data Handling and Analysis}
    \skill{Pandas}{4}
    \skill{SAS (Statistical Analysis System)}{3}
    \skill{Statsmodels}{3}
    \skill{SQL}{3}
% move to competency    \skill{Matplotlib}{3}
    \skill{PySpark}{3}
%    \skill{NetworkX}{2}
%    \skill{TensorFlow/Keras}{2}

    \section{Core Competencies}
%        \smallskip % additional skip because tag outlines use up space
        \tag{Legal Research}
        \tag{Data Mining}
        \tag{Forecasting}
        \tag{Supply Chain Analysis}
   %    \tag{Python Development}
%        \tag{Behavioral Analysis}
%        \tag{Graph Database}
%        \tag{Feature Extraction}
 %       \tag{Socioeconomic Research}
%        \tag{Project Management}
    %    \tag{ETL}
        \tag{Inferential Statistics}
%        \tag{Sentiment Analysis}
%        \tag{Data Visualization}
    %    \tag{Penetration Testing}
    %    \tag{Network Security}
        \tag{Economic Modeling}
        \tag{Policy Analysis}
%        \tag{Ethnographic Research}

%    \vspace{0.5em}
%    \skillsection{Communication}
%    \skill{English}{5}
%    \skill{French}{3}
%    \skill{Spanish}{3}
%    \skill{Cantonese}{2}

%    \section{Data Tools}
%    \begin{zitemize}
    %\skillsection{Software and Tools}
    %\smallskip % additional skip because tag outlines use up space

%    \tag{\href{https://www.lexisnexis.com/en-us/gateway.page}{LexisNexis}}
%    \tag{\href{https://data.nasdaq.com/}{Nasdaq Data Link}}
%    \tag{Correlates of War}
%    \tag{\href{hhttps://data.worldbank.org/}{World Bank Data API}}
%    \tag{\href{https://loc.gov/apis/}{Library of Congress API}}
%        \skilling{\href{https://data.nasdaq.com/}{Nasdaq Data Link}}{Sourced economic, logistic, and shipping data for analysis.}
%    \end{zitemize}
%        \tag{Azure}
%        \tag{Bash}
%        \tag{Docker}
%        \tag{Kubernetes}
%        \tag{Hugo}
%        \tag{Linux}
%        \tag{Ubuntu}
%        \tag{FreeBSD}
%        \tag{HTML/CSS}
%        \tag{CSS}
%        \tag{SAS (Statistical Software System)}

%        \tag{SPSS}
%        \tag{Markdown}

%        \tag{Apache Spark}
%        \tag{HUGO}
%        \tag{Graph Analysis}
%        \tag{pyTesseract}
%        \tag{Pillow}

%        \tag{Sphinx}
%        \tag{Git/GH}
%        \tag{Docker}
%        \tag{Vim}
%        \tag{PyTest}
%        \tag{Neo4j}
%
%        \tag{Static Website Generation}
%        \tag{JanusGraph}
%        \tag{Flask}
%        \tag{SQL Server}
%        \tag{RESFUL API}

%        \tag{MatplotLib}

    \section{Data Set Proficiency}
%        \smallskip % additional skip because tag outlines use up space
    \tag{\href{https://www.lexisnexis.com/en-us/gateway.page}{Lexis Nexis}}
    %\tag{Shipping Data}
    %\tag{Rail Demand}
    \tag{\href{https://data.nasdaq.com/data/EIA-us-energy-information-administration-data}{Energy Commodity Pricing}}
    \tag{\href{https://data.nasdaq.com/data/JODI-jodi-oil-world-database}{JODI Oil World Database}}
    %\tag{\href{https://loc.gov/apis/}{Library of Congress API}}
    %    \tag{Correlates of War}
    \tag{\href{https://data.worldbank.org/}{World Bank Development Indicators}}
    \tag{\href{https://data.un.org/SdmxBrowser/start}{UN Energy Accounts and Balances}}
    \tag{\href{https://sdw.ecb.europa.eu/}{European Central Bank Statistics}}

    \section{Documentation Tools}
    \tag{Sphinx}
    \tag{LaTeX}
    \tag{Scientific Markdown}
    \tag{reStructuredText}
    \tag{Jupyter Notebooks}
%        \tag{United Nations Data Portal}

%        \tag{Economic Modeling}
%        \tag{Ethnographic Research}
   %    \tag{Python Development}
%        \tag{Sales Forecasting}
%        \tag{Sentiment Analysis}
%        \tag{Data Visualization}
    %    \tag{Penetration Testing}
    %    \tag{Network Security}

    %\tag{Behavioral Analysis}
    %\tag{Inferential Statistics}

    %        \tag{Graph Database}
    %        \tag{Feature Extraction}
     %       \tag{Socioeconomic Research}
    %        \tag{Project Management}
        %    \tag{ETL}

    \section{Language Proficiency}
        \tag{English}
        \tag{French}
        \tag{Spanish}
%    \tag{test}
%    \tag{Graph Database}
%    \vspace{0.5em}
    %\skillsection{Software and Tools}
    %\skillest{Bash}{Html/CSS}

    %\skillsection{Database}
    %\skillest{JanusGraph}{Gremlin}
    %\skillest{Neo4j}{SQL}

    %\tag{JanusGraph}
    %\tag{Gremlin}
    %\tag{Neo4j}
    %\tag{SQL}

%    \skill{HTML/CSS}{3}
%    \skill{LaTeX}{3}
%   \skill{Markdown}{3}
%    \skill{reStructuredText}{3}

    %Move to documentation
%    \vspace{0.5em}
%    \skillsection{Software \& Tools}
%    \skill{Jupyter}{4}
%    \skill{Sphinx Documentation}{4}
%    \skill{Git/GH}{3}
%    \skill{Docker}{3}
%    \skill{Vim}{3}
%    \skill{Metasploit Framework}{3}
%    \skill{Nmap}{3}
%    \skill{K8s}{2}
%    \skill{pyTest}{2}
%    \skill{Office}{4}

    % Also Competencies

%    \skill{SPSS}{2}

    %\vspace{0.5em}
    %dont rate just sill it.
    %\skillsection{Database}
    %\skill{JanusGraph/Gremlin}{3}
    %\skill{Neo4j}{3}
%    \skill{SQL}
%    \skill{MongoDB}{2}

%    \vspace{0.5em}
%    \skillsection{Operating Systems}
%    \skill{Linux}{4}
%    \skill{MacOS}{4}
%   \bigskip

%    \section{Certificates}
%    \simpleskill{Python Specialization University of Michigan/Coursera}

}
\mainbar{
    \section{Experience}
    \subsection{{Marketing Analyst  \hfill May 2021 --- Present}}
    \subtext{BTJN, LLC \hfill Houston, Texas}
    \begin{zitemize}
        \footnotesize
%        \skilling{\href{https://docs.jnapolitano.io/parts/data/web-scraping/general-purpose/docs/realtor_scraper_sheets_4/index.html}{Data Integration}}{Integrated data into client’s existing Google Sheets workflow.}
        %\skilling{\href{https://docs.jnapolitano.io/parts/data/web-scraping/index.html}{Data Mining}}
        \item{Optimized marketing strategy by identifying 25,000 most valuable potential customers out of over 300,000.}
        %\item{Stored historical data in Neo4j warehouse to quickly scale product to meet dynamic demands.}
        \item{Created graph database to analyze personal customer characteristics that correlate with higher returns on investment.}
        \item{Improved analysis pipeline efficiency by 95 percent by integrating data with PySpark and Google Drive API from a Neo4j warehouse.}

        % Created workflow trees for crawler programs to autonomously analyze data.}
        %\skilling{\href{https://docs.jnapolitano.io/_modules/csv_to_neo.html\#DataPipelineFunctions}{Data Transformation}}
        %\item{Integrated data with PySpark and Google Drive API to Google Sheets workflow from Neo4j backend. Improved pipeline efficiency by 95 percent.}
        %\skilling{\href{https://docs.jnapolitano.io/_modules/csv_to_neo.html\#DataUploadFunctions}{Data Warehousing}}
    \end{zitemize}

    \subsection{{Sales Strategist \hfill October 2019 --- February 2021}}
    \subtext{BTJN, LLC}
    \footnotesize
    \begin{zitemize}
        \item{Defined sales strategy to target well funded public organizations for greatest ROI.}
        \item{Compared sources to identify most competitive manufacturers to procure personal protection equipment for large organizations.}
        \item{Deployed a custom CRM solution to facilitate sales analytics.}

%        \item{Provisioned an Azure SQL Server to interface with Microsoft Office workflows.}
%        \item{Completed data transformation and integration to local MySQL server with Pandas scripts to increase workflow efficiency and value.}

    \end{zitemize}

    \subsection{{Sales Analysis Internship \hfill January 2020 --- August 2020}}
    \subtext{Cox Oil Company}
    \footnotesize
    \begin{zitemize}
        \item{Discovered supply chain bottlenecks by product for 57 retail stores with Python Statsmodel and Pandas.}
        \item{Piloted application to generate daily sales reports for store managers to streamline inventory screening.}
    \end{zitemize}

    \subsection{{Research Lead and Analyst \hfill Jan 2018 --- Aug 2019}}
    \subtext{University of Central Florida \hfill Orlando, Florida}
    \begin{zitemize}
        \footnotesize
        \item{Identified regional socioeconomic features correlated with higher investment risks.}
        \item{Reviewed feasability of Turkish government proposals to develop hydroelectric plants in underdeveloped regions.}
        % \skilling{\href{https://www.degruyter.com/document/doi/10.1515/peps-2019-0036/html?lang=en}{Article Publication}}{Published in Journal of Peace Economics, Peace Science and Public Policy.}
 %       \skilling{Peer Review}{Prepared presentation for the Peace Science Conference at the Hague.}
%        \skilling{Data Visualization}{Visualized P.O.L.E graph with Matplotlib.}
        %\skilling{\href{https://docs.jnapolitano.io/parts/analysis/political-analysis/terrorism-conflict/project-turkish-kurdish/pdf.html}{Feature Extraction}}
        \item{Developed international law frame work from primary sources to reveal governmental criminal activity which could result in economic sanctions.}
        \item{Prepared publication presentation peer reviewed at the Peace Science Conference at the Hague, Switzerland.}
%        \item{Standardized feature extraction methodology to enable research assistants to code data points with minimal training.}
        %\item{Implemented a third normal database to distribute data for publication.}
        %\skilling{\href{https://docs.jnapolitano.io/parts/analysis/political-analysis/terrorism-conflict/project-turkish-kurdish/analysis.html}{Inferential Statistics}}

        %\skilling{Project Management}

    \end{zitemize}

    \subsection{{Research Assistant \hfill Jan 2017 --- Jan 2018}}
    \subtext{University of Central Florida \hfill Orlando, Florida}
    \begin{zitemize}
        \item{Managed team data coding, verification, and storage procedures for article \\ published by Cambridge University Press.}
        \item{Analyzed United Kingdom parliamentary procedures to predict likely policy outcomes.}
%        \skilling{Data Management}{Managed team data aggregation, verification, and storage procedures.}
%       \skilling{Anova Testing}{ANOVA tested human scoring against automated scoring.}
%        \skilling{Sentiment Analysis}{Automated sentiment analysis of sentences with Python NTLK.}
    \end{zitemize}

    \section{Projects}
%        \subsection{{\href{journal.jnapolitano.io}{Journal.Jnapolitano.io} \hfill Nov 2021 --- Present}}
        %\subtext{Personal Project \hfill Houston, Texas}
        \hspace{.5em}
        {\begin{zitemize}
            \footnotesize
            %\skilling{\href{https://journal.jnapolitano.io/\#articles}{Commercial Research}}{Concluded that the interests of powerful states dictate international commercial regulation.}
%            \skilling{Rail Demand Tool}{Plotted international rail demand indicators by transit station.}
%            \skilling{Shipping Analysis Tool}{Analyzed historical shipping data of ships that entered US territorial waters to specify trade volume and port of origin.}
%            \skilling{Oil Demand Tool}{Graphed historical crude oil shipping volume and demand.}
            \skilling{US Freight Energy Consumption Dashboard}{Documenting actual and projected freight rail energy use by fuel type.}
            \skilling{\href{https://docs.jnapolitano.io/parts/analysis/political-analysis/sup-court/project-sup-court-meta-data-graph/index.html}{US Supreme Court Metadata Graph}}{Clustered Supreme Court cases by political issue area to identify commerical clause cases.}
            \skilling{\href{https://docs.jnapolitano.io/parts/analysis/political-analysis/sup-court/project-supcourt-tensorflow/index.html}{AI Policy Prediction Paper}}{Predicted policy outcomes according to political ideology.}
            \skilling{\href{https://journal.jnapolitano.io/parts/articles/project-evolution-of-ngos/index.html}{WTO and International Trade}}{Concluded that the interests of powerful governments dictate international commercial regulation.}

            %\skilling{\href{https://journal.jnapolitano.io}{journal.jnapolitano.io}}{Self hosted articles of personal interest.}
%            \skilling{\href{https://journal.jnapolitano.io/\#tutorials}{Developer Tutorials}}{Writing tutorials for developer tools and programming languages.}
%                \skilling{\href{https://journal.jnapolitano.io/\#reference}{Python Reference}}{Collecting algorithms and data structures to implement in future projects.}
%            \skilling{\href{https://github.com/justin-napolitano/cv}{Static Web Site Generation}}{Creating websites with Sphinx and the Jupyter Book.}
%            \skilling{\href{docs.jnapolitano.io}{Project Documentation}}{Documenting Projects with Markdown, reStructuredText, and LaTeX.}

        \end{zitemize}
        }

    \section{Publications}
    \pubdefaultspacing
    \justinpublication
    {Turkish Kurdish Analysis Database} % Title
    {Demet Mousseau, \textbf{Justin Napolitano}, Alex Olson} % Authors
    {2019} % Year
    {Peace Economics, Peace Science and Public Policy vol 25, no. 4, pp. 36} % Journal
    {\doi{https://doi.org/10.1515/peps-2019-0036}} % ADS & arxiv links

}
\makebody

%\clearpage
%\pagestyle{empty}

%\section{Publications}
%\pubforcefullwidth

%Demonstrate what an \texttt{\textbackslash pagestyle\{empty\}} page looks like.
%Also show off the macros for publications that uses small icons for authors, date, journal and links.

%Achieving a good looking spacing can be tricky. For empty pagestyles where the full width is available use \texttt{\textbackslash pubforcefullwidth} to force the publoication list to take up all the available space.
%The (relative) lengths reserved for date, journal and links can be set with the parameters \texttt{\textbackslash pubdatelength}, \texttt{\textbackslash pubjournallength} and \texttt{\textbackslash publinklength} as in \texttt{\textbackslash setlength\{\textbackslash pubdatelength\}\{0.15 \textbackslash linewidth\}}.
%\bigskip

%\publication
%	{The turbulent gas structure in the centers of NGC~253 and the Milky Way} % Title
%	{\textbf{N. Krieger}, A. Bolatto, E. Koch, A. Leroy, E. Rosolowsky, F. Walter, A. Wei\ss, D. Eden, R. Levy, D. Meier, E. Mills, T. Moore, J. Ott, Y. Su, S. Veilleux} % Authors
%	{2020} % Year
%	{The Astrophysical Journal Vol. 899, Issue 2, id.158} % Journal
%	{\ADS{https://ui.adsabs.harvard.edu/abs/2020ApJ...899..158K}, \arXiv{https://arxiv.org/abs/2008.02518}} % ADS & arxiv links

%\publication
%	{The molecular ISM in the Super Star Clusters of the starburst NGC253} % Title
%	{\textbf{N. Krieger}, A. Bolatto, A. Leroy, R. Levy, E. Mills, D. Meier, S. Veilleux, F. Walter, A. Wei\ss} % Authors
%	{2020} % Year
%	{The Astrophysical Journal Vol.897, Issue 2, id.176} % Journal
%	{\ADS{https://ui.adsabs.harvard.edu/abs/2020ApJ...897..176K}, \arXiv{https://arxiv.org/abs/2006.08262}} % ADS & arxiv links

%\publication
%	{The Molecular Outflow in NGC\,253 at a Resolution of Two Parsecs} % Title
%	{\textbf{N. Krieger}, A. Bolatto, F. Walter, A. Leroy, L. Zschaechner, D. Meier, J. Ott, A. Wei\ss, E. Mills, S. Veilleux, M. Gorski} % Authors
%	{2019} % Year
%	{The Astrophysical Journal Vol.881, Issue 1, article id. 43, 20 pp} % Journal
%	{\ADS{https://ui.adsabs.harvard.edu/abs/2019ApJ...881...43K}, \arXiv{https://arxiv.org/abs/1907.00731}} % ADS & arxiv links

\end{document}

max_stars_repo_name: justin-napolitano/apex-resume

max_issues_repo_name: justin-napolitano/apex-resume

max_forks_repo_name: justin-napolitano/apex-resume


text:
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{verbatim} % mainly for multi-line comments

%\usetheme{Madrid}
%\useinnertheme{rectangles}
%\setbeamertemplate{navigation symbols}{}
\setbeamercovered{highly dynamic}

\title{Tracking juggling balls using the Kinect}
\author[Rolf $\cdot$ Thiemo $\cdot$ Flo]{Rolf Boomgaarden $\cdot$ Thiemo Gries $\cdot$ Florian Letsch}
\institute{Universität Hamburg}
\date{19/12/2013}

\begin{document}

\frame
{
\titlepage
}
\section{Looking back}

\section{Our plan}
\begin{frame}{What we thought at first}
\begin{center}\includegraphics[scale=0.1]{img/flowchart.png}\end{center}
\end{frame}

\begin{frame}{A \textit{"working"} solution}
\begin{enumerate}
	\item detection with depth data (no rgb)
	\item cut off depth at threshold ($\rightarrow$ binary representation)
	\item find bounding rects (\lstinline{OpenCV.BoundingRect})
	\item filter out small rectangles and rectangles touching the image boundaries
	\item find centroid of remaining rects. The three rects closest to centroid are considered "balls"
	\item a ball fits inside a rectangle (close representation of actual ball in RGB, ignoring the deformation caused by movement)
\end{enumerate}
\end{frame}

\begin{frame}{A checklist}
WORKS:

\begin{itemize}
\item Using dummy data (numpy array dumps)\\
\item Use a hard coded threshold\\
\item filter out rectangles too small or too close to image edge
\end{itemize}

DOESN'T REALLY WORK:

\begin{itemize}
 \item Match balls from frame to frame
\end{itemize}

NOT THERE YET:
\begin{itemize}
 \item Kalman filter
\end{itemize}

\end{frame}

\begin{frame}{Challenges}
\begin{itemize}
	\item Local maxima
	\item Multiple balls (colour?)
\end{itemize}
\end{frame}

\begin{frame}{The end}
EOF
\end{frame}

\end{document}

max_stars_repo_name: florianletsch/kinect-juggling

max_stars_repo_licenses: Unlicense MIT

max_issues_repo_name: florianletsch/kinect-juggling

max_issues_repo_licenses: Unlicense MIT

max_forks_repo_name: florianletsch/kinect-juggling

max_forks_repo_licenses: Unlicense MIT


text:
% 03tangentvectors.tex
% Fund Science! & Help Ernest finish his Physics Research! : quantum super-A-polynomials - a thesis by Ernest Yeung
%
% http://igg.me/at/ernestyalumni2014
%
% Facebook     : ernestyalumni
% github       : ernestyalumni
% gmail        : ernestyalumni
% google       : ernestyalumni
% linkedin     : ernestyalumni
% tumblr       : ernestyalumni
% twitter      : ernestyalumni
% youtube      : ernestyalumni
% indiegogo    : ernestyalumni
%
% Ernest Yeung was supported by Mr. and Mrs. C.W. Yeung, Prof. Robert A. Rosenstone, Michael Drown, Arvid Kingl, Mr. and Mrs. Valerie Cheng, and the Foundation for Polish Sciences, Warsaw University.

\subsection*{Tangent Vectors}

\subsubsection*{Geometric Tangent Vectors}

Now, 1 thing that a Euclidean tangent vector provides is a means of taking ``directional derivatives'' of a function. \\
e.g. $\forall \, v_a \in \mathbb{R}^n_a$, $v_a$ yields $\begin{aligned} & \quad \\
  & \left. D_v \right|_a : C^{\infty}\mathbb{R}^n \to \mathbb{R} \\
  & \left. D_v \right|_a f  =   D_v f(a) = \left. \frac{d}{dt} \right|_{t=0}f(a+tv) \end{aligned}$ (3.1)

which takes the directional derivative in the direction $v$ at $a$.

$\left. D_v \right|_a$ linear and $\left. D_v \right|_a(fg) = f(a) \left. D_v \right|_a g + g(a) \left. D_v\right|_a f$ \quad \, (3.1)
\[
\left. \frac{d}{dt} \right|_{t=0} f(a+tv) = v^i \frac{\partial f}{ \partial x^i}(a)
\]

\[
 \left. D_v \right|_a f = v^i \frac{ \partial f}{ \partial x^i}(a)
\]

If $v_a = \left. e_j \right|_a$,
\[
\left. D_v \right|_a f = \frac{ \partial f}{ \partial x^i}(a)
\]

derivation at $a$, a linear $X: C^{\infty}\mathbb{R}^n \to \mathbb{R}$, $a\in \mathbb{R}^n$
\[
X(fg) = f(a) Xg + g(a) Xf
\]
$T_a\mathbb{R}^n$ set of all derivations of $C^{\infty}\mathbb{R}^n$ at $a$.  $T_a\mathbb{R}^n$ vector space.

\begin{lemma}[3.1] $X(c) =0$, $0$ const., $X(fg) = 0$ if $f(a) = g(a) =0$ \end{lemma}

\begin{proposition}[3.2] $\forall\, a \in \mathbb{R}^n$, map $v_a \mapsto \left. D_v \right|_a$ isomorphism from $\mathbb{R}^n_a $ onto $T_a\mathbb{R}^n$ \end{proposition}

\begin{proof} $v_a \mapsto \left. D_v \right|_a$ linear.

\[
\begin{gathered}
  \left. D_{bv+cw } \right|_a f = D_{bv + cw} f(a) = \left. \frac{d}{dt} \right|_{t=0} f(a + t(bv + cw) ) = (bv^i + cw^i ) \frac{ \partial f}{ \partial x^j}(a) = bv^j \frac{ \partial f}{ \partial x^j}(a) + cw^i \frac{ \partial f}{ \partial x^i}(a) = \\
   = b  \left. \frac{d}{dt} \right|_{t=0} f(a+tv) + c \left. \frac{d}{dt} \right|_{t=0} f(a+tw)= b \left. D_v \right|_a f + c \left. D_w\right|_a f = ( \left. b D_v \right|_a + c \left. D_w \right|_a ) f
\end{gathered}
\]
injective: $v_a \in \mathbb{R}_a^n$, write $v_a = \left. v^i e_i  \right|_a$

take $f$ to be $j$th coordinate function $x^j:  \mathbb{R}^n \to \mathbb{R}$, thought of as a smooth function on $\mathbb{R}^n$
\[
0 = \left. D_v \right|_a(x^j) = v^i \delta_i^j = v^j \quad \, \forall \, j
\]
Then $v_a=0$

surjective, let $X \in T_a\mathbb{R}^n$ \\
define $v^i = X(x^i)$ \\
We'll show $X = \left. D_v \right|_a$, $v = v^ie_i$

Let $f$ be any smooth function on $\mathbb{R}^n$, $f: \mathbb{R}^n \to \mathbb{R}$.  \\
By Taylor's formula with remainder (Thm. A.58), $\exists \,$ smooth $g_1 \dots g_n$ on $\mathbb{R}^n$ s.t. $g_i(a) =0$
\[
f(x) = f(a) + \sum_{i=1}^n \frac{ \partial f}{ \partial x^i}(a) (x^i - a^i) + \sum_{i=1}^n g_i(x) (x^i - a^i)
\]

Recall Lemma 3.1, and note $x^i - a^i = 0$ if $x=a$
\[
\begin{gathered}
  \begin{aligned}
    Xf & = X(f(a)) + \sum_{i=1}^n X \left( \frac{ \partial f}{ \partial x^i }(a) (x^i - a^i ) \right) + \sum_{i=1}^n X(g_i(x)(x^i -a^i) )  = 0 + \sum_{i=1}^n \frac{ \partial f}{ \partial x^i}(a) \left( X(x^i) - X(a^i) \right) = \\
     & = \sum_{i=1}^n X(x^i) \frac{ \partial f}{ \partial x^j}(a)  = v^i \frac{ \partial f}{ \partial x^i }(a) = \left. D_v \right|_a f
  \end{aligned} \\
\Longrightarrow X = \left. D_v \right|_a
\end{gathered}
\]

\end{proof}

\begin{corollary}[3.3]
$\forall \, a \in \mathbb{R}^n$, $n$ derivatives.  $ \left. \frac{ \partial }{ \partial x^1 } \right|_a \dots \left. \frac{ \partial }{ \partial x^n} \right|_a$ defined by $ \left. \frac{ \partial }{ \partial x^i} \right|_a f = \frac{ \partial f}{ \partial x^i}(a)$ form a basis for $T_a \mathbb{R}^n$, $\text{dim}{ T_a \mathbb{R}^n} = n$
\end{corollary}

\begin{proof}
as above, $\forall \, X \in T_a\mathbb{R}^n$, $X$ derivation.  $Xf = v^i \left. \frac{ \partial }{ \partial x^i } \right|_a f $, so $\lbrace  \left. \frac{ \partial }{ \partial x^i } \right|_a \rbrace$ spans $T_a \mathbb{R}^n$

for linear independence, $0 = v^i \left. \frac{ \partial }{ \partial x^i } \right|_a f$.  Then $v^i = 0$, \, $\forall \, i$

Note $\left. \frac{ \partial }{ \partial x^i } \right|_a = \left. D_{e_i} \right|_a$ with $e_i = \delta_i^{\, \, j} e_j$.

\end{proof}

\subsubsection*{Tangent Vectors on a Manifold}

linear $X: C^{\infty}M  \to \mathbb{R}$ derivation at $p$ if $X(fg) = f(p) Xg + g(p) Xf$.  $\forall\, f,g \in C^{\infty}M$  \\
tangent space $T_pM = $ set of all derivations of $C^{\infty}M$

\exercisehead{3.1} Lemma 3.4
\begin{enumerate}
\item[(a)] $f$ const. So let $f=0$.
\[
X(cf) = cX(f) = X(ff) = f(p) Xf + f(p) Xf = 2X(cf) \Longrightarrow X(f) = 0
\]
\item[(b)] if $f(p) = g(p) = 0 $, $X(fg) = 0$, by definition.
\end{enumerate}

\subsection*{Pushforwards}

Let smooth $F: M \to N$  \\ $\forall \, p \in M$, define $F_* : T_p M \to T_{F(p)}N$, pushforward
\[
(F_*X)(f) = X(fF)
\]
$f\in C^{\infty}N$, $fF \in C^{\infty}M$, so $X(fF)$ makes sense.

\[
(F_*X)(fg) = X( (fg) F) = X((fF)(gF) ) = fF(p) X(gF) + gF(p) X(fF) = f(F(p)) (F_*X)g + g(F(p)) (F_*X)(f)
\]

\begin{lemma}[3.5] (\textbf{Properties of Pushforwards})
\begin{enumerate}
  \item[(a)]
\[
 (F_* X)( af + bg) = X((af + bg) F) = aX(fF) + bX(gF) = aF_*X(f) + bF_*X(g)
\]
$F_*X$ linear
  \item[(b)]
\[
gf_* = g_* f_*:T_pM \to T_{gf(p)}P
\]
\end{enumerate}
\end{lemma}

\exercisehead{3.2}
\begin{enumerate}
\item[(a)]
\item[(b)]$\begin{aligned} & \quad \\
  f : & M \to N \\
  g : & N \to P \\
  gf : & M \to P \end{aligned}$ \quad \, Consider $\begin{aligned} & \quad \\
  p \in M , & (U, \varphi) \subset M  \\
  q = f(p) \in N , & (V, \psi) \subset N \\
  r = g(q) \in P , & (W, \chi) \subset P \end{aligned}$ \quad \, $\begin{aligned} & \quad \\
  & V \in T_pM \\
  & W \in T_qN \\
  & X \in T_{g(q)}P \end{aligned}$ \quad \, $\begin{aligned} & \quad \\
  & V = V^{\alpha} \frac{ \partial }{ \partial x^{\alpha} } \\
  & W = W^{\beta} \frac{ \partial }{ \partial y^{\beta} } \\
  & X = X^{\gamma} \frac{ \partial }{ \partial z^{\gamma} } \end{aligned}$

\[
\begin{gathered}
\begin{aligned}
  & f_*V \in T_{f(p)}N \\
  & f_*V[h] = V[hf] \\
  & f_*V[h\psi^{-1}(y)] = V[hf\varphi^{-1}(x)]
\end{aligned} \quad \quad \, \begin{aligned}
  & g_*W \in T_{g(q)}P \\
  & g_*W[k] = W[kg] \\
  & g_*W[k\chi^{-1}(z)] = W[kg\psi^{-1}(y)]
\end{aligned}  \quad \quad \, \begin{aligned}
  & gf_*V \in T_{gf(p)}P \\
  & gf_*V[l] = V[lgf] \\
  & gf_*V[l\chi^{-1}(z)] = V[lgf\varphi^{-1}(x)]
\end{aligned} \\
\end{gathered}
\]

\[
\Longrightarrow g_*(f_*V)[l] = f_* V[lg] = V[lgf] = gf_*V[l]
\]

In coordinates,
\[
\begin{gathered}
  g_*(f_*V)[l\chi^{-1}(z) ] = f_*V[lg\psi^{-1}(y)] = W^{\alpha} \frac{ \partial }{ \partial y^{\alpha}}[ lg\psi^{-1}(y)] = V^{\mu} \frac{ \partial y^{\alpha} }{ \partial x^{\mu} } \frac{ \partial }{ \partial y^{\alpha} } [lg\psi^{-1}(y)] = V^{\mu} \frac{ \partial (y^{\alpha}f\varphi^{-1}(x)) }{ \partial x^{\mu} } \frac{ \partial }{ \partial y^{\alpha} } [lg\psi^{-1}(y) ] \\
  gf_*V[l \chi^{-1}(z) ] = V[lgf\varphi^{-1}(x) ] = V^{\alpha} \frac{ \partial }{ \partial x^{\alpha} }( lgf\varphi^{-1}(x)) \\
  \Longrightarrow  \frac{ \partial }{ \partial x^{\mu} }( lgf\varphi^{-1}(x)) = \frac{ \partial (y^{\alpha}f\varphi^{-1}(x)) }{ \partial x^{\mu} } \frac{ \partial }{ \partial y^{\alpha} } [lg\psi^{-1}(y) ]
\end{gathered}
\]
Chain rule is reobtained.

\hrulefill

Alternatively,

Let $\begin{aligned} & \quad \\
  & F: M \to N \\
  & G: N \to P \end{aligned}$ \quad \quad \, $p\in M$

$\begin{aligned} & \quad \\
  & GF : M \to P \\
  & (GF)_*: T_pM \to T_{GF(p)}P \end{aligned}$.  $h\in C^{\infty}P$

Now consider

\[
G_* (F_*X)(h) = F_* X(hG) = X(hGF)\Longrightarrow G_* F_* = (GF)_*
\]

\item[(c)] \[
(1_M)_* X(f) = X(f1) = X(f)
\]
so $(1_M)_* = 1_{T_pM }$
\item[(d)]
Now
\[
\begin{aligned}
  & M \xrightarrow{F} N \\
  & T_pM \xrightarrow{ F_*} T_{F(p)}N
\end{aligned}
\]
cf. Tu, pp. 80, 8 Tangent Space, Corollary 8.7.  If $F: M \to N$, $p\in M$, $F$ diffeomorphism, \\
\phantom{cf. Tu, pp. 80, 8 Tangent Space, Corollary 8.7. } $F_*: T_p M \to T_{F(p)}N$ isomorphism.

\begin{proof}
  To say that $F$ is a diffeomorphism, means that it has a differentiable inverse $G: N \to M$ s.t.
\[
\begin{aligned}
  & GF = 1_M \\
  & FG = 1_N
\end{aligned} \quad \quad \quad \,
 \begin{aligned}
   & (GF)_* = G_* F_* = (1_M)_* = 1_{T_pM} \\
   & (FG)_* = F_* G_* = (1_N)_* = 1_{T_{F(p)}N}
\end{aligned}
\]
So then $F_*, G_*$ are isomorphisms, bijective homomorphism.
\end{proof}
\end{enumerate}

identify $T_pU$ with $T_pM$ $\forall \, p \in U$.   Since the action of a derivation on a function depends only on the values of the function in an arbitrary small neighborhood.
In particular, this means that any tangent vector $X \in T_pM$ can be unambiguously applied to functions defined only in a neighborhood of $p$ not necessarily on all of $M$ (note partition of unity, bump functions).

\begin{proposition}[3.7] open submanifold $U \subset M$, inclusion $i: U \hookrightarrow M$.  $\forall \, p \in U$, $i_* : T_pU \to T_p M$ isomorphism. \end{proposition}

\exercisehead{3.3} If $F: M \to N$ local diffeomorphism,

$\forall \, p \in M$, $\exists \, $ open $U \ni p$ s.t. $F(U)$ open in $N$ and $\left. F\right|_U : U \to F(U)$ diffeomorphism.

Consider $G: F(U) \to U$, $G$ diff. (smooth) inverse of $\left. F \right|_U$.

$F(p) \in $ open $F(U)$

\[
\begin{aligned}
  ( \left. F \right|_U )_*    &    : T_pU \to T_{ F(p)}F(U) \\
  (G)_*                       &    : T_{F(p)}F(U) \to T_pU \\
  (FG)_*                      & = (1_{F(U)} )_* = 1_{T_{F(P)}}F(U) = ( \left. F \right|_U )_* G_* \\
  (GF)_*    & = (1_U)_* = 1_{T_pU} = G_* (  \left. F \right|_U)_*
\end{aligned}
\]
Then $( \left. F \right|_U)_*$, $G_*$ are isomorphisms between $T_pU \to T_{F(p)}F(U)$.  This must be true $\forall \, p \in M$, so $F_* : T_pM \to T_{F(p)}N$ isomorphism $\forall \, p \in M$

I think the idea for a local diffeomorphism is that ``$F_* : T_p M \to T_{F(p)}F(M)$''.

\subsection*{Computations in Coordinates}

\subsubsection*{Change of Coordinates}

\subsection*{The Tangent Bundle }

%\begin{lemma}[4.1] $TM$ has smooth structure making it $2n$-dim. smooth manifold.  \\
%$\pi :TM \to M$ smooth \end{lemma}

\begin{proposition}[3.18] $TM$ has smooth structure making it $2n$-dim. smooth manifold.  \\
$\pi :TM \to M$ smooth \end{proposition}

\begin{proof}
$\forall \, $ chart $(U, \varphi) $ for $M$, $\varphi = (x^1 \dots x^n)$  \\
Define $\widetilde{\varphi} : \pi^{-1}(U) \to \mathbb{R}^{2n}$
\[
\widetilde{\varphi}\left( v^i \left. \frac{ \partial }{ \partial x^i } \right|_p \right) = (x^1(p) \dots x^n(p), v^1 \dots v^n)
\]
$\widetilde{\varphi}(\pi^{-1}(U)) = \varphi(U) \times \mathbb{R}^n$, which is open \\
$\widetilde{\varphi}$ bijection since
\[
\begin{aligned}
  & \widetilde{\varphi}^{-1}(x^1 \dots x^n, v^1 \dots v^n) = v^i \left. \frac{ \partial }{ \partial x^i} \right|_{\varphi^{-1}(x)} \\
  & \widetilde{\varphi} \widetilde{\varphi}^{-1} = 1_{\mathbb{R}^{2n}}, \, \widetilde{\varphi}^{-1} \widetilde{\varphi} = 1_{ \pi^{-1}(U) \subset T_pM }
\end{aligned}
\]

Suppose charts $\begin{aligned} & \quad \\
  & (U, \varphi) \\
  & (V, \psi ) \end{aligned}$ for $M$, \\
$\begin{aligned} & \quad \\
  & (\pi^{-1}(U), \widetilde{\varphi}) \\
  & ( \pi^{-1}(V), \widetilde{\psi} ) \end{aligned}$ on $TM$ ($\widetilde{\varphi}, \widetilde{\psi}$ homeomorphisms, cont. bijective, cont. inverse, $\pi$ cont., $\begin{aligned} & \quad \\
  & \pi^{-1}(U) \\ & \pi^{-1}(V) \end{aligned}$ open)

$\begin{aligned} & \quad \\
  & \widetilde{\varphi}( \pi^{-1}(U) \pi^{-1}(V) ) = \varphi(UV) \times \mathbb{R}^n \\
  & \widetilde{\psi}(\pi^{-1}(U) \pi^{-1}(V)) =  \psi(UV)\times \mathbb{R}^n \end{aligned}$ open in $\mathbb{R}^{2n}$

\[
\begin{aligned}
  & \widetilde{\psi} \widetilde{\varphi}^{-1} : \varphi(UV) \times \mathbb{R}^n \to \psi(UV) \times \mathbb{R}^n \\
  & \widetilde{\psi} \widetilde{\varphi}^{-1}(x^1 \dots x^n, v^1 \dots v^n) = (y^1(x) \dots y^n(x), \frac{ \partial y^1}{ \partial x^j}(x) v^j \dots \frac{ \partial y^n}{ \partial x^j}(x) v^j )
\end{aligned}
\]

$\widetilde{\psi} \widetilde{\varphi}^{-1}$ clearly smooth.

Choose countable cover $\lbrace U_i \rbrace$ of $M$ by smooth coordinate domains.  \\
$\lbrace \pi^{-1}(U_i) \rbrace$ countable cover of $TM$ by coordinate domains.

fiber of $\pi$ : $\pi^{-1}( \lbrace p \rbrace)$ (fiber is like a preimage of a singleton set) \\
Consider $\widetilde{x}, \widetilde{y} \in \pi^{-1}(\lbrace p \rbrace)$, then $\widetilde{x}, \widetilde{y} \in \widetilde{\varphi}$ (lie in 1 chart) \\
If $(p,X), (q,Y)$ lie in different fibers, $\exists \, $ disjoint smooth coordinate domains $U,V$ for $M$ ($M$ Hausdorff) s.t. $\begin{aligned} & \quad \\
  & p \in U \\
  & q \in V \end{aligned}$ and  \\
$\pi^{-1}(U), \pi^{-1}(V)$ disjoint, smooth coordinate neighborhoods s.t. $\begin{aligned} & \quad \\
  & \pi^{-1}(U) \ni (p,X) \\
  & \pi^{-1}(V) \ni (q,Y) \end{aligned}$

$\pi(x,v) = x$, so $\pi$ smooth.

\end{proof}

\subsubsection*{The Tangent Space to a Manifold with Boundary}

define pushforward by $F$ at $p\in M$ to be linear $F_*:T_pM \to T_{F(p)}N$ defined by $(F_*X)f = X(fF)$

\begin{lemma}[3.10] If $M^n$ with boundary, $p\in \partial M$, \\
then $T_pM$ $n$-dim. vector space with basis $\left( \left. \frac{ \partial }{ \partial x^1 } \right|_p \dots \left. \frac{ \partial }{ \partial x^n } \right|_p \right)$ in any smooth chart.
\end{lemma}

\begin{proof} $T_pM$ vector space with basis $\left( \left. \frac{ \partial }{ \partial x^i} \right|_p \right)$

$\forall \, $ smooth coordinate map $\varphi$, $\varphi_* : T_p M \to T_{ \varphi(p)} \mathbb{H}^n$ isomorphism by the same argument as manifolds.  \\
$\forall \, a \in \partial \mathbb{H}^n$, $T_a H^n$ $n$-dim. and spanned by $\left( \left. \frac{ \partial }{ \partial x^i } \right|_p \right)$.

Consider inclusion $i : \mathbb{H}^n \hookrightarrow \mathbb{R}^n$.  Show $i_*: T_a \mathbb{H}^n \to T_a \mathbb{R}^n$ isomorphism.  \\
Suppose $i_*X =0$.  \\
Let smooth $f \in \mathbb{R}$ on neighborhood of $a$ in $\mathbb{H}^n$ \\
Let $\widetilde{f}$ extension of $f$ to smooth function on an open subset of $\mathbb{R}^n$ (by extension lemma)
\[
\begin{gathered}
  \widetilde{f} \circ i = f \\
  Xf = X(\widetilde{f} i ) = (i_* X)\widetilde{f} = 0
\end{gathered}
\]
Then $X=0$.  So $i_*$ injective.

If arbitrary $Y \in T_a \mathbb{R}^n$, define $X \in T_a \mathbb{H}^n$, by
\[
\begin{gathered}
Xf = Y \widetilde{f} \quad \quad \quad Y^i \left. \frac{ \partial }{ \partial x^i} \right|_a \widetilde{f} = Y^i \frac{ \partial \widetilde{f}}{ \partial x^i}(a)
\end{gathered}
\]
This is well-defined because by cont. the derivatives of $\widetilde{f}$ at $a$ are determined by those of $f$ in $\mathbb{H}^n$
\[
\begin{aligned}
  X(fg) & = Y(\widetilde{f} \widetilde{g}) = Y^i \left. \frac{ \partial}{ \partial x^i} \right|_a (\widetilde{f} \widetilde{g}) = Y^i \frac{ \partial \widetilde{f}(a)}{ \partial x^i} \widetilde{g}(a)  + Y^i \widetilde{f}(a) \frac{ \partial \widetilde{g} }{ \partial x^i }(a) = \widetilde{g}(a) Y(\widetilde{f}) + \widetilde{f}(a) Y(\widetilde{g}) = \\
  & = g(a) Xf + f(a) Xg
\end{aligned}
\]
$X$ derivation at $a$.  $Y = i_* X$, so $i_*$ surjective.

$i_*$ isomorphism.

\end{proof}

\subsection*{ Tangent Vectors to Curves}

tangent vector to $\gamma$ at $t_0 \in J \subset \mathbb{R}$
\[
\begin{aligned}
  & \gamma'(t_0) = \gamma_* \left( \left. \frac{d}{dt} \right|_{t_0} \right) \in T_{\gamma(t_0)}M \\
\end{aligned}
\]
Tangent vectors act on functions by

\[
\begin{aligned}
  & \gamma'(t_0) f = \left( \left. \gamma_*  \frac{d}{dt} \right|_{t_0} \right) f = \left. \frac{d}{dt} \right|_{t_0}(f\gamma) = \frac{d(f\gamma)}{ dt}(t_0)
\end{aligned}
\]

$\begin{aligned}
  & \quad \\
  & \gamma : I \to M \\
  & \gamma_* : T_{t_0} \mathbb{R} \to T_p M \\
  & \dot{\gamma} : I \to T_p M \\
\end{aligned}$

For $(U,x^i)$, $p\in U$
\[
\begin{gathered}
\dot{\gamma}(t_0) f = \gamma_* \left( \left. \frac{d}{dt}  \right|_{t_0} \right) f = \left. \frac{d}{dt} \right|_{t_0} (f\gamma) = \left. \frac{d}{dt} \right|_{t_0} (f (x^i)^{-1} x^i \gamma ) = \left. \frac{d}{dt} \right|_{t_0} ( f( \gamma^i)(t) )  =  \left. \frac{ \partial f}{  \partial x^i } \right|_p \left. \frac{ d \gamma^i }{ dt} \right|_{t_0} = \dot{\gamma}^i \left. \frac{ \partial f}{ \partial x^i } \right|_p  \\
\Longrightarrow \dot{ \gamma}(t_0) = \left. \dot{\gamma}^i(t_0) \frac{ \partial}{ \partial x^i} \right|_p
\end{gathered}
\]

\begin{lemma}[3.11] Let $p\in M$.  $\forall \, X \in T_p M$, $X$ tangent vector is some smooth curve in $M$. \end{lemma}

\begin{proof}
Let $(U,\varphi)$, \, $p \in U$, \, $X = X^i \left. \frac{ \partial }{ \partial x^i} \right|_p$

Define $\gamma: (-\epsilon, \epsilon) \to U$ by $\gamma(t) = (tX^1 \dots tX^n)$ i.e. $\gamma(t) = \varphi^{-1}(t X^1 \dots tX^n)$  \\
$\gamma(0) = p$,  \, $\gamma'(0) = X^i \left. \frac{ \partial }{ \partial x^i} \right|_{\gamma(0)} = X$

\end{proof}

tangent vectors to curves behave well under composition with smooth maps.

\begin{proposition}[3.12] (The tangent vector to a composite curve)
 Let smooth $F: M \to N$, smooth curve $\gamma : J \to M$

$\forall\, t_0 \in J$, tangent vector $F\gamma:J\to N$, $t=t_0$ given by
\[
(F\gamma)'(t_0) = F_*(\gamma'(t_0))
\]
\end{proposition}

\begin{proof}
\[
(F\gamma)'(t_0) = \left. (F\gamma)_* \frac{d}{dt} \right|_{t_0} = F_* \gamma_* \left. \frac{d}{dt} \right|_{t_0} = F_*(\gamma'(t_0))
\]
(use def. of tangent vector to a curve)
\end{proof}

Use it to compute pushforwards. \\
Suppose $F:M \to N$.  $F_* = $ ? \\
$\forall \, X \in T_pM$, choose smooth $\gamma$ whose tangent vector at $t=0$ is $X$,
\[
F_* X = (F\gamma)'(0) \quad \quad \, (3.10)
\]

Indeed, Lemma 3.11 $\begin{aligned} & \quad \\
  & \gamma(0) = p \\
  & \dot{\gamma}(0) = X \end{aligned}$
\[
F_*(\gamma'(0)) = F_*X = \dot{ (F\gamma)}(0)
\]

\subsection*{ Alternative Definitions of the Tangent Space}

smooth function element $(f,U)$, open $U \subset M$, smooth $f:U \to \mathbb{R}$\\
$\forall \, p \in M$, $(f,U) \sim (g,V)$, if $f\equiv g$ on some neighborhood $W \ni p$
\[
\begin{gathered}
  [ (f,U)] = \text{ germ of $f$ at $p$} \\
 \lbrace [ (f,U) ] \rbrace \text{ at $p$ } = C_p^{\infty}
\end{gathered}
\]

$C^{\infty}_p$ real vector space.
\[
\begin{gathered}
  \left[ (f,U) \right] + [(g,V)] = [(f+g, UV) ] \\
 c[(f,U)] = [(cf, U) ] \\
 [(f,U)] [(g,V)] = [ (fg, UV)]
\end{gathered}
\]

Denote $[ (f,U)] = [f]_p$ \\
$T_p M = $ set of all derivations, linear $X: C_p^{\infty} \to \mathbb{R}$ s.t.
\[
X[fg]_p = f(p) X[g]_p + g(p) X[f]_p
\]

By Prop. 3.6. $Xf = Xg$ if $f=g$ on some neighborhood $W$ of $p$ ($\psi \in C^{\infty}M$ smooth bump function with support needed).

This space is isomorphic to the tangent space as we've defined it (Prob. 3-7).

\subsection*{Problems}

\problemhead{3-1} $M$ connected.  \\
$X \in T_pM$
\[
F_*X(fg) = X((fg)F) = X((fF)(gF)) = f(F(p)) X(gF) + g(F(p))X(fF) = 0
\]

Let $g= f \in C^{\infty}M$.  $f(F(p))X(fF) = 0$ $X(fF) =0$.  $fF$ const. by properties of tangent vector $X$.  $f$ arbitrary, so $F$ const.

\problemhead{3-3} $M^m$ diffeomorphic to $N^n$ by $F$.  \\
$T_pM$ isomorphic to $T_{F(p)}N$.  Then $\text{dim}{ (T_pM)} = \text{dim}{ (T_{F(p)}N)}$  $m=n$  \\
cf. Tu, Corollary 8.8.  Indeed for $\begin{aligned} & \quad \\
  & (U,\varphi), \, U \ni p \\
  & (V, \psi ), \, V\ni F(p) \end{aligned}$ \quad \, $\begin{aligned} & \quad \\
  & (\psi F \varphi^{-1}):\mathbb{R}^m \to \mathbb{R}^n \text{ is a diffeomorphism } \\
  & (\psi F \varphi^{-1})_* : T_{ \varphi(p)} \mathbb{R}^m \to T_{\psi(F(p))} \mathbb{R}^n \text{ is an isomorphism } \end{aligned}$

cf. wj32 has some good solutions specifically for Lee (2012) \url{http://wj32.org/wp/wp-content/uploads/2012/12/Introduction-to-Smooth-Manifolds.pdf}
\problemhead{3-4}

Adapted from wj32 \url{http://wj32.org/wp/wp-content/uploads/2012/12/Introduction-to-Smooth-Manifolds.pdf}

Now clearly $\forall \, p \in S^1 $ $\exists \, p \in S^1$, $\exists \, (U,\theta) \in \mathcal{A}_{S^1}$ s.t. $\begin{aligned} & \quad \\
  & \theta : U \to \mathbb{R} \\
  & \theta(p) \in \mathbb{R}
\end{aligned}$ \quad \, $U \ni p$.  $T_p S^1 \ni \left. \frac{ \partial }{ \partial \theta} \right|_p$.

Define $F: S^1 \times \mathbb{R} \to TS^1$ s.t.
\[
(p,r) \mapsto r \left. \frac{ \partial }{ \partial \theta } \right|_p \text{ for } U\ni p, \, \left. \frac{ \partial }{ \partial \theta}\right|_p \in T_pU
\]

Consider smooth chart $(U,\theta)$, $U\ni p$, $\begin{aligned} & \quad \\
  & \widehat{\theta}:U\times \mathbb{R} \to \mathbb{R}\times \mathbb{R} \\
  & \widehat{\theta}(p,r)  = (\theta(p),r) \end{aligned}$

The strategy is to think of the map from $\mathbb{R}^2$ to $\mathbb{R}^2$.  So consider
\[
F=F\circ \widehat{\theta}^{-1}\widehat{\theta}
\]

Consider smooth chart $\xi_{\theta}:TU \to \mathbb{R}^2$
\[
\xi_{\theta}:X \mapsto ((\theta \circ \pi)(X), (d\theta)_{\pi(X)}X)
\]

\[
\begin{gathered}
  F\circ \widehat{\theta}^{-1}(\theta,r) = r \left. \frac{ \partial }{ \partial \theta }\right|_p \\
\xi_{\theta} \circ F\circ \widehat{\theta}^{-1}(\theta,r) = \left( \theta\circ \pi \left( r \frac{ \partial }{ \partial \theta }\right)_p , (d\theta)_{\pi(r\left. \frac{ \partial }{ \partial \theta }\right|_p ) }\left( \left. r \frac{ \partial }{ \partial \theta }\right|_p  \right) \right)= (\theta(p),r)
\end{gathered}
\]
$F^{-1}:X_p \in T_pS^1 \mapsto (p,r)$ where $X_p = \left. r\frac{ \partial }{ \partial \theta }\right|_p$

$\xi_{\theta}\circ F \circ \widehat{\theta}^{-1}$ clearly smooth and bijective.  $F$ diffeomorphism.


text:
\SetAPI{J-C}
\section{security.signature.encryption.keypadding.length}
\label{configuration:SecuritySignatureEncryptionKeypaddingLength}
\ClearAPI
\TODO
%% GENERATED USAGE REFERENCE - DO NOT EDIT
%% GENERATED USAGE REFERENCE END
\begin{lstlisting}[style=Props,caption={Usage example for \textit{security.signature.encryption.keypadding.length}}]
security.signature.encryption.keypadding.length=
\end{lstlisting}

max_stars_repo_name: Dennis-Koch/ambeth

max_issues_repo_name: Dennis-Koch/ambeth

max_forks_repo_name: Dennis-Koch/ambeth


text:
Today and the next few lectures, we're going to have a change of pace, developing some more fundamental properties
of schemes before using them to talk more about quasicoherent sheaves, differentials, etc. Today, for example,
we'll talk about affine covers, and what properties can be checked affine-locally. This will enable us to turn our
story about differentials from one about rings and modules to one about schemes and quasicoherent sheaves.
\begin{defn}
An \term{affine open} of a scheme \(X\) is an open subset \(U\) that is isomorphic to \(\Spec A\) for some ring
\(A\).
\end{defn}
The intersection of affine opens may not be itself open. For example, let \(X = \A^2\amalg_{\A^2\setminus 0}\A^2\),
the \term{plane with two opens} (we've already done this with a line, and this isn't very different). The
intersection of the two copies of \(\A^2\), which are both affine opens, is \(\A^2\setminus 0\), which we know is
not affine.

One can define what it means for a scheme to be separated, which is analogous to the Hausdorff condition on
manifolds, and will guarantee that the intersection of affine opens is affine.
\begin{prop}
\label{affineintersprop}
Let \(X\) be a scheme and \(\Spec A,\Spec B\subset X\) be affine opens. Then, \(\Spec A\cap\Spec B\) is a union of
open subsets that are distinguished open subsets for both \(\Spec A\) and \(\Spec B\).
\end{prop}
\begin{proof}
Suppose \(p\in\Spec A\cap\Spec B\). Then, there's an \(f\in A\) such that \(p\in\Spec A_f\subset\Spec A\cap\Spec
B\), and therefore a \(g\in B\) such that \(p\in\Spec B_g\subset\Spec A_f\subset\Spec A\cap\Spec B\).

The claim is that \(\Spec B_g\) is a distinguished open in \(\Spec A\). Restriction defines a map \(B = \sO_X(\Spec
B)\to\sO_X(\Spec A_f) = A_f\); let \(\widetilde g\) be the image of \(g\) under this map. Then, the points of
\(\Spec A_f\) where \(g\) vanishes are the same as the same points where \(\widetilde g\) vanishes (which is
exactly what restriction does). Thus, \(\Spec B_g = \Spec (A_f)_{\widetilde g} = \Spec A_{f\widetilde g}\).
\end{proof}
One way to think of this is that a distinguished open of a distinguished open is distinguished in the original
scheme.

We'll use this to prove an extremely useful lemma, the affine communication lemma. This is sometimes called the ACL
(not to be confused with the Austin City Limits music festival nor the anterior cruciate ligament in your knee,
though these are both great things too).
\begin{lem}[Affine communication lemma]
\label{ACL}
Suppose \(P\) is a property\footnote{Formally, a \term{property} is a subset of the set of affine opens of \(X\);
more generally, one could do this in a way independent of the scheme \(X\) by considering the set of all affine
open embeddings \(\Spec A\inj X\) over all schemes \(X\); a general property is a subset of this huge set. Examples
will be Noetherianness, reducedness, etc.}
enjoyed by some affine opens of a scheme \(X\), such that:
\begin{enumerate}
	\item\label{resthyp} The property is preserved by restriction: if \(\Spec A\in P\), then for all \(f\in A\),
	\(\Spec A_f\in P\).
	\item\label{gluehyp} The property is preserved by finite gluing: if \(A = (f_1,\dotsc,f_n)\) and \(\Spec
	A_{f_i}\in P\) for all \(i\), then \(\Spec A\in P\).
	\item\label{coverhyp} There is a cover of \(X\) by affine opens that satisfy \(P\).
\end{enumerate}
Then, every affine open subset of \(X\) is in \(P\).
\end{lem}
\begin{defn}
If \(P\) is a property of affine opens that satisfies the hypotheses of Lemma~\ref{ACL}, then we'll call \(P\) an
\term{affine-local} property.
\end{defn}
We'll generally use this to prove things about a scheme using only a particular cover, rather than having to check
all affine opens. Another nice fact about affine-local properties is that any open subset \(U\subset X\) (not just
affine opens) inherits any affine-local property of \(X\). Many of these properties will ultimately be geometric,
and we'll give a long list of them.
\begin{proof}[Proof of Lemma~\ref{ACL}]
The proof is actually trivial: the perfect lemma is non-obvious, extremely useful, and easy to prove.

Suppose \(\Spec A\subset X\) is open. There's a cover \(\fU\) of \(X\) by affine opens \(\Spec B_i\in P\) by
hypothesis \eqref{coverhyp}. By Proposition~\ref{affineintersprop}, \(\Spec B_i\cap\Spec A\) can be covered by open
subsets which are distinguished opens of both \(\Spec A\) and \(X\), and by hypothesis~\eqref{resthyp}, each of
these has property \(P\). Thus, there's a cover of \(\Spec A\) by distinguished opens \(\Spec A_f\in P\).
Since \(\Spec A\) is quasicompact, then we may assume this cover is finite, so by hypothesis~\eqref{gluehyp},
\(\Spec A\in P\).
\end{proof}
There's a lot of verifications that various properties are affine-local; we'll skip over some of these.

The following proposition is Exercises 5.3.G and 5.3.H in Vakil's notes. Recall that a ring is reduced if it has no
nilpotents other than \(0\).
\begin{prop}
Let \(A\) be a ring and \(f_1,\dotsc,f_n\) generate \(A\).
\begin{enumerate}
	\item \(A\) is reduced iff \(A_{f_i}\) is reduced for all \(i\).
	\item\label{noethaffloc} \(A\) is Noetherian iff \(A_{f_i}\) is Noetherian for all \(i\).
	\item\label{fgloc} If \(B\) is another ring and \(B\to A\) gives \(A\) the structure of a \(B\)-algebra, then
	\(A\) is finitely generated over \(B\) iff each \(A_{f_i}\) is finitely generated over \(B\).
\end{enumerate}
\end{prop}
This means that the analogoues of these properties for schemes are affine-local.
\begin{proof}[Proof of items~\eqref{noethaffloc} and \eqref{fgloc}]
Though we'll only prove one of these, most of the proofs of these things go the same way. There are a few
exceptions, however.

First, suppose \(A\) is Noetherian, and let \(I_1\subsetneqq I_2\subsetneqq I_3\subsetneqq\dotsb\) be an ascending
chain of ideals in \(A_f\). Let \(\iota:A\inj A_f\) be the canonical inclusion, and let \(J_i =
\iota^{-1}(I_i)\).\footnote{If \(A\) is an integral domain, we can think of this as \(I_i\cap A\subset A\subset A_f\),
but this isn't always true in general.} Then, \(J_1\subset J_2\subset J_3\subset\dotsb\). Inside \(A_f\), there
must be some \(x/f^N\in I_{n+1}\ I_n\), and therefore, by clearing denominators, \(x\in J_{n+1}\setminus J_n\), so
\(A\) isn't Noetherian.

In the other direction, we'll also prove the contrapositive. Suppose \(J_1\subsetneqq J_2\subsetneqq
J_3\subsetneqq\dotsb\) be an ascending chain of ideals in \(A\), and for each \(i\), let \(I_{i,j}\) be the
localization of \(J_j\) at \(f_i\). Then, for all \(j\), there's some \(i\) for which \(I_{i,j}\subsetneqq
I_{i,j+1}\). The idea is that since the \(f_i\) generate \(A\), then \(A\inj\prod_{i=1}^n A_{f_i}\) sending
\(r_i\mapsto (r_i)_{i=1}^n\). If \(r_j\in J_{j+1}\setminus J_j\), then \(r_j\subset I_{i,j}\) for al \(i\), but it
can't be in all of the \(I_{i,j+1}\). There's a little more to say here, but it's kind of annoying.

For~\eqref{fgloc} let \(r_1,\dotsc,r_n\) be generators of \(A\) as a \(B\)-algebra. Then, \(A_f\) is generated by
\(\set{r_1,\dotsc,r_n,1/f}\), so it's clearly finitely generated. Conversely, since the \(f_i\) generate \(A\),
then \(1 = \sum r_if_i\) for some \(r_i\in A\). If \(A_{f_i}\) is generated by a finite set
\(\set{s_{ij}/f_j^{k_j}}\), with the \(s_{ij}\in A\), then (again, there's something to check here) \(A\) is
generated by \(\set{f_i, r_i, s_{ij}}\), which is a finite set.
\end{proof}
\begin{defn}
A scheme \(X\) is \term{reduced} if for all open subsets \(U\subset X\), \(\sO_X(U)\) is a reduced ring.
\end{defn}
Since \(\sO_X(U)\inj\prod_{x\in U}\sO_{X,x}\) as rings, this is equivalent to \(\sO_{X,x}\) being reduced for all
\(x\in X\).

One could also define an affine scheme \(\Spec A\) to be reduced if \(A\) is a reduced ring; then, our definition
is equivalent to affine opens of \(X\) being reduced, and hence, by Lemma~\ref{ACL}, there's a cover of \(X\) by
reduced affine opens. That is, we've proven the following.
\begin{cor}
The following are equivalent for a scheme \(X\).
\begin{enumerate}
	\item \(X\) is reduced.
	\item For every \(x\in X\), \(\sO_{X,x}\) is reduced as a ring.
	\item All affine opens of \(X\) are reduced.
	\item There exists a cover of \(X\) by reduced affine opens.
\end{enumerate}
\end{cor}
The naïve definition of reducedness would be for \(\Gamma(\sO_X)\) to be a reduced ring; however, this is
\emph{not} equivalent. One example is the ``first-order neighborhood of \(\P^1\)'' in the total space \(\sO(1)\).
Using split square-zero extensions, \(\sO_{\P^1}\oplus\sO(-1)\) is a ring, so we can define the scheme
\(X = \Spec(\sO_{\P^1}\oplus\sO(-1))\). This has no nonconstant global functions, so \(\Gamma(\sO_X)\) is reduced;
however, locally, the functions on the first-order neighborhood looks like \(k[\e]/(\e^2)\), which is not reduced.
This is why we used the definition that we did.

One moral is that, on non-affine schemes, global ring-theoretic properties may be badly behaved, so it's better to
use local ones.
\begin{defn}
Let \(X\) be a scheme.
\begin{itemize}
	\item \(X\) is \term{locally Noetherian} if there's a cover \(\fU\) by affine opens \(X = \bigcup_{i\in I}
	\Spec A_i\) such that each \(A_i\) is a Noetherian ring.
	\item \(X\) is \term{Noetherian} if it's quasicompact and locally Noetherian.
\end{itemize}
\end{defn}
Hence, if \(X\) is Noetherian, we can choose the cover \(\fU\) to be finite. Moreover, by Lemma~\ref{ACL}, if \(X\)
is locally Noetherian, \emph{all} affine open subsets of \(X\) are Noetherian.

Noetherianness is a very nice property, which is good because lots of schemes you and I might care about are
Noetherian. It's a strong ``finite-dimensionality'' condition. The following property is one nice example.
\begin{prop}
\label{noethnice}
If \(X\) is a Noetherian scheme, it's also Noetherian as a topological space, and therefore all open subsets of
\(X\) are quasicompact.
\end{prop}
Hence, for Noetherian schemes, the quasicompactness propagates, which is nice.
\begin{defn}
A scheme \(X\) is \term{quasiseparated} (abbreviated QS) if the intersection of any two quasicompact opens of \(X\)
is itself quasicompact.
\end{defn}
This means that the intersection of two affines may not be affine, but is a finite union of affines. This is not
just nice, but something that's scary to not have. Affine schemes are clearly QS, but so are locally Noetherian
schemes, because all quasicompact open subsets \(U\) of a locally Noetherian scheme \(X\) are Noetherian, so by
Proposition~\ref{noethnice}, any open subset of \(U\) is also quasicompact.

The QS condition is not a restriction, because almost all schemes you will come across will be quasiseparated;
instead, it's a signal that QS is used in a proof.
\begin{exm}
There are schemes that are not quasiseparated, however; if \(\A_k^\infty = \Spec k[x_1,x_2,\dotsc]\), then
\(\A_k^\infty\setminus 0\) isn't quasiseparated (not quasicompact).
\end{exm}
In some literature, ``scheme'' means ``quasicompact, quasiseparated scheme,'' and a scheme lacking these hypotheses
is explicity noted to not satisfy them. There is a lot of interesting infinite-dimensional geometry (e.g.\
classifying vector bundles), but we're not going to worry about them in this class.

We'll use the acronym QCQS to denote ``quasicompact quasiseparated;'' a scheme \(X\) is QCQS iff there's a finite
cover of \(X\) by affine opens, all of whose pairwise intersections are finite unions of affines. This is an
extremely useful hypothesis in arguments where you want to glue a hypothesis that we know about affine opens of a
QCQS scheme. It's not a particularly interesting geometric property, but is a ``reasonableness'' property, akin to
paracompactness of manifolds, that is a technical ingredient in proofs.
\subsection*{Properties of morphisms.}
Let \(\pi:X\to Y\) be a map of schemes. The preceding discussion allows us to define lots of different nice
properties that \(\pi\) could satisfy. In particular, we'll define a bunch of properties of \(\pi\) that can be
determined affine-locally on both \(X\) and \(Y\) (since here they correspond to homomorphisms of rings in the
opposite direction).

To be precise, let \(\Spec B\subset Y\) be an affine open and \(\Spec A\subset\pi^{-1}(\Spec B)\), so \(\Spec A\)
is an affine open subset of \(X\). Thus, \(A\) is a \(B\)-algebra.
\begin{defn}
\(\pi\) is \term{locally of finite type} if for every affine open \(\Spec B\subset Y\) and every affine open
\(\Spec A\subset\pi^{-1}(\Spec B)\), \(A\) is finitely generated as a \(B\)-algebra.
\end{defn}
If \(X\) and \(Y\) are Noetherian, this is equivalent to such \(A\) being finitely presented as a \(B\)-algebra; in
general, the two may be different, and if \(A\) is finitely presented as a \(B\)-algebra, one says \(\pi\) is
\term{locally of finite presentation}. We're not going to use this very much.

By the affine communication lemma, \(\pi\) is locally of finite type iff for all affine opens \(\Spec B\) of \(Y\),
\(\pi^{-1}(\Spec B)\) can be covered by affine opens \(\Spec A_i\) such that \(A_i\) is a finitely generated
\(B\)-algebra, which is easier to check.

Now, we can generalize a few properties of schemes to properties of morphisms.
\begin{comp}{defn}{itemize}
	\item \(\pi\) is \term{quasicompact} (resp.\ \term{quasiseparated}) if for all affine opens \(\Spec B\subset
	Y\), \(\pi^{-1}(\Spec B)\) is quasicompact (resp.\ quasiseparated).
	\item \(\pi\) is \term{affine} if for all affine opens \(\Spec B\subset Y\), \(\pi^{-1}(\Spec B)\) is affine.
\end{comp}
We'll prove these satisfy the hypotheses of Lemma~\ref{ACL}; this will make them extremely useful.


text:
\section{Estimation}

Only a single parameter of the model needs to be estimated: $\beta_L$. For this estimation, method of simulated moments is employed.  \textcite{eisenhauer_estimation_2015} suggests a diagonal matrix as a standard choice of weight matrix when using method of moments, allowing for writing the estimation as the sum of squared errors between the simulated and empirical moments. Phrased differently: the objective function minimizes the mean squared error (MSE) between the empirical moments and the simulated. Since I use aggregate data from Statistics Denmark, I have not access to the standard errors of the estimates of the empirical moments usually used for the weight of the individual moments. Instead, I weigh each moment equally. Since this application relies on grid search over the single parameter $\beta_L$, I choose the $\beta_L$ corresponding to the lowest loss of the objective function.

Usually when estimating a structural model using simulated methods of moments one would not supply the parameters as part of the state space. The reason for this is, that as the size of the state space expands, it gets exponentially more expensive to solve the model. The algorithm would go: For a given set of parameters needed to be estimated, supply a random initialization. Solve the model for given parameters. Use the solved model to calculate the moments. Use numerical optimization to minimize given optimization problem. However, in this application I have chosen to make the parameter part of the state space, since this paper tries to establish that high dimensional dynamic models can be solved using Deep Reinforcement Learning, and therefore not being a limited by the size of the state space.

This paper has implemented the following strategy for estimating the model: I create a grid of 50 points with $\beta_L$ values in the range $[0.2, 8]$ evenly spaced. I simulate $N=300$ agents for a given value of $\beta_L$ in the grid. Using the 300 agents the mean number of supplied hours per agent can be calculated. Here it is important to note, that if an agent works 0 hours, the agent is assumed to be out of the workforce and not appear in the statistics, therefore the objective function is:

\begin{equation}
    \text{Objective} = \sum_{q=Q_{\min}}^{Q_{\max}} \lsp \mu_{q} -\frac{1}{\sum_{i=1}^{N} \mathbf{1}\{H_{i,q} > 0\}}\sum_{i=1}^N (H_{i,q})\rsp^2
\end{equation}

Where $q$ denotes the age of an individual agent and $i$ denotes an individual. $\mu_q$ is the empirical average of supplied ours of women of age $q$. Again I use \textbf{LIGEF15} supplied by Statistics Denmark to get the average number of supplied of hours. I use the same seed for the simulation, every time the $N$ agents is simulated with a new $\beta_L$ value. The estimation is performed for each of the solution methods in this paper: Value function Iteration, Deep Q-Learning and Double Deep Q-Learning.

The estimation yields the following optimal values using VFI: $\beta_L=3.43$, DQN $\beta_L=3.59$ and Double DQN $\beta_L=3.59$. $3.43$ and $3.59$ are neighbouring grid points. I believe it is safe to conclude that these methods yields if not identical, then almost identical results, and I am willing to conclude that Deep Q-Learning and Double Deep Q-Learning are excellent methods for solving dynamic models - at least in this setting!

\begin{table}[ht]
    \centering
    \input{tables/beta_L_estimation_model1}
    \caption{Estimation of $\beta_L$}
    \label{tab:beta_L_Estimation}
\end{table}

Looking to figure \ref{fig:beta_L_estimation} it can be seen that the estimations follow the same trajectory. The plot shows the log(MSE) for $\beta_L$ values in the range $[0.2, 8]$. Starting with low $\beta_L$ having medium high MSE, falling slightly at around $\beta_L = 3$ reaching a minimum at about $\beta_L = 3.5$, and after that a sharp raise in MSE is observed.

\begin{figure}[ht]
\begin{subfigure}{.5\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{figures/dqi_model1_estimation_Beta_L.png}
  \caption{Value Function Iteration Estimation of $\beta_L$}
  \label{fig:dqi_estimation_beta_L}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
  \centering
  \includegraphics[width=1\linewidth]{figures/dqn_ddqn_model1_estimation_Beta_L.png}
  \caption{DQN and Double DQN estimation of $\beta_L$}
  \label{fig:dqn_ddqn_estimation_beta_L}
\end{subfigure}
    \caption{Estimation of $\beta_L$}
    \label{fig:beta_L_estimation}
\end{figure}

max_stars_repo_name: JakartaLaw/speciale

max_issues_repo_name: JakartaLaw/speciale

max_forks_repo_name: JakartaLaw/speciale


text:
\documentclass[11pt,twoside,openany,final]{octavo}

% page layout
\usepackage[paperwidth=5in,paperheight=8in,left=0.825in,right=0.475in,bottom=0.750in,top=0.750in]{geometry}

% fonts
%\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[lining]{ebgaramond}
\usepackage{microtype}

% quotes
\usepackage[autostyle=true,english=british]{csquotes}
\MakeOuterQuote{"}
\renewcommand{\mkbegdispquote}[2]{\small\flushleft}
\renewcommand{\mkenddispquote}[2]{\vspace{0.5\baselineskip}}

% graphics
\usepackage{graphicx}
\usepackage{caption}

% testsing
\usepackage{blindtext}

% header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\chaptermark}[1]{\markboth{\textsc{#1}}{\textsc{\bookTitle}}}

\fancyhead[CE]{\rightmark}
\fancyhead[CO]{\leftmark}
\fancyfoot[C]{\thepage}

\makeatletter
\renewcommand\subsection{%
	\@startsection{subsection}%
	{2}%
	{0em}%
	{-0.666\baselineskip \@minus -2\p@}%
	{0.333\baselineskip \@minus 2\p@}%
	{\normalfont\normalsize\sc}}
\renewcommand\subsubsection{%
	\@startsection{subsection}%
	{2}%
	{0em}%
	{-0.666\baselineskip \@minus -2\p@}%
	{0.333\baselineskip \@minus 2\p@}%
	{\normalfont\em}}
\makeatother

\usepackage{float}
\setlength{\textfloatsep}{0pt}
\setlength{\abovecaptionskip}{10pt}
\setlength{\belowcaptionskip}{5pt}

% inserting images fomr ../photos directory
\newcommand{\insertImageRoot}[2]{%
    \begin{figure}
	\begin{center}%
		\includegraphics[width=\textwidth]{../photos/#1/#2.jpg}\newline%
        \input{../photos/#1/#2.jpg-caption.tex}%
	\end{center}%
    \end{figure}
}

\newcommand{\insertImageRootP}[2]{%
    \begin{figure}
        \begin{center}%
            \includegraphics[width=0.95\textwidth]{../photos/#1/#2.jpg}\newline%
            \input{../photos/#1/#2.jpg-caption.tex}%
        \end{center}%
    \end{figure}
}

\newcommand{\insertImage}[1]{\insertImageRoot{\imgRoot}{#1}}
\newcommand{\insertImageP}[1]{\insertImageRootP{\imgRoot}{#1}}

\makeatletter

\newcommand\placeCoordinates{%
    \vspace{-12pt}
    \@startsection{subsubsection}%
    {2}%
    {0em}%
	{-10em}%
	{1em}%
    {\noindent \textsc{Coordinates:} \normalfont}}

%\AfterEndEnvironment{placeCoordinates}{\noindent\ignorespaces}

\newcommand\smallPlaceCoordinates{%
    \@startsection{subsubsection}%
    {2}%
    {0em}%
    {-10em}%
    {1em}%
    {\noindent \textsc{Coordinates:} \small}}
\makeatother

\newcommand{\transportMode}[1]{\vspace{6pt}\noindent\textsc{#1}}

% contents
\usepackage{titletoc}
\titlecontents{chapter}
[0.0cm]         % left margin
{\vspace{3pt}}  % above code
{%
{\thecontentslabel. }%
}              % numbered format
{\hspace{2em}} % unnumbered format
{\titlerule*[1pc]{}\contentspage}              % filler-page-format, e.g dots

\def\bookTitle{Title of this book}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{}
\author{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
%	\pagestyle{empty}
%	\includepdf[width=5in,height=8in]{cover.pdf}
%	\newpage

    \pagestyle{empty}
    \pagenumbering{roman}

%	\vspace{0.45\textheight}
	{\LARGE \bookTitle}\\

	\newpage

	\input{copyright}
	\include{titlepage}
    \newpage
	\tableofcontents
%
%
    \pagestyle{fancy}
    \input{preface}
    \input{about_author}
    \newpage

    \setcounter{page}{1}
    \pagestyle{fancy}
    \pagenumbering{arabic}
%
	\input{ch01_chapter1}

	\input{biblio}
	\input{biblio-refsection}

\end{document}


text:
\chapter{Conclusion}
\label{chap:conclusion}

\ldots

max_stars_repo_name: Kirillfedoseev/dod-gamedev

max_issues_repo_name: Kirillfedoseev/dod-gamedev

max_forks_repo_name: Kirillfedoseev/dod-gamedev


text:
% This file is part of the AbundanceSelfCal project
% Copyright 2020 the authors.

\documentclass[12pt, letterpaper]{article}

%% page layout
\addtolength{\topmargin}{-1.00in}
\addtolength{\textheight}{2.00in}

%% text macros
\newcommand{\project}[1]{\textsl{#1}}
\newcommand{\acronym}[1]{{\small{#1}}}
\newcommand{\apogee}{\project{\acronym{APOGEE}}}
\newcommand{\sdssiv}{\project{\acronym{SDSS-IV}}}
\newcommand{\dr}{\acronym{DR17}}

%% math macros
\newcommand{\teff}{{T_{\mathrm{eff}}}}
\newcommand{\logg}{\log g}

\begin{document}\sloppy\sloppypar\raggedbottom\frenchspacing

\section*{\raggedright
  Abundance maps of the Milky Way disk:
  Accounting for systematic and evolutionary effects on the red-giant branch
  }
\noindent
ACE, DWH, MKN, HWR

\paragraph{Abstract:}
There are conflicting claims in the literature about the element
abundances of stars in the Galactic bulge and bar, as compared to the
inner parts of the disk.
One source of confusion is that, because selection effects are usually
a function of angular stellar density, and because luminosities change
as stars ascend the red-giant branch, there are no large samples of stars
for which the same range of metallicities and evolutionary states is
visible at all Galactocentric radii.
Here we use stars from the upper red-giant branch---stars more
luminous than the red clump---as observed by \apogee, to look at the
element-abundance gradients in the Milky Way disk, in various
abundance ratios.
Although gradients are clearly measurable in the raw
\apogee\ measurements, we improve precision by simultaneously fitting
for dependences of the abundance measurements on red-giant evolutionary
phase.
This evolutionary-phase model accounts for both systematics in the
abundance measurements, and evolutionary effects in red-giant surface
abundances.
We find that elements XX and YY have measurements that are biased
systematically in the \apogee data.
Whether or not we correct for our evolutionary-phase model,
we find that all mean abundance gradients vary smoothly and
monotonically with Galactocentric radius from 0 to 20\,kpc.
We find no evidence for a distinct stellar population that formed the
bar or bulge; everything we find is consistent with secular (correct
words here?) creation of the Milky Way's bulge.

\end{document}

max_stars_repo_name: davidwhogg/AbundanceSelfCal

max_issues_repo_name: davidwhogg/AbundanceSelfCal

max_forks_repo_name: davidwhogg/AbundanceSelfCal