%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ML Presentation Paper
% Jeremy Lao/John Reynolds
% JJL359, JR4716
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[11pt]{article}

% AMS packages:
\usepackage[fleqn]{amsmath}
\usepackage{amsmath, amsthm, amsfonts}

% Document Formatting Packages:
\usepackage{hyperref}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\newcommand{\vertSpace}[1]{\vspace{3mm}}

%----------------------------------------------------------------
\title{Predicting FOMC Actions Using NLP; Assessing the Impact of Matrix Sparsity and Regularization}
\author{
        Jeremy Lao - jjl359 \\
        NYU Computer Science \\
            \and
        John Reynolds - jr4716 \\
        NYU Computer Science \\
}

\begin{document}
{\setlength{\mathindent}{0cm}
\maketitle

\abstract{\textit{The Federal Open Market Committee (FOMC) meets throughout the year to set the target Federal Funds rate.  The Federal Funds rate is one of the primary monetary policy tools, and it impacts the cost of borrowing money globally.  This paper explores ML and NLP methods, examines the impact of matrix sparsity from NLP methods and regularization from ML models, to predict the potential outcome of an upcoming FOMC using past FOMC statements and meeting minutes to train ML and NLP models.}}

\section{Introduction}
In this paper we use Natural Language Processing (NLP) and Machine Learning (ML) methods to predict Federal Open Market Committee (FOMC) rate actions (hold or change) using text from FOMC meeting minutes, Board of Governors speeches, and FOMC post-meeting statements.  \vertSpace

For this analysis we used 713 separate documents (roughly 1.6 Million Words) and 148 Fed Decisions for our data set.  We employ the NLP bag-of-words model for our analysis.  Bag-of-words models have high dimensionality, meaning the space is extremely sparse with a large amount of features leading to a sparse feature matrix.  We found in our analysis that some of the feature matrices contained over two billion elements with as little as $0.25\%$ of the elements containing a non-zero value.  \vertSpace

Due to these modeling challenges, the analysis and techniques we used address the issue of features being magnitudes larger than the label size ($p>>n$), and the extreme sparsity in the feature matrix.  In order to determine the appropriate model, n-gram size, and model parameters, we created a simulator to detect positive or negative sentiment from randomly generated text.  \vertSpace

Our model simulator found that as the number of sentiment words increased, the prediction accuracy approached close to 1.0 with high F1 scores.  For the study the analysis hones in on the mix of distributions containing hawkish or dovish (positive-action) words.

\subsection{git repository for project}
\url{https://www.github.com/jrrpanix/ML9}

\section{Objectives}
\begin{enumerate}
\item Given the proliferation of robust open-source ML and NLP packages, we were motivated to understand the characteristics of the feature matrix output (i.e., document-term matrix) from the text processing functions (i.e., CountVectorizer) analyzing the number of features, matrix sparsity, and matrix norm generated from utilizing package functions.
\item Assess the effectiveness of Multinomial Naive Bayes and Logistic Lasso applied to problems where the feature size is orders of magnitudes larger than the label size ($p>>n$).
\item Determine whether ML and NLP methods can be used to predict FOMC action (no change or a change in the base rate) using FOMC statements, minutes, and Board of Governors speeches.
\item Measure model performance on F1 scores because $70\%$ of the actions over the nineteen year period we are measuring are ``no action''.  F1 scores ensure that the accuracy of the model is not based purely on a naive ``no action'' guess, which in the best case would give a $70\%$ model accuracy.
\item Create scraping and cleaning tools to assemble a corpus of documents containing Speeches, Statements, Minutes and Actions from the Federal Reserve.
\end{enumerate}

\section{Methodology}

\subsection{Data}

The time frame of our study covered 2000 to 2018. We primarily utilized three sources for our data, FOMC statements, FOMC meeting minutes, and Board of Governors speeches. Details on data-sources, extraction and scrubbing are left to the appendix to focus this paper on analyzing our methods and results.  Preparing the data was a large amount of work and we are not aware of any data sets that combine the three types of documents and mapped the documents to an FOMC Action.

\subsection{Feature Modeling and Data Label Mapping}
\noindent Documents are mapped to the first FOMC rate decision on or before the document date at time $t_i$, where $j=\text{Statement}$ or $j=\text{Speech}$ or $j=\text{Minutes}$

\begin{equation*}
\mbox{Document}_{j,t_i} \rightarrow \mbox{Decision}_{t_i+k}
 = \begin{cases}
  1, & \text{if  Decision = change}, \\
  0, & \text{if  Decision = no change}
\end{cases}
\end{equation*}

\noindent
\textbf{Model 1: Unstacked}\\
\noindent
The \textbf{Unstacked} model maps each document to a feature vector generated by CountVector given an n-gram ($n_1$, $n_2$) where $n_1 <= n_2$ and $n_i$ are integers $>0$.  Given that our corpus consisted of approximately 713 documents, this will generate a feature matrix with 713 rows and $K$ columns where each column will be a unique instance of the word sequence generated by the n-gram.

$$E[D_{t_i}] = f(ngram(n_1, n_2)[\mbox{Document}_{j,t_i-k}])$$

\noindent
\textbf{Model 2: Stacked}\\
The \textbf{Stacked} model maps the set of documents which occur after the previous decision date but on or before the next decision date to one rate decision.  We effectively concatenated the documents between decisions into one large document.  The ``stacked'' model reduces the number of documents from 713 to 148, and we expect this method to reduce the dimensionality of the space.  This model maintains the same n-gram based feature vector where $n_1 <= n_2$ and $n_i$ are integers $>0$.

$$E[D_{t_i}] = f(ngram(n_1, n_2)[\mbox{Document}_{j_1,t_i-k_1},{Document}_{j_2,t_i-k_2},...]) \text{, } t_i-1 < t_i-k_i < t_i+1$$

\subsection{Matrix Sizes and Sparsity from CountVectorizer}

\noindent For this study we used term frequencies generated from \textbf{CountVectorizer} (\textbf{TfiDf} can also be used, but it did not alter the conclusions of this study).  When an n-gram is applied to a corpus of documents $D$, one can deduce from basic combinatorics that a large number of features will be generated from various mixtures of case studies.  \vertSpace

As we mentioned in our introduction, the classic problem with NLP bag-of-words models is that most of the column entries (n-grams) are zero, resulting in extremely sparse matrices.
Sparsity is defined as:

$$\mbox{sparsity} = \frac{\mbox{non-zero elements}}{\mbox{total elements}}$$

The table below gives a measure of sparsity  and the resulting number of elements in each n-gram generated matrix (units are in billions).  We empirically observed that the ``stacked'' model reduces the sparsity by a factor of four and the matrix size by a factor of five. The L1 matrix norm for all of the matrices ranged between 1200 to 1600.\\

\noindent
\begin{center}
\begin{tabular}{ |p{2cm}||p{2cm}|p{2cm}|p{2cm}|p{2cm}|  }
 \hline
 \multicolumn{5}{|c|}{CountVector Matrix Size} \\
 \hline
 \multicolumn{1}{|c|}{} &
 \multicolumn{2}{|c|}{Unstacked} &
 \multicolumn{2}{|c|}{Stacked}\\
 \hline
 N-gram & sparsity & size(billions) & sparsity & size(billions)\\
 \hline
       1:1& 0.03628801& 0.008561&  0.10635940&   0.001757 \\
       1:2& 0.00544312& 0.170058&  0.02081416&    0.036107\\
       1:3& 0.00368457& 0.439898&  0.01508941&     0.092869\\
       3:5& 0.00238128& 0.900721&  0.01059293&     0.173040\\
       4:7& 0.00224699& 1.332560&  0.00996789&     0.271117\\
      5:10& 0.00218455& 1.995502&  0.00972276&     0.402041\\
      8:10& 0.00213633& 1.019811&  0.00955894&     0.198627\\
     10:15& 0.00210643& 2.097187&  0.00945586&     0.398312\\
     20:20& 0.00205055& 0.347043&  0.00931157&     0.074799\\
 \hline
\end{tabular}
\end{center}

\subsection{Apply ML to Sparse Matrices generated from CountVectorizer}
\noindent
Based upon research into classification models for sparse data, we chose to test Naive Bayes and Logistic Regression with L1 regularization.  \vertSpace

\begin{itemize}
\item Naive Bayes
\begin{equation*}
P(A|x_1,x_2,...,x_n) = p(A)\prod_{i=1}^n p(x_i|A)
\end{equation*}

\item Logistic Lasso
\begin{equation*}
A = \prod_{i=1}^n p(x_i)^{y_i}(1-p(x_i))^{1-y_i}+ L1
\end{equation*}
\end{itemize}

For the ``Unstacked'' document case, our research into classification model performance on sparse data found that Naive Bayes classification models performed particularly well when encountering cases of missing data.  Naive Bayes takes advantage of the assumption that the attributes are independent and ignores missing attributes when calculating the probability.  Therefore, Naive Bayes is generally considered a fairly decent performer with greater sparsity.  \vertSpace

Based on the table above called ``Count Vector Size'', we decided to test Logistic Lasso as we found in our research that Logistic Lasso can handle sparsity through identifying a set of relevant variables out of the large collection of candidates making it suitable for discovering interactions in regression problems (HW1 problem 2). \vertSpace

\subsubsection{Training, Testing, and Determining the Efficacy of the Models}
For this study we randomly sample 75$\%$ of the corpus for training and then
predict Fed action using the remaining 25$\%$ of the data and calculate
\begin{itemize}
\item Accuracy
\item Precision
\item Recall
\item F1 Score
\end{itemize}
Approximately 70$\%$ of the time there is no Action so a model that does nothing will
have an accuracy of 70$\%$, but a recall of 0.  The results are summarized using F1
score.

\subsubsection{The impact of regularization coefficient $\alpha$ on logistic regression}
\noindent
For \textbf{Logistic Lasso} we are interested in examining the impact of the regularization parameter $\alpha$ on
the fraction of  non-zero coefficients remaining after regularization is applied and on the impact of the predictive
score on test data. The results show the regularization parameter at the extremes produces the worst results
and the stacked model has a higher fraction of coefficients eliminated from logistic lasso. The expected result
is the larger regularization parameter reduces the fraction of non-zero coefficients.\\

\noindent \begin{tabular}{ |p{2cm}||p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|  }
 \hline
 \multicolumn{6}{|c|}{Comparison of Logistic Lasso varying regularization coefficient $\alpha$} \\
 \hline
 \multicolumn{1}{|c|}{} &
 \multicolumn{1}{|c|}{} &
 \multicolumn{2}{|c|}{Unstacked} &
 \multicolumn{2}{|c|}{Stacked}\\
 \hline
 N-gram & $\alpha$ & F1 & frac remain & F1 & frac remain\\
 \hline

10:15 &  3.333 & 0.454 & 0.000040 & 0.720 & 0.000016 \\
10:15 &  2.000 & 0.575 & 0.000066 & 0.897 & 0.000029 \\
10:15 &  1.000 & 0.647 & 0.000148 & 0.893 & 0.000055 \\
10:15 &  0.500 & 0.679 & 0.000291 & 0.913 & 0.000094 \\
10:15 &  0.200 & 0.708 & 0.000339 & 0.913 & 0.000134 \\
10:15 &  0.100 & 0.710 & 0.000463 & 0.923 & 0.000161 \\
10:15 &  0.050 & 0.711 & 0.000619 & 0.925 & 0.000206 \\
10:15 &  0.020 & 0.715 & 0.000764 & 0.923 & 0.000243 \\
10:15 &  0.010 & 0.713 & 0.001045 & 0.913 & 0.000315 \\
10:15 &  0.002 & 0.730 & 0.001659 & 0.906 & 0.000517 \\
10:15 &  0.000 & 0.669 & 0.978049 & 0.669 & 1.000000 \\
 \hline
\end{tabular}

\subsubsection{A comparison of Multinomial Naive Bayes to Logistic Regression with Extremely Sparse Feature Matrices}
\noindent
Under extreme levels of sparseness (sparseness measure of less than $0.0021$) from feature matrices generated by CountVectorizer, Logistic Regression and Logistic Lasso break down with greater sparseness while Multinomial Naive Bayes can still produce usable results. \vertSpace

However, we found with less matrix sparsity and a lower Logistic Lasso model penalty (i.e., $\alpha=0.002$), the Logistic Lasso model performance improves.  Based on F1 scores we observed that Logistic Lasso with low penalties performs as well or better than Naive Bayes when sparseness exceeded $0.0025$.  \vertSpace

Logistic Lasso with a larger penalty (i.e., $>2.0$) does not perform well with extremely sparse matrices. \\
\begin{center}
\noindent \begin{tabular}{ |p{2cm}||p{2cm}|p{2cm}|p{2cm}|p{2cm}|  }
 \hline

 \multicolumn{5}{|c|}{Deterioration of Logistic Lasso with sparse matrices relative to Naive Bayes} \\
 \hline
 \multicolumn{1}{|c|}{} &
 \multicolumn{1}{|c|}{} &
 \multicolumn{3}{|c|}{F1 Score} \\

 \hline
 \multicolumn{1}{|c|}{} &
 \multicolumn{1}{|c|}{} &
 \multicolumn{1}{|c|}{Naive Bayes} &
 \multicolumn{2}{|c|}{Logistic Lasso} \\

 \hline
 \multicolumn{1}{|c|}{N-gram} &
 \multicolumn{1}{|c|}{sparsity} &
 \multicolumn{1}{|c|}{smooth$=0.0$} &
 \multicolumn{1}{|c|}{$\alpha=0.002$} &
 \multicolumn{1}{|c|}{$\alpha=1.000$} \\
 \hline
 60& 0.001979 & 0.647 & 0.463 & 0.256\\
 50& 0.002018 & 0.619 & 0.565 & 0.342\\
 30& 0.002038 & 0.724 & 0.620 & 0.460\\
 25& 0.002063 & 0.720 & 0.664 & 0.490\\
 20& 0.002067 & 0.725 & 0.678 & 0.520\\
 12& 0.002069 & 0.682 & 0.743 & 0.656\\
 \hline
\end{tabular}
\end{center}
\vertSpace
\noindent Below is a plot showing Naive Bayes giving consistent results relative
to Logistic Lasso .

\begin{figure}[h!]
  \centering
  \includegraphics[width=100mm]{./ngramlen_nb_ll.pdf}
  \caption{F1 performance of LL and NB - Unstacked Model}
\end{figure}

\subsubsection{Impact of N-gram sequences on results}
We varied the N-gram sequences to observe its impact on our model predictions.  Based on our empirical observations there is a definite range of N-gram sequences where all of the models greatly improve (based on F1 scores).  All of the models showed great improvement when the N-gram sequences ranged between 4:6 and 10:15.  As the sequences (N-grams) approached 20 words and larger, the results (model performance) started to deteriorate as the feature matrices became more sparse.  Below is a graph of Logistic Lasso and Naive Bayes plotted with different regularization coefficients and varying N-gram sequence.  \vertSpace

The interesting part about our findings is that Federal Reserve commentary tends to have sequences of hawkish or dovish sentiment (FOMC action) which can't be expressed in a few words.  This expression of hawkishness or dovishness in larger N-grams may be the reason why smaller B-gram sequences did not perform as well.
\begin{figure}[h!]
  \centering
  \includegraphics[width=100mm]{./ngram_seq.pdf}
  \caption{N-gram sequence LL and NB - Stacked Model}
\end{figure}
\vfill

\vertSpace

\section{Conclusion}
Reducing the sparsity of the matrices generated from CountVectorizer by stacking the documents greatly improved the results.  \vertSpace

We were able to attain maximum test accuracy of $95.9\%$ using a $10:15$ n-gram, producing a recall of $93.4\%$ and an F1 score of $92.5\%$.  Because of the large number (i.e., millions) of features in the feature matrix, Logistic Lasso with small penalty proved to be the most effective method for reducing the number of coefficients, leading to improved F1 scores.  \vertSpace

The fraction of non-zero coefficients remaining after applying Logistic Lasso ranged between $3e-05$ to $1.6e-03$.  Logistic Lasso was very effective in dealing with feature matrix sparsity, and based on what we learned from HW1 question two is the appropriate model choice for our classification problem.  In order to illustrate the effectiveness, we measured the fraction of non-zero coefficients using a Logistic Regression model and the feature matrix had $\approx 97\%$ non-zero coefficients.  \vertSpace

Logistic Lasso (and Logistic Regression generally) broke down at the most extreme levels of sparsity $<0.0020$.  In general, we found that setting the regularization parameters at the extremes ($\alpha=0.0$ or $\alpha > 2.0$) produced inferior results.  \vertSpace

We found that n-gram sequences of varying between 4:7 to 10:15 provided the best results. Smaller n-gram sequences ($< 4$ words) and larger sequences ($>20$ do to extreme sparsity) did not generate good results.  \vertSpace

Whereas Multinomial Naive Bayes with Laplace smoothing $=0$ was the most stable method for producing useful results at the most extreme measures of matrix sparcity.  In general we found that when using Multinomial Naive Bayes setting the parameters at no smoothing or large smoothing proved to give the best results. \vertSpace

Overall our research found that Logistic Lasso with smaller penalty $\alpha < 0.02$ produced the most stable results for predicting FOMC rate decisions from FOMC statements, minutes, and Board of Governors speeches.\vertSpace

The limitation in this study is the size of the data sets. While we were able to identify characteristics that would help predictive power the strength of the conclusions are tempered by the amount of data on hand.

\appendix
\section{Appendix}

\subsection{What is the FOMC}

The FOMC sets the Federal Funds target range (target rate prior to 2009).  The permanent members are the Board of Governors of the Federal Reserve System, President of the Federal Reserve Bank of New York, and the rest of the seats are rotated through the Presidents of the other Federal Reserve Banks.  There are twelve Reserve Banks and the Board of Governors oversees the activity, operations, and policies of the Federal Reserve System.

\subsection{Why Does the Federal Funds Target Range Matter?}

The Federal Funds Target Range is set by the FOMC.  The Federal Funds Target Range is the range where the Federal Funds Effective rate (calculated as the volume weighted median of eligible transactions reported on FR 2420) is expected to fix on a daily basis.  The Federal Funds rate is the primary monetary policy instrument of the Federal Reserve System, and it influences the level of interest rates domestically and globally.  For example, if the Federal Funds effective rate were 5 percent, then the interest rate on a 30 year mortgage would be 5 percent or greater.

\subsection{Data}

\subsubsection{Data Sources}
The time frame of our study covered 2000 to 2018.
The primary source of our textual data were FOMC statements, FOMC meeting minutes, and Board of Governors speeches from \url{https://www.federalreserve.gov}.
The data for the Federal Funds target rate and target range (post 2009) is from FRED St. Louis.
FRED offers a wealth of economic data and information to promote economic education and enhance economic research.
FRED is updated regularly and allows 24/7 access to regional and national financial and economic data.

\subsubsection{Scraping and Text Pre-Processing}

We collected data from the Federal Reserve website and pre-processed the data for the document-term matrix. \vertSpace

We utilized Python packages \textit{beautifulsoup4}, \textit{re}, and \textit{urllib} to scrape contextual data from the Federal Reserve website.  Our scraping algorithm used regular expressions to handle and remove extraneous \textit{html} and \textit{javascript} text collected by the page scraper.  We had to handle non UTF-8 characters upfront and remove them at this stage altogether.  We collected over six hundred documents from the Federal Reserve website. \vertSpace

After scraping the data, we pre-processed the text by removing all punctuation, ensuring proper spacing between words, setting all words to lower case, and making all numbers \textit{d} to reduce the dimensionality document-term matrix.  We also used Regex to detect direct references to the Federal Funds target rate/range and transformed those references (a mixture of numbers, punctuation, and the word 'percent') to \textit{ddpercentrate}.  Since we were modeling the sentiment of FOMC rate action, this was one of our strategies to directly capture the target rate in the document-term matrix. \vertSpace

This formed the bulk of our text pre-processing and it allowed us to essentially utilize the stored text in the document-term matrix for NLP and ML models.

\subsubsection{Meta-Data}
\noindent Below is a table of the FOMC document metadata:

\vertSpace

\noindent \begin{tabular}{ |p{2cm}||p{2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|  }
 \hline
 \multicolumn{6}{|c|}{FOMC Documents} \\
 \hline
 Document Type& Years & Number Documents & Total Words & Avg Words Per Document & StDev\\
 \hline
 Minutes   & 2000-2018    & 149 & 738,656 & 4,957 & 1,284\\
 Statements &   2000-2018  & 160   & 62,350 & 389 & 185\\
 Speeches & 2011-2018 & 403 & 915,359 & 2,271 & 1,539\\
 \hline
\end{tabular}

\vertSpace

Statements are post-meeting communiqu\'e and are generally short, but contains a summary of the committee's reasoning for the decision.  Minutes are longer and contain the Staff and Committee member current economic assessments and outlooks.  The speeches in the corpus are from the Board of Governors and may contain clues of their thoughts on their current economic outlook.  \vertSpace

\subsection{Latent Dirichlet Allocation}

We explored latent topic modeling in our research to determine how a machine learning algorithm would classify $k=3$ topics, a proxy for the Federal Reserve's three objectives. \vertSpace

Given the Federal Reserve's mandates of stable prices, maximum employment, and financial stability, we explored Latent Dirichlet Distribution of the speeches and minutes' word distribution over three latent topics.  We were interested in exploring how well a topic model would distribute words over the three objectives and if the meaning of the distributions were relatively clear.

\begin{figure}[h!]
  \includegraphics[width=\linewidth]{../output/data_for_graphs/Topic-Model-3-topics.PNG}
  \caption{Top 15 Words Distributed Over Three Latent Topics}
  \label{fig:LDA}
\end{figure}

We found that the topic model generally distributed the speeches and minutes into the three categories fairly well.  It was interesting that "Topic 1" referred solely to financial stability, "Topic 0" primarily referred to inflation and spending, and "Topic 2" returned a word distribution that included labor, growth, and lower for longer monetary policy. \vertSpace

% Bibliography
%-----------------------------------------------------------------
\begin{thebibliography}{99}

\bibitem{Cd94} Hansen,Stephen, McMachon, Michael  \emph{Transparency and Deliberation with the FOMC:a Computational Linguistics Approach}, CEPR Discussion Paper, (2014)

\bibitem{stanford} Puri, Indira \emph{Using Machine Learning to Predict Interest Rate Changes from Federal Reserve Proceedings}

\bibitem{nyu} Ranganath, Rajesh  \emph{NYU - CSCI-GA.2565 ML Lecture Slides Spring 2019}

\bibitem{NaiveBayes} Li, Xiang et al. \emph{The Convergence Behavior of Naive Bayes on Large Sparse Datasets}, ACM Vol 11 Issue 1, August 2016

\bibitem{LL} Zou, Yuan and Roos, Teemu \emph{Sparse Logistic Regression with Logical Features}, Helsinki Institute for Information Technology (HIIT), Springer International, 2016
\end{thebibliography}
\end{document}


\section{Introduction and Description of the Work}

\subsection{Motivation}

Physics simulation is one of the key components of a modern game engine. The more accurate the simulation is, the more immersive any games built with the engine are likely to be. If the world around the player does not react as expected then it is difficult to become immersed in the game environment.

\subsection{Problem}

Most game engines simulate the world using a mesh and rigid body representation. This limits how accurate physical reactions, such as collisions, can be regarding object damage. If two rigid bodies collide then their vector components can be resolved based on their speeds and angles of incidence amongst other properties. However computing the damage to their bodies is less trivial, the meshes can be dented and predetermined joints broken but this leads to objects appearing to lose mass. Damage can look predetermined and independent of the actual collision. As meshes are hollow representations of objects, any calculations involving mass are difficult.

\subsection{Solution}

Representing objects volumetrically allows for more accurate object destruction. Any fragments which would be severed from an object should consist of a portion of that object's mass. If the object is represented as voxels then this can be simulated by breaking voxels from the parent object. Computing the physical properties of the fragments dynamically can then be done based on the number and orientation of voxels they contain\cite{AfD}.

Permanently representing every object volumetrically would become inefficient in scenes with many objects. Instead objects will be represented with meshes and converted to volumes in real-time on collision\cite{RTC}

For example, if a bullet is fired at a brick wall, both the bullet and wall will be rigid meshes when the bullet is shot. On collision, both the wall and bullet will be voxelised. Assuming the bullet consists of only one voxel, no destruction calculations will be performed on it. Using the force of impact and physical parameters of the wall, it will be calculated which voxels should break off. These voxels will then be transformed back into rigid meshes and the correct movement vectors will be applied. The wall's mesh will be reformed based on the new volumetric structure. This is illustrated in figure \ref{fig}.

\begin{figure}

\label{fig}
\centerline{\includegraphics[scale=0.5]{diagram.pdf}}
\caption{A simple rigid mesh projectile is fired towards another rigid mesh (a). On collision a portion of each body is voxelised (b) depending on the force of the projectile and physical parameters of the objects. It is determined which voxels will detach, shown in red. Meshes are reformed around all separate bodies and physical forces are applied (c).}
\end{figure}

\begin{comment}

Current trends in digital gaming are towards sandbox titles, where the player is encouraged to shape and manipulate the world, often by placing and breaking blocks\footnote{See \href{https://minecraft.net/}{Minecraft} by \href{http://mojang.com/}{Mojang}}. This is achieved by storing the state of the world as a three dimensional array of block identifiers, usually batched into `chunks' which are loaded and unloaded as the player approaches them. While this approach has been optimised for memory and CPU load, it presents several limitations with regards to player experience. Players are confined to placing and breaking blocks in a grid due to the underlying data structure and so are unable to create landscapes without object placement looking unnatural and formulaic. Furthermore, the data structure only allows location and type to be stored for each block, with location being derived from the block position within the array. This means that blocks cannot interact physically with the world and thus the world is very static.

Solving these issues will be the goal of my project. My proposed solution is to create a hybrid between traditional polygonal mesh and sandbox engines. Game objects will exist primarily as mesh objects, however mesh to volumetric conversions will occur at appropriate physical cues. The updated meshes will then be reformed after the interaction has taken place. By treating objects as volumetric when interacted with (via physics or the player), the creative freedom of sandbox engines will be maintained, with all objects having the capacity to be reshaped. Objects existing as polygonal meshes for the remainder of the time will allow for both non discrete object placement\footnote{That is, objects do not have to remain snapped to the underlying array} and physically based movement.

One main project focus will be physically based object deformation. As objects will be volumetric on collision, I will use this to simulate accurate reactions. Treating each voxel making up the object's volume as a unit of mass and forming rigid bonds between these units, I will propagate collision information through the bonds from the point of collision and calculate which should break or be otherwise changed. This will allow objects to be warped or broken apart depending on parameters such as the object's strength, brittleness or malleability as well as the force and position of impact. All of this will be calculated internally before any required game objects are created.

For example, if a bullet hits a brick wall then you would expect units of mass to break off and fall to the ground as rubble. At the moment of impact, the wall will not disappear from the game world to be replaced by $x\times y\times z$ unit cubes bonded together, some of which breaking off before the updated wall reappears. Rather, the wall will compute its internal structure of voxels, work out which bonds should break, form new objects from the severed mass, apply vector quantities such as velocity to these and then update its own mesh using the remaining mass. This approach is taken because game objects are expensive and therefore to be optimal we should be lazy with their creation.

Furthermore, computation of voxel structure should be both patch based and limited to impacts above a threshold. This is because not all impacts will result in deformation of the whole object, or any at all.\footnote{As dictated by the object in question's physical parameters} A block of wood dropped to the floor from a height of 1 inch will undergo no deformation. A steel block dropped into a field from a height of 6 feet would not require voxelization of the entire field, only a radius around the point of landing.
\end{comment}


    \filetitle{lhsmrhs}{Evaluate the discrepancy between the LHS and RHS for each model equation and given data}{model/lhsmrhs}

	\paragraph{Syntax for casual
evaluation}\label{syntax-for-casual-evaluation}

\begin{verbatim}
Q = lhsmrhs(M,D,Range)
\end{verbatim}

\paragraph{Syntax for fast evaluation}\label{syntax-for-fast-evaluation}

\begin{verbatim}
Q = lhsmrhs(M,YXE)
\end{verbatim}

\paragraph{Input arguments}\label{input-arguments}

\texttt{M} {[} model {]} - Model object whose equations and currently
assigned parameters will be evaluated.

\texttt{YXE} {[} numeric {]} - Numeric array created from an input
database by calling the function
\href{model/data4lhsmrhs}{\texttt{data4lhsmrhs}}; \texttt{YXE} contains
the observations on the measurement variables, transition variables, and
shocks organised row-wise.

\begin{itemize}
\item
  \texttt{D} {[} struct {]} - Input database with observations on
  measurement variables, transition variables, and shocks on which the
  discrepancies will be evaluated.
\item
  \texttt{Range} {[} numeric {]} - Date range on which the discrepancies
  will be evaluated.
\end{itemize}

\paragraph{Output arguments}\label{output-arguments}

\texttt{Q} {[} numeric {]} - Numeric array with discrepancies between
the LHS and RHS for each model equation.

\paragraph{Description}\label{description}

The function \texttt{lhsmrhs} evaluates the discrepancy between the LHS
and the RHS in each model equation; each lead is replaced with the
actual observation supplied in the input data. The function
\texttt{lhsmrhs} does not work for models with
\href{modellang/sstateref}{references to steady state values}.

The first syntax, with the array \texttt{YXE} pre-built in a call to
\href{model/data4lhsmrhs}{\texttt{data4lhsmrhs}} is computationally much
more efficient if you need to evaluate the LHS-RHS discrepancies
repeatedly for different parameterisations.

The output argument \texttt{D} is an \texttt{nEqtn} by \texttt{nPer} by
\texttt{nAlt} array, where \texttt{nEqnt} is the number of measurement
and transition equations, \texttt{nPer} is the number of periods used to
create \texttt{X} in a prior call to
\href{model/data4lhsmrhs}{\texttt{data4lhsmrhs}}, and \texttt{nAlt} is
the greater of the number of alternative parameterisations in
\texttt{M}, and the number of alternative datasets in the input data.

\paragraph{Example}\label{example}

\begin{verbatim}
YXE = data4lhsmrhs(M,d,range);
Q = lhsmrhs(M,YXE);
\end{verbatim}


\section{Task II.1: Pipelining}

Assuming a 5-stage pipeline design as described in \cite{l3InOrder} and given
the program in Figure \ref{fig:t21code} 5 questions (a-e) need to be answered.

\begin{figure}[H]
    \begin{lstlisting}[language={[x86masm]Assembler}]
    SEARCH:     LW R5, 0(R3)        ;I1 Load item
                SUB R6, R5, R2      ;I2 compare with key
                BNEZ R6, NOMATCH    ;I3 check for match
                ADDI R1, R1, #1     ;I4 count matches
    NOMATCH:    ADDI R3, R3, #4     ;I5 next item
                BNE R4, R3, SEARCH  ;I6 continue until all items
    \end{lstlisting}
    \caption{Code given in the assignment text.}
    \label{fig:t21code}
\end{figure}

\subsection{a) Inserting NOOPS}

\begin{figure}[H]
    \begin{lstlisting}[language={[x86masm]Assembler}]
    SEARCH:     LW R5, 0(R3)        ;I1 Load item
                NOP
                NOP
                NOP
                SUB R6, R5, R2      ;I2 compare with key
                NOP
                NOP
                NOP
                BNEZ R6, NOMATCH    ;I3 check for match
                ADDI R1, R1, #1     ;I4 count matches
    NOMATCH:    ADDI R3, R3, #4     ;I5 next item
                NOP
                NOP
                NOP
                BNE R4, R3, SEARCH  ;I6 continue until all items
    \end{lstlisting}
    \caption{Code after insertion of \texttt{NOOP}s.}
    \label{fig:t21a}
\end{figure}

\subsection{b) Execution time (clocks) with stalling}
\begin{itemize}
    \item[Hit: ] Table \ref{tab:t21bhit} shows  the execution of the code, the
    last execution step finishes at clock 14.

    \item[No Hit: ] Table \ref{tab:t21bmiss} shows  the execution of the code, the
    last execution step finishes at clock 17.
\end{itemize}

\begin{landscape}
    \begin{table}[]
    \centering
    \begin{tabular}{llllllllllllllll}
    \hline
             &                                         & c1 & c2 & c3 & c4 & c5 & c6 & c7 & c8 & c9 & c10 & c11 & c12 & c13 & c14 \\ \hline
    SEARCH:  & \multicolumn{1}{l|}{LW R5, 0(R3)}       & IF & ID & EX & ME & WB &    &    &    &    &     &     &     &     &     \\
             & \multicolumn{1}{l|}{SUB R6, R5, R2}     &    & IF & ID & ID & ID & EX & ME & WB &    &     &     &     &     &     \\
             & \multicolumn{1}{l|}{BNEZ R6, NOMATCH}   &    &    & IF & IF & IF & ID & ID & ID & EX &     &     &     &     &     \\
             & \multicolumn{1}{l|}{ADDI R1, R1, \#1}   &    &    &    &    &    & IF & IF & IF & ID & EX  & ME  & WB  &     &     \\
    NOMATCH: & \multicolumn{1}{l|}{ADDI R3, R3, \#4}   &    &    &    &    &    &    &    &    & IF & ID  & EX  & ME  & WB  &     \\
             & \multicolumn{1}{l|}{BNE R4, R3, SEARCH} &    &    &    &    &    &    &    &    &    & IF  & ID  & ID  & ID  & EX  \\ \hline
    \end{tabular}
    \caption{Execution table showing where in the pipeline different instructions are for different clocks if there is a hit in the search loop.}
    \label{tab:t21bhit}
    \end{table}

    \begin{table}[]
    \centering
    \begin{tabular}{lllllllllllllllllll}
    \hline
             &                                         & c1 & c2 & c3 & c4 & c5 & c6 & c7 & c8 & c9                      & c10 & c11 & c12 & c13 & c14 & c15 & c16 & c17 \\ \hline
    SEARCH:  & \multicolumn{1}{l|}{LW R5, 0(R3)}       & IF & ID & EX & ME & WB &    &    &    &                         &     &     &     &     &     &     &     &    \\
             & \multicolumn{1}{l|}{SUB R6, R5, R2}     &    & IF & ID & ID & ID & EX & ME & WB &                         &     &     &     &     &     &     &     &     \\
             & \multicolumn{1}{l|}{BNEZ R6, NOMATCH}   &    &    & IF & IF & IF & ID & ID & ID & \multicolumn{1}{l|}{EX} &     &     &     &     &     &     &     &     \\
             & \multicolumn{1}{l|}{ADDI R1, R1, \#1}   &    &    &    &    &    &    &    & IF & \multicolumn{1}{l|}{ID} &     &     &     &     &     &     &     &     \\
    NOMATCH: & \multicolumn{1}{l|}{ADDI R3, R3, \#4}   &    &    &    &    &    &    &    &    & \multicolumn{1}{l|}{IF} & IF  & ID  & EX  & ME  & WB  &     &     &     \\
             & \multicolumn{1}{l|}{BNE R4, R3, SEARCH} &    &    &    &    &    &    &    &    &                         &     & IF  & ID  & ID  & ID  & EX  & ME  & WB  \\ \hline
    \end{tabular}
    \caption{Execution table showing where in the pipeline different instructions are for different clocks if there is no hit in the search loop. The vertical line in the middle of the table indicates that \texttt{IF} and \texttt{ID} was flushed.}
    \label{tab:t21bmiss}
    \end{table}
\end{landscape}

\subsection{c) Execution time (clocks) with stalling and register forwarding}
\begin{itemize}
    \item[Hit: ] Table \ref{tab:t21chit} shows  the execution of the code, the
    last execution step finishes at clock 11.

    \item[No Hit: ] Table \ref{tab:t21cmiss} shows  the execution of the code, the
    last execution step finishes at clock 12.
\end{itemize}

\begin{landscape}

    \begin{table}[]
    \centering
    \begin{tabular}{llllllllllllllll}
    \hline
             &                                         & c1 & c2 & c3 & c4 & c5 & c6 & c7 & c8 & c9 & c10 & c11 \\ \hline
    SEARCH:  & \multicolumn{1}{l|}{LW R5, 0(R3)}       & IF & ID & EX & ME & WB &    &    &    &    &     &     \\
             & \multicolumn{1}{l|}{SUB R6, R5, R2}     &    & IF & ID & ID & ID & EX & ME & WB &    &     &     \\
             & \multicolumn{1}{l|}{BNEZ R6, NOMATCH}   &    &    & IF & IF & IF & ID & EX &    &    &     &     \\
             & \multicolumn{1}{l|}{ADDI R1, R1, \#1}   &    &    &    &    &    & IF & ID & EX & ME & WB  &     \\
    NOMATCH: & \multicolumn{1}{l|}{ADDI R3, R3, \#4}   &    &    &    &    &    &    & IF & ID & EX & ME  & WB  \\
             & \multicolumn{1}{l|}{BNE R4, R3, SEARCH} &    &    &    &    &    &    &    & IF & ID & EX  &     \\ \hline
    \end{tabular}
    \caption{Execution table when using stalling and register forwarding. This is the result of the loop does hit a match}
    \label{tab:t21chit}
    \end{table}

    \begin{table}[]
    \centering
    \begin{tabular}{llllllllllllllll}
    \hline
             &                                         & c1 & c2 & c3 & c4 & c5 & c6 & c7                      & c8 & c9 & c10 & c11 & c12 \\ \hline
    SEARCH:  & \multicolumn{1}{l|}{LW R5, 0(R3)}       & IF & ID & EX & ME & WB &    &                         &    &    &     &     &     \\
             & \multicolumn{1}{l|}{SUB R6, R5, R2}     &    & IF & ID & ID & ID & EX & ME                      & WB &    &     &     &     \\
             & \multicolumn{1}{l|}{BNEZ R6, NOMATCH}   &    &    & IF & IF & IF & ID & EX                      &    &    &     &     &     \\
             & \multicolumn{1}{l|}{ADDI R1, R1, \#1}   &    &    &    &    &    & IF & \multicolumn{1}{l|}{ID} &    &    &     &     &     \\
    NOMATCH: & \multicolumn{1}{l|}{ADDI R3, R3, \#4}   &    &    &    &    &    &    & \multicolumn{1}{l|}{IF} & IF & ID & EX  & ME  & WB  \\
             & \multicolumn{1}{l|}{BNE R4, R3, SEARCH} &    &    &    &    &    &    &                         &    & IF & ID  & EX  &     \\ \hline
    \end{tabular}
    \caption{Execution table when using stalling and register forwarding. This is the result of the loop does not hit a match. The vertical line in the middle of the table indicates that \texttt{IF} and \texttt{ID} was flushed.}
    \label{tab:t21cmiss}
    \end{table}

\end{landscape}

\subsection{d) Execution time (clocks) with stalling and full forwarding}
\begin{itemize}
    \item[Hit: ] Table \ref{tab:t21dhit} shows  the execution of the code, the
    last execution step finishes at clock 9.

    \item[No Hit: ] Table \ref{tab:t21dmiss} shows  the execution of the code, the
    last execution step finishes at clock 10.
\end{itemize}

\begin{landscape}
    \begin{table}[]
    \centering
    \begin{tabular}{lllllllllll}
    \hline
             &                                         & c1 & c2 & c3 & c4 & c5 & c6 & c7 & c8 & c9 \\ \hline
    SEARCH:  & \multicolumn{1}{l|}{LW R5, 0(R3)}       & IF & ID & EX & ME & WB &    &    &    &    \\
             & \multicolumn{1}{l|}{SUB R6, R5, R2}     &    & IF & ID & EX & ME & WB &    &    &    \\
             & \multicolumn{1}{l|}{BNEZ R6, NOMATCH}   &    &    & IF & ID & EX &    &    &    &    \\
             & \multicolumn{1}{l|}{ADDI R1, R1, \#1}   &    &    &    & IF & ID & EX & ME & WB &    \\
    NOMATCH: & \multicolumn{1}{l|}{ADDI R3, R3, \#4}   &    &    &    &    & IF & ID & EX & ME & WB \\
             & \multicolumn{1}{l|}{BNE R4, R3, SEARCH} &    &    &    &    &    & IF & ID & EX &    \\ \hline
    \end{tabular}
    \caption{Execution table when using stalling and full forwarding. This is the result of the loop does hit a match.}
    \label{tab:t21dhit}
    \end{table}

    \begin{table}[]
    \centering
    \begin{tabular}{llllllllllllllll}
    \hline
             &                                         & c1 & c2 & c3 & c4 & c5                      & c6 & c7 & c8 & c9 & c10 \\ \hline
    SEARCH:  & \multicolumn{1}{l|}{LW R5, 0(R3)}       & IF & ID & EX & ME & WB                      &    &    &    &    &     \\
             & \multicolumn{1}{l|}{SUB R6, R5, R2}     &    & IF & ID & EX & ME                      & WB &    &    &    &     \\
             & \multicolumn{1}{l|}{BNEZ R6, NOMATCH}   &    &    & IF & ID & EX                      &    &    &    &    &     \\
             & \multicolumn{1}{l|}{ADDI R1, R1, \#1}   &    &    &    & IF & \multicolumn{1}{l|}{ID} &    &    &    &    &     \\
    NOMATCH: & \multicolumn{1}{l|}{ADDI R3, R3, \#4}   &    &    &    &    & \multicolumn{1}{l|}{IF} & IF & ID & EX & ME & WB  \\
             & \multicolumn{1}{l|}{BNE R4, R3, SEARCH} &    &    &    &    &                         &    & IF & ID & EX &     \\ \hline
    \end{tabular}
    \caption{Execution table when using stalling and full forwarding. This is the result of the loop does not hit a match. The vertical line in the middle of the table indicates that \texttt{IF} and \texttt{ID} was flushed.}
    \label{tab:t21dmiss}
    \end{table}
\end{landscape}

%\subsection{e) Loop unrolling}
%\todo[inline]{Will loop unrolling help?}


    \filetitle{vma}{Vector moving average representation of the model}{model/vma}

	\paragraph{Syntax}\label{syntax}

\begin{verbatim}
[Phi,List] = vma(M,P,...)
\end{verbatim}

\paragraph{Input arguments}\label{input-arguments}

\begin{itemize}
\item
  \texttt{M} {[} model {]} - Model object for which the VMA
  representation will be computed.
\item
  \texttt{P} {[} numeric {]} - Order up to which the VMA will be
  evaluated.
\end{itemize}

\paragraph{Output arguments}\label{output-arguments}

\begin{itemize}
\item
  \texttt{Phi} {[} namedmat \textbar{} numeric {]} - VMA matrices.
\item
  \texttt{List} {[} cell {]} - List of measurement and transition
  variables in the rows of the \texttt{Phi} matrix, and list of shocks
  in the columns of the \texttt{Phi} matrix.
\end{itemize}

\paragraph{Option}\label{option}

\begin{itemize}
\item
  \texttt{'matrixFmt='} {[} \emph{\texttt{'namedmat'}} \textbar{}
  \texttt{'plain'} {]} - Return matrix \texttt{Phi} as either a
  \href{namedmat/Contents}{\texttt{namedmat}} object (i.e.~matrix with
  named rows and columns) or a plain numeric array.
\item
  \texttt{'select='} {[} \emph{\texttt{@all}} \textbar{} char \textbar{}
  cellstr {]} - Return VMA for selected variables only; \texttt{@all}
  means all variables.
\end{itemize}

\paragraph{Description}\label{description}

\paragraph{Example}\label{example}


\chapter{Additional jet distributions in the signal regions}
    \label{app:SRkimenaticDistr}

This appendix collects the most relevant distributions for jets in the final state, in the signal regions M1 to M6.
The distributions for the leading jet and $\met$ $\phi$, the $\Delta\Phi$ between the leading jet and the $\met$, the leading jet charged fraction, the second leading jet $\pt$, the jet multiplicity, and the second leading jet $\eta$ and $\phi$ are shown.

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A6_SR_phi1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A6_SR_met_phi_fitted.eps}
    }
  \end{center}
  \caption[The measured azimutal angle, $\phi$, of the leading jet and the $\met$, for the selection cuts of region M1, after the normalization factors extracted from the fit have been applied.]
{The measured azimutal angle, $\phi$, of the leading jet (left) and the $\met$ (right), for the selection cuts M1, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M1_SR_Jet1_0}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A6_SR_dPhi_met_j1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A6_SR_j1_chf_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the $\Delta\phi(\met,\text{jet 1})$ and the charged fraction of the leading jet in the signal regions for the selection cuts of region M1, after the normalization factors extracted from the fit have been applied.]
{The measured azimutal angle difference between the leading jet and the $\met$ (left) and the charged fraction of the leading jet (right) in the signal regions for the selection cuts of region M1, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M1_SR_Jet1}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A6_SR_pt2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A6_SR_n_jets_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A6_SR_eta2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A6_SR_phi2_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the $\pt$ of the second leading jet, the jet multiplicity, and the pseudo-rapidity and azimutal angle of the second leading jet in the signal regions for the selection cuts of region M1, after the normalization factors extracted from the fit have been applied.]
{The measured $\pt$ of the second leading jet (top left), the jet multiplicity (top right), and the pseudo-rapidity (bottom left) and azimutal angle (bottom right) of the second leading jet in the signal regions for the selection cuts of region M1, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M1_SR_Jet2}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A3_SR_phi1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A3_SR_met_phi_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A3_SR_eta1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A3_SR_j1_chf_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the azimutal angle, $\phi$, of the leading jet and the missing transverse energy, the azimutal angle difference between the leading jet and the $\met$, and the charge fraction of the leading jet in the signal regions for the selection cuts of region M2, after the normalization factors extracted from the fit have been applied.]
{The measured azimutal angle, $\phi$, of the leading jet (top left) and the missing transverse energy (top right), the azimutal angle difference between the leading jet and the $\met$ (bottom left) and the charge fraction of the leading jet (bottom right) for the selection cuts M2, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M2_SR_Jet1}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A3_SR_pt2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A3_SR_n_jets_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A3_SR_eta2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A3_SR_phi2_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the $\pt$ of the second leading jet, the jet multiplicity, and the pseudo-rapidity and azimutal angle of the second leading jet in the signal regions for the selection cuts of region M2, after the normalization factors extracted from the fit have been applied.]
{The measured $\pt$ of the second leading jet (top left), the jet multiplicity (top right), and the pseudo-rapidity (bottom left) and azimutal angle (bottom right) of the second leading jet in the signal regions for the selection cuts of region M2, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M2_SR_Jet2}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A4_SR_phi1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A4_SR_met_phi_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A4_SR_eta1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A4_SR_j1_chf_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the azimutal angle, $\phi$, of the leading jet and the missing transverse energy, the azimutal angle difference between the leading jet and the $\met$, and the charge fraction of the leading jet in the signal regions for the selection cuts of region M3, after the normalization factors extracted from the fit have been applied.]
{The measured azimutal angle, $\phi$, of the leading jet (top left) and the missing transverse energy (top right), the azimutal angle difference between the leading jet and the $\met$ (bottom left) and the charge fraction of the leading jet (bottom right) for the selection cuts M3, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M3_SR_Jet1}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A4_SR_pt2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A4_SR_n_jets_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A4_SR_eta2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A4_SR_phi2_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the $\pt$ of the second leading jet, the jet multiplicity, and the pseudo-rapidity and azimutal angle of the second leading jet in the signal regions for the selection cuts of region M3, after the normalization factors extracted from the fit have been applied.]
{The measured $\pt$ of the second leading jet (top left), the jet multiplicity (top right), and the pseudo-rapidity (bottom left) and azimutal angle (bottom right) of the second leading jet in the signal regions for the selection cuts of region M3, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M3_SR_Jet2}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A8_SR_phi1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A8_SR_met_phi_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A8_SR_dPhi_met_j1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A8_SR_j1_chf_fitted.eps}
    }
    \mbox{
    }
  \end{center}
  \caption[Kinematic distributions of the azimutal angle, $\phi$, of the leading jet and the missing transverse energy, the azimutal angle difference between the leading jet and the $\met$, and the charge fraction of the leading jet in the signal regions for the selection cuts of region M4, after the normalization factors extracted from the fit have been applied.]
{The measured azimutal angle, $\phi$, of the leading jet (top left) and the missing transverse energy (top right), the azimutal angle difference between the leading jet and the $\met$ (bottom left) and the charge fraction of the leading jet (bottom right) for the selection cuts M4, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M4_SR_Jet1}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A8_SR_pt2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A8_SR_n_jets_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A8_SR_eta2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A8_SR_phi2_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the $\pt$ of the second leading jet, the jet multiplicity, and the pseudo-rapidity and azimutal angle of the second leading jet in the signal regions for the selection cuts of region M4, after the normalization factors extracted from the fit have been applied.]
{The measured $\pt$ of the second leading jet (top left), the jet multiplicity (top right), and the pseudo-rapidity (bottom left) and azimutal angle (bottom right) of the second leading jet in the signal regions for the selection cuts of region M4, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M4_SR_Jet2}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A9_SR_phi1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A9_SR_met_phi_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A9_SR_dPhi_met_j1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A9_SR_j1_chf_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the azimutal angle, $\phi$, of the leading jet and the missing transverse energy, the azimutal angle difference between the leading jet and the $\met$, and the charge fraction of the leading jet in the signal regions for the selection cuts of region M5, after the normalization factors extracted from the fit have been applied.]
{The measured azimutal angle, $\phi$, of the leading jet (top left) and the missing transverse energy (top right), the azimutal angle difference between the leading jet and the $\met$ (bottom left) and the charge fraction of the leading jet (bottom right) for the selection cuts M5, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M5_SR_Jet1}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A9_SR_pt2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A9_SR_n_jets_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A9_SR_eta2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A9_SR_phi2_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the $\pt$ of the second leading jet, the jet multiplicity, and the pseudo-rapidity and azimutal angle of the second leading jet in the signal regions for the selection cuts of region M5, after the normalization factors extracted from the fit have been applied.]
{The measured $\pt$ of the second leading jet (top left), the jet multiplicity (top right), and the pseudo-rapidity (bottom left) and azimutal angle (bottom right) of the second leading jet in the signal regions for the selection cuts of region M5, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M5_SR_Jet2}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A10_SR_phi1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A10_SR_met_phi_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A10_SR_dPhi_met_j1_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A10_SR_j1_chf_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the azimutal angle, $\phi$, of the leading jet and the missing transverse energy, the azimutal angle difference between the leading jet and the $\met$, and the charge fraction of the leading jet in the signal regions for the selection cuts of region M6, after the normalization factors extracted from the fit have been applied.]
{The measured azimutal angle, $\phi$, of the leading jet (top left) and the missing transverse energy (top right), the azimutal angle difference between the leading jet and the $\met$ (bottom left) and the charge fraction of the leading jet (bottom right) for the selection cuts M6, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M6_SR_Jet1}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A10_SR_pt2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A10_SR_n_jets_fitted.eps}
    }
    \mbox{
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A10_SR_eta2_fitted.eps}
      \includegraphics[width=0.495\textwidth]{MonojetAnalysis/Figures/plot_Stop_A10_SR_phi2_fitted.eps}
    }
  \end{center}
  \caption[Kinematic distributions of the $\pt$ of the second leading jet, the jet multiplicity, and the pseudo-rapidity and azimutal angle of the second leading jet in the signal regions for the selection cuts of region M6, after the normalization factors extracted from the fit have been applied.]
{The measured $\pt$ of the second leading jet (top left), the jet multiplicity (top right), and the pseudo-rapidity (bottom left) and azimutal angle (bottom right) of the second leading jet in the signal regions for the selection cuts of region M6, compared to the background predictions. The latter include the global normalization factors extracted from the fit. The error bands in the ratios include the statistical and experimental uncertainties on the background predictions. For illustration purposes, the distribution of two different SUSY scenarios for stop pair production are included.}
  \label{fig:Plot_M6_SR_Jet2}
\end{figure}


\subsection{Beyond the SM Higgs sector}
\label{bsmhiggs}

After the discovery of the Higgs boson by the ATLAS and CMS Collaborations at the LHC~\cite{20121, 201230} in 2012,
one question comes out: if this Higgs boson at around 125~\gev~ is fully responsible for the unitarization of the scattering amplitudes?
%If not, additional new physics must be present to play this role.
The possibility that this discovered particle is just a part of the extended Higgs sector by various extensions cannot be ruled out.
Many models, motivated by hierarchy and naturalness arguments,
predicted the extended Higgs sector, such as the electroweak-singlet model and the two-Higgs-doublet models (2HDM).

\textbf{Singlet scalar extension of the SM} \\
The electroweak singlet model can be considered as the minimal extension of the SM Higgs sector~\cite{Profumo_2007}, encompassing a single gauge singlet real scalar field $S$.
In this model, a heavy, real singlet is introduced in addition to the SM one.
The associated zero temperature, tree-level scalar potential can be written as:
\begin{equation}
    V = V_{SM} + V_{HS} + V_{S}
\end{equation}
where
\begin{equation}
\begin{split}
    V_{SM} =  \mu^{2} \left( H^{\dagger}H \right) + \bar{\lambda_{0}} \left( H^{\dagger}H \right) \\
    V_{HS} = \frac{a_{1}}{2}\left( H^{\dagger}H \right)S + \frac{a_{2}}{2}\left( H^{\dagger}H \right)S^{2} \\
    V_{S} = \frac{b_{2}}{2} S^{2} + \frac{b_{3}}{3} S^{3} + \frac{b_{4}}{4} S^{4} \\
\end{split}
\end{equation}
where $H$ stands for the SM scalar field of the original Higgs mechanism.
After electroweak symmetry breaking, this model gives rise to two $CP$-even Higgs bosons, in which the lighter one is the Higgs boson that has been discovered at around 125~\gev.
And the new heavy scalar ($S$) is allowed to have both SM and non-SM decays.
One would expect to see suppressions of the branching ratio to SM Higgs decay modes, as the branching ratio to the pair of singlet-like scalars would be considerable.

\textbf{Two Higgs Doublet Model} \\
The two-Higgs-doublet model (2HDM)~\cite{BRANCO20121} is another extension of SM Higgs sector carried by an additional scalar doublet.
In this model, through electroweak symmetry breaking, there are five physical Higgs bosons: two CP-even, one CP-odd, and two charged ones.
The most general CP-conserving 2HDM has seven free parameters:
\begin{itemize}
    \item The masses of five Higgs bosons: $m_{h}$, $m_{H}$, $m_{A}$ and $m_{H^{\pm}}$.
    \item $tan \beta$: $v_1/v_2$, where $v_1$ and $v_2$ are the two Higgs doublets' vacuum expectation values.
    \item $\alpha$: the two neutral CP-even Higgs bosons mixing angle .
    \item $m_{12}^{2}$: the potential parameter mixing the two Higgs doublets.
\end{itemize}
where the $m_{h}$ can be identified as the mass of observed Higgs boson at around 125~\gev, and $m_{H}$ is another heavy scaler with similar properties to $h$ boson.
The coupling of the neutral Higgs bosons to either $WW$ or $ZZ$ follows the rules~\cite{BRANCO20121}:
\begin{enumerate}
    \item The coupling of the light Higgs ($h$) equals to the Standard Model coupling times $sin(\beta - \alpha)$
    \item The coupling of the heavier Higgs ($H$) equals to the Standard Model coupling times $cos(\alpha - \beta)$.
    \item The coupling of the pseudoscalar ($A$) to vector bosons is zero.
\end{enumerate}
The two Higgs doublets, $\Phi_{1}$ and $\Phi_{2}$, can couple to fermions (leptons and up- and down-type quarks) in several ways, which leads to several types of 2HDM models:
\begin{itemize}
    \item Type-\uppercase\expandafter{\romannumeral1} model: all quarks and leptons couple only to $\Phi_{2}$.
    \item Type-\uppercase\expandafter{\romannumeral2} model: down-type quarks and leptons couple to $\Phi_{1}$, and up-type quarks couple to $\Phi_{2}$.
    \item The ``lepton-specific" model: leptons couple to $\Phi_{1}$, while all quarks couple to $\Phi_{2}$.
    \item The ``flipped" model: down-type quarks couple to $\Phi_{1}$, while up-type quarks and leptons couple to $\Phi_{2}$.
\end{itemize}


\chapter*{Abstract}

The in-medium similarity renormalization group (IM-SRG)
is an \abinitio{} many-body method used to great success
to model medium-mass nuclear systems.
Its computational cost scales polynomially,
and its formalism is highly flexible,
leading to multiple variants that have been developed to extend its original closed-shell
formulation to open-shell systems.

The current state-of-the-art implementations truncate the IM-SRG equations
at the normal-ordered two-body level,
the first non-trivial order in the expansion.
In this work, we seek to systematically study the effects
of extending this truncation to the normal-ordered three-body level,
the so-called IM-SRG(3).
We present the results of the current implementation
for ${}^4\text{He}$ and the pairing Hamiltonian,
calculations done to validate our implementation against previous calculations.
We also discuss the steps still to be taken to
arrive at an implementation that will allow for a careful study of the effects
of the IM-SRG(3) truncation for nuclear systems.


\chapter{M-estimators}


% This LaTeX was auto-generated from an M-file by MATLAB.
% To make changes, update the M-file and republish this document.

\subsection*{valueT.m}

\begin{par}
\textbf{Summary:} Test derivatives of the propagate function, which computes the mean and the variance of the successor state distribution, assuming that the current state is Gaussian distributed with mean m and covariance matrix s.
\end{par} \vspace{1em}
\begin{verbatim}[d dy dh] = valueT(p, delta, m, s, dynmodel, policy, plant, cost, H)\end{verbatim}
\begin{par}
\textbf{Input arguments:}
\end{par} \vspace{1em}
\begin{verbatim}p          policy parameters (can be a structure)
  .\ensuremath{<}\ensuremath{>}      fields that contain the policy parameters (nothing else)
m          mean of the input distribution
s          covariance of the input distribution
dynmodel   GP dynamics model (structure)
policy     policy structure
plant      plant structure
cost       cost structure
H          prediction horizon
delta      (optional) finite difference parameter. Default: 1e-4\end{verbatim}
\begin{par}
\textbf{Output arguments:}
\end{par} \vspace{1em}
\begin{verbatim}dd         relative error of analytical vs. finite difference gradient
dy         analytical gradient
dh         finite difference gradient\end{verbatim}
\begin{par}
Copyright (C) 2008-2013 by Marc Deisenroth, Andrew McHutchon, Joe Hall, and Carl Edward Rasmussen.
\end{par} \vspace{1em}
\begin{par}
Last modified: 2013-03-21
\end{par} \vspace{1em}

\begin{lstlisting}
function [d dy dh] = valueT(p, m, s, dynmodel, policy, plant, cost, H, delta)
\end{lstlisting}

\subsection*{Code}

\begin{lstlisting}
if nargin < 9; delta = 1e-4; end
if nargin < 8; H = 4; end

% call checkgrad directly
[d dy dh] = checkgrad('value',p,delta,m,s,dynmodel,policy,plant,cost,H);
\end{lstlisting}


\chapter{Downloading, installing and running \stella}\label{CHAP_INST}

...

\section{Downloading from the public repository}

\section{Setting up \stella~on a new system}

The first time that you try to run~\stella, you may need to install some software, and to set a few environment variables.

\subsection{System requirements}

In order to compile and run \stella, your system should already have installed:

\begin{itemize}
\item The \href{http://www.mcs.anl.gov/petsc/}{\PETSC} library for solving large linear systems.
\item An implementation of \MPI for parallel runs.
\item \href{http://www.fftw.org}{\FFTW} for computing the discrete Fourier transform.
\end{itemize}