\documentclass{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage[top=2.5cm, left=3cm, right=3cm, bottom=4.0cm]{geometry}
\usepackage[toc,page]{appendix}

\usepackage[table]{xcolor}

\newcommand{\tablespace}{\\[1.25mm]}
\newcommand\Tstrut{\rule{0pt}{2.6ex}}
\newcommand\tstrut{\rule{0pt}{2.0ex}}
\newcommand\Bstrut{\rule[-0.9ex]{0pt}{0pt}}

\title{CO395 - Machine Learning Coursework 1}
\author{
    Padmanaba Srinivasan \\
    \texttt{01191525}
    \and
    Keerthanen Ravichandran \\
    \texttt{01195170}
    \and
    Harrison Ankers \\
    \texttt{01211208}
    \and
    Tze Hei Tang \\
    \texttt{01221240}
}
\date{\today}

\begin{document}
\maketitle
\newpage
\tableofcontents
\newpage

\section{Construction of the Decision Tree}
\subsection{Brief overview of building the decision tree}
The following describes algorithm that builds the decision tree given a dataset.
\begin{enumerate}
    \item Begin by creating a root node, then split the dataset at the point which provides the maximum information gain.
    \item Recursively build subtrees using the subsets, which form left and right branches on the root node.
    \item When no further splitting is possible, form leaf nodes which contain room values.
\end{enumerate}

\subsection{How we selected the best attribute in each node}
The attribute with the maximum information gain is used as the splitting point to form subsets.\\
The information gain is calculated as follows:\\
\begin{align}
    \label{decisiontree:f1}
	 G(q) = H(dataset) - (  \frac{|subsetA|}{|dataset|} H(subsetA) + \frac{|subsetB|}{dataset} H(subsetB) )
    \end{align}
Where H(p) is the entropy of the data set p, denoted by:
\begin{align}
    \label{decisiontree:f2}
    H(dataset) = - \sum_{k}^{N} d_{k}log_{2}(d_{k})
\end{align}
where $d_{k}$ denotes the $k^{th}$ element in data set D with N elements\\

Hence, from the above expressions, a threshold value that separates the original data set into data set A and B is selected such that the gain expression is maximised.

In order to achieve the above, we iterate through a sorted version of the data set that corresponds to the current node, and we try to separate the data set into A and B by setting the threshold to $\frac{d_{i} + d_{i+1}}{2}$.

Now, the entropy of data set A and B, and the corresponding information gain are computed according to equations $(\ref{decisiontree:f1})$ and $(\ref{decisiontree:f2})$. The threshold that gives the highest information gain is selected, and the data set is split into subsets A and B, where: $$A_{i} < threshold $$ $$B_{j} \geq threshold$$
\\
The dataset A now corresponds to the left child node, and data set B to the right child node. This process is repeated recursively.
\\\\
Eventually, a leaf has to be created at the end of a branch; there are three conditions in which a leaf is created.
\begin{enumerate}
    \item When either A or B is an empty set, the modal room value original data set is used as the final value of the leaf.
    \item When the all of the attribute values in the original dataset is the same, the modal room number is used as the value of the leaf.
    \item When all of the room values in a dataset are the same, further splitting cannot occur so a leaf node is created with the room number.
\end{enumerate}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%									Cross - Validation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{10 Fold Cross Validation}

\subsection{Why Cross Validation?}
Cross Validation is a technique employed to produce and evaluate the best possible model when the number of samples is low. The dataset is separated into $k$ folds with one fold used as a test set, another as a validation set and the remaining $k-2$ as training data. Repeating this with all possible combinations of training and validation sets will produce $k(k-1)$ tests overall. Evaluation of each model can be performed on the confusion matrix it yields when tested.

In this project, $k=10$ and 90 trees are trained.

\subsection{Cross Validation Implementation}

Given the entire dataset and $k$=10, the size of each fold can be calculated. Following this the dataset is shuffled once and then a fold removed to form the test set. Of the remaining $k-1$ folds, another fold forms the validation set with the residual data making up the training data. This is implemented by having two loops, with the outer loops separating out the test set and the inner loop generating the training and validation set. As a result, every fold gets the opportunity to be test set validation set once each.

After a tree is trained on the training data, its' error rate on test set is found and the confusion matrix analysed (to calculate recall and precision rates as well as F1 values) before the tree is pruned and the new confusion matrix analysed again. Having two sets of confusion matrices both before and after pruning is a useful tool in comparing the effectiveness of pruning.

This procedure is repeated to train 90 trees and test and evaluate 180 trees overall.

\section{Questions}

\subsection{Pruning}

\subsubsection{Pruning Implementation}

Pruning is implemented via the $Pruning$ class in $lib$ which is initialised with a validation set and once built, the root of the tree is passed in for automatic Pruning.

Pruning involves firstly testing the validation set on the tree and obtaining an error rate. Following this the $prunify$ function is called which recursively finds nodes which is the parent of two leaves directly. At this stage there are two possible paths: firstly to make the node a leaf or secondly to keep the decision node as is. The obtains the leaf values from both child nodes and calculates the error rate if the decision node were a leaf with each value. If error rate improves then the best improvement is chosen, the decision node converted into a leaf with this value and the best error rate updated. If pruning does not provide an improvement then the decision node is kept as is.

Another method of pruning is to use Error-Estimation (EE) \cite{eeprune}, commonly used with the C4.5 algorithm. This method takes a more statistical approach and is similar in structure to the standard algorithm. With EE the dataset itself \'travels\' down the tree, splitting on each decision node. When a set reaches a leaf, the leaf calculates the actual error rate a well as the estimated error rate with the formula in figure \ref{pruning:f1}. Both these error rates are returned. Following this the decision node calculates the weighted sum of the error rate of its' leaves to find the node error, and the weighted sum of the estimated error to find the subtree error. Pruning occurs if the node error is larger than the subtree error. This repeats recursively \'up\' the tree. An illustration of this is in figure \ref{pruning:d1}. EE is implemented within the Node class and is called upon as a member function, passing in the validation set as a parameter.

\begin{align}
\label{pruning:f1}
	 e = \frac{ f + \frac{z^2}{2N} + z\sqrt{\frac{f}{N} + \frac{f^2}{N} + \frac{z^2}{4N^2}}  } {1 + \frac{z^2}{N}}
\end{align}

\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{figures/pruningd1.png}
\caption{\label{pruning:d1} An illustration of pruning with Error-Estimation. }
\end{figure}

Testing both methods of pruning with the noisy dataset showed clear advantages to EE; from a high level the standard method for pruning improved noisy dataset classification rate by around 1\% overall, whereas pruning using EE has a more significant effect, typically improving classification rate by 2-5\%.

Looking at the number of nodes after pruning with each method yields some insights. Figure \ref{pruning:s1} shows number of nodes before and after pruning with each method. The trees provided to both prune algorithms were trained on the same training set and so were identical.

\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{figures/prunings1.png}
\caption{\label{pruning:s1} Comparing the number of nodes with different pruning methods. }
\end{figure}

\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{figures/prunings2.png}
\caption{\label{pruning:s2} Pruning with EE followed by the standard method. }
\end{figure}

\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{figures/prunings3.png}
\caption{\label{pruning:s3} Pruning with the standard method followed by EE. }
\end{figure}

Combining these methods, pruning with EE first followed by the standard method yields metrics in figure \ref{pruning:s2} and then reversing the order, pruning vice-verse yields figure \ref{pruning:s3}. In both cases, the datasets (all derived from the noisy dataset) used were the same and so the initial decision tree to was the same. In this example using the standard pruning method after the aggressive EE pruning yields a slightly smaller tree. Over several different datasets, the second method yielded trees of the same size or slightly larger than trees produced by the first method. Correspondingly, the classification rates were the same or slightly larger for the first method overall.

Using combined pruning algorithms yielded slightly higher classification rates than using any one algorithm on its own and showed a clear inverse link between tree size and classification rate. With any pruning algorithm, trees derived from the clean dataset little change in the number of nodes or classification rate.

\subsubsection{Pruning's effects on Classification Rate}

Observing the classification rate for a number of folds on the clean dataset reveals little change in classification rate, with classification rate typically changing by less than 0.5\% post pruning. Decreases in the classification rate are more common and can be expected as the purpose of pruning is to reduce overfitting. The clean dataset is so because it doesn't overfit much to begin with and whatever pruning occurs changes classification rate minimally, with classification rate hovering around 97\% before and after pruning. This seems feasible given the observation that the size of the tree remains the same after pruning despite the methods.

The noisy dataset however, tells a very different story. Pre-pruning, the tree's accuracy hovers around 80-81\%. Pruning with the standard method only improves classification rate from 1-2\% boosting it up to 81-82\%. Using only EE typically boosts classification rate to around 84\% and combining methods yields the same improvement. The small difference in using only EE and combining methods is explained by EE aggressively pruning most of the tree leaving the standard method to prune very little.

Overall, pruning has little effect on classification rate in the clean dataset which is evidenced by little to no reduction in the number of nodes in the tree, with there being around 60 nodes on average and pruning reducing this by around 20\%. In some, rare, extreme cases the number of nodes decreased by 50\%, although classification rate remained constant.

With the noisy dataset the number of nodes drops from around 400-450 to around 300-330, roughly a 25\% reduction in tree size overall. This suggests rampant overfitting on the noisy dataset which is alleviated by pruning but even still is in stark contrast to training on clean data. Also, noticing the difference in sheer number of nodes in trees between the clean and noisy datasets despite training data being of same size, there seems to be a link between the noisiness of the data and the degree to which it is overfitted. This logically leads onto the question of whether data can be cleaned before it is used and whether an indicator of noisy data could be related to the size of the decision tree it produces.

\subsection{Metrics in Clean and Noisy Datasets}

\subsubsection{Metrics}

Various metrics can be obtained from the tests to assess the performance of the tree. Specifically performance can also be analysed by looking at metrics such as classification rate, recall, and F1 measure.

\subsubsection{Performance}

The classification rate displays the percentage of correctly identified elements as a proportion of the whole test set. The pre prune, clean and noisy datasets produced the confusion matrices in tables \ref{clean_preprune} and \ref{noisy_preprune} respectively. The metrics derived from these matrices are in table \ref{avg_metrics}.

Recall rate indicates how many of the actual positive results are classified as positive by the model which for the clean data is very high. Similarly, precision rate - which is a measure of the correct positive predictions as a proportion of total positive predictions - too is high. Correspondingly, the F1 rate too is high. These indicate a high level confidence that the model will correctly classify inputs. The fact the F1 is so close to 1 for both pre prune and post prune indicates that this tree is close of perfect precision and recall.

Post pruning, for the model trained on clean data the recall and precision rates change very little indicating that this method of pruning cannot improve prediction accuracy much further.

The metrics for the noisy dataset however, tell a different story. Both precision rate and recall rate are lower indicating a more spread out confusion matrix where fewer positive predictions and correct and fewer positive values are classified as being positive. Post pruning the metrics increase by around 4.5\% all round, with the increase in F1 showing that the model is getting closer to perfect precision and recall.

\subsubsection{Pruning performance}

Pruning optimises the tree via pruning off leaves that cause overfitting on a validation set, following which the pruned model is tested on the test data once more. It is expected that model performs better on the test data after pruning.

When tested with clean data the classification rate was 97.1\%. Furthermore, when tested with noisy data the rate again lowered to 84.85\%. The clean data classification matrix only slightly increased, though, the noisy data had a larger increase. Both clean and noisy data produced the confusion matrices in tables \ref{clean_preprune} and \ref{noisy_preprune} respectively. Post prune tables are in tables \ref{clean_postprune} and \ref{noisy_postprune}. The clean data produced an average recall of 97.12\% and the noisy produced a recall of 84.86\%. The clean data showed almost no improvement, however, the noisy data had a more dramatic increase. The clean data produced an average F1 of 97.11\% and the noisy produced a F1 of 84.86\%. The F1 metric showed a slight decrease in performance for the clean data, however, the noisy data improved again.

On the clean dataset, pre pruning classification rate was 97.2\% and fell slightly to 97.1\% post pruning. This can be attributed to the data being pruned on the validation set, which by extension reduces overfitting on the test data and attempts to fit the model more to the validation set. Over several repetitions there was no consistent trend in post prune classification rate, sometimes being lower and sometimes higher.

The noisy dataset however, yields some important insights into the effectiveness of pruning. Pre prune classification rate stood at 80.3\% which increased to 84.85\% post prune. This is a significant improvement and again over several repetitions pruning improved classification rate by 3-4\%.

\begin{table}[]
\begin{tabular}{|c|c|c|c|c|}
\hline
 & \textbf{\begin{tabular}[c]{@{}c@{}}Room 1 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 2 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 3 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 4 \\ (Actual)\end{tabular}} \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 1 \\ (Predicted)\end{tabular}} & 49.4 & 0 & 0.2 & 0.5 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 2 \\ (Predicted)\end{tabular}} & 0 & 47.6 & 1.6 & 0 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 3 \\ (Predicted)\end{tabular}} & 0.4 & 2.4 & 48.1 & 0.2 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 4 \\ (Predicted)\end{tabular}} & 0.2 & 0 & 0.1 & 49.3 \\ \hline
\end{tabular}
\caption{Confusion Matrix (clean data pre-prune)}
\label{clean_preprune}
\end{table}

\begin{table}[]
\begin{tabular}{|c|c|c|c|c|}
\hline
 & \textbf{\begin{tabular}[c]{@{}c@{}}Room 1 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 2 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 3 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 4 \\ (Actual)\end{tabular}} \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 1 \\ (Predicted)\end{tabular}} & 38.7 & 3.3 & 2.8 & 3.5 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 2 \\ (Predicted)\end{tabular}} & 3.7 & 40 & 3.9 & 2.1 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 3 \\ (Predicted)\end{tabular}} & 3.2 & 3.5 & 41.5 & 3.8 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 4 \\ (Predicted)\end{tabular}} & 3.4 & 2.9 & 3.3 & 40.4 \\ \hline
\end{tabular}
\caption{Confusion Matrix (noisy data pre-prune)}
\label{noisy_preprune}
\end{table}

\begin{table}[]
\begin{tabular}{l|l|l|l|l|}
\cline{2-5}
 & \multicolumn{2}{l|}{Clean Data} & \multicolumn{2}{l|}{Noisy Data} \\ \cline{2-5}
 & Pre-pruning & Post-pruning & Pre-pruning & Post-pruning \\ \hline
\multicolumn{1}{|l|}{Avg. Precision} & 97.20\% & 97.10\% & 80.30\% & 84.85\% \\ \hline
\multicolumn{1}{|l|}{Avg. Recall} & 97.22\% & 97.12\% & 80.30\% & 84.86\% \\ \hline
\multicolumn{1}{|l|}{Avg. F1} & 97.20\% & 97.11\% & 80.30\% & 84.86\% \\ \hline
\end{tabular}
\caption{Metrics from confusion matrices}
\label{avg_metrics}
\end{table}

\begin{table}[]
\begin{tabular}{|c|c|c|c|c|}
\hline
 & \textbf{\begin{tabular}[c]{@{}c@{}}Room 1 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 2 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 3 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 4 \\ (Actual)\end{tabular}} \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 1 \\ (Predicted)\end{tabular}} & 49.5 & 0 & 0.2 & 0.5 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 2 \\ (Predicted)\end{tabular}} & 0 & 47.7 & 2 & 0 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 3 \\ (Predicted)\end{tabular}} & 0.5 & 23.0 & 47.7 & 0.2 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 4 \\ (Predicted)\end{tabular}} & 0 & 0 & 0.1 & 49.3 \\ \hline
\end{tabular}
\caption{Confusion Matrix (clean data post-prune)} \label{clean_postprune}
\end{table}

\begin{table}[]
\begin{tabular}{|c|c|c|c|c|}
\hline
 & \textbf{\begin{tabular}[c]{@{}c@{}}Room 1 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 2 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 3 \\ (Actual)\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Room 4 \\ (Actual)\end{tabular}} \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 1 \\ (Predicted)\end{tabular}} & 42.6 & 2.9 & 2.6 & 2.5 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 2 \\ (Predicted)\end{tabular}} & 1.6 & 41.3 & 3.9 & 1.8 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 3 \\ (Predicted)\end{tabular}} & 2.5 & 3.6 & 42.6 & 2.3 \\ \hline
\textbf{\begin{tabular}[c]{@{}c@{}}Room 4 \\ (Predicted)\end{tabular}} & 2.3 & 1.9 & 2.4 & 43.2 \\ \hline
\end{tabular}
\caption{Confusion Matrix (noisy data post-prune)} \label{noisy_postprune}
\end{table}

The confusion matrices also hold other important information. In the clean data pre prune matrix (table \ref{clean_preprune}) notice that Room 2 and Room 3 are much more likely to be confused for the each other and observing their metrics in table \ref{rmetrics_cl_pp} confirm this with both these rooms having slightly lower precision and recall rates. The situation doesn't change much with these two rooms still being confused for one another post pruning in table \ref{rmetrics_cl_pop}. This ambiguity could be solved by using training Random Forests and taking the modal result when testing on a sample.

Comparing the metrics for the noisy dataset both pre prune and post prune (tables \ref{rmetrics_no_pp} and \ref{rmetrics_no_pop} respectively) show a significant increase across all classes, which is confirmed by observing the pre prune and post prune confusion matrices. Rooms 1 and 4 shows the largest gain in the metrics and recall and precision rates for all classes are roughly the same suggesting that all classes are impacted equally by the noisy data.

\begin{table}[]
\begin{tabular}{|c|c|c|c|c|}
\hline
Metrics                  & \textbf{Room 1} & \textbf{Room 2} & \textbf{Room 3} & \textbf{Room 4} \\ \hline
\textbf{Recall rate}    & 0.986           & 0.967           & 0.941           & 0.994          \\ \hline
\textbf{Precision rate} & 0.988           & 0.952           & 0.962           & 0.986           \\ \hline
\textbf{F1 rate}        & 0.987           & 0.960           & 0.952           & 0.990           \\ \hline
\end{tabular}
\caption{Metrics for clean pre-prune}
\label{rmetrics_cl_pp}
\end{table}

\begin{table}[]
\begin{tabular}{|c|c|c|c|c|}
\hline
Metrics                 & \textbf{Room 1} & \textbf{Room 2} & \textbf{Room 3} & \textbf{Room 4} \\ \hline
\textbf{Recall rate}    & 0.986            & 0.960           & 0.941           & 0.998           \\ \hline
\textbf{Precision rate} & 0.99           & 0.954           & 0.954           & 0.986            \\ \hline
\textbf{F1 rate}        & 0.988           & 0.957           & 0.947          & 0.992           \\ \hline
\end{tabular}
\caption{Metrics for clean post-prune}
\label{rmetrics_cl_pop}
\end{table}

\begin{table}[]
\begin{tabular}{|c|c|c|c|c|}
\hline
Metrics                 & \textbf{Room 1} & \textbf{Room 2} & \textbf{Room 3} & \textbf{Room 4} \\ \hline
\textbf{Recall rate}    & 0.801             & 0.805           & 0.798           & 0.808           \\ \hline
\textbf{Precision rate} & 0.790             & 0.805           & 0.805           & 0.811            \\ \hline
\textbf{F1 rate}        & 0.795             & 0.804            & 0.802           & 0.810           \\ \hline
\end{tabular}
\caption{Metrics for noisy pre-prune}
\label{rmetrics_no_pp}
\end{table}

\begin{table}[]
\begin{tabular}{|c|c|c|c|c|}
\hline
Noisy post prune        & \textbf{Room 1} & \textbf{Room 2} & \textbf{Room 3} & \textbf{Room 4} \\ \hline
\textbf{Recall rate}    & 0.842           & 0.850           & 0.835           & 0.867           \\ \hline
\textbf{Precision rate} & 0.870           & 0.831           & 0.827           & 0.867           \\ \hline
\textbf{F1 rate}        & 0.855           & 0.840            & 0.83          & 0.867           \\ \hline
\end{tabular}
\caption{Metrics for noisy post-prune}
\label{rmetrics_no_pop}
\end{table}

\begin{table}[]
\begin{tabular}{|c|c|}
\label{depths}

\textbf{Datasets}                    & \textbf{Depth} \\ \hline
\textbf{Clean (Pre-prune)}  & 8             \\ \hline
\textbf{Clean (Post-prune)} & 8             \\ \hline
\textbf{Noisy (Pre-prune)}  & 16             \\ \hline
\textbf{Noisy (Post-prune)}  & 13             \\ \hline
\end{tabular}
\caption{Average depths for trees trained on both datasets, pre and post prune.}
\end{table}

\subsection{Depth and Prediction Accuracy}

Looking at the metrics for the noisy dataset, both pre and post prune observe that for all classes the recall, precision and F1 measures increase. This immediately signifies an increase in prediction accuracy. Since pruning has removed nodes and reduced the depth of the tree an relationship exists between reduced depth and increasing prediction accuracy.

The clean dataset sheds further light on this; the prediction accuracy decreases slightly between after pruning despite depth staying the same. As a result a relationship could exist between the extent of pruning and improvements in prediction accuracy. In other words prediction accuracy will increase only if further pruning causes a reduction in depth.

Table \ref{depths} shows that the depth of the decision tree increases with noisy data. In the clean dataset pruning has little effect on depth and suggests that a clean dataset can be identified by little change in depth of the tree when pruned.

By contrast, trees trained on noisy data see a circa 20\% reduction in depth. This further bolsters the theory that noisy datasets correlate with the extent of tree depth reduction. Observing the drop in tree depth and the corresponding increase in classification rate, in general shorter trees imply a higher classification rate as pruning reduces overfitting in the tree, thereby generalising the paths within the tree.

\section{Printing the tree}
The $PrettyPrint$ module uses the $forest$ package in LaTeX to plot a decision tree object. The trees are printed via a recursive function which is then compiled to a pdf.
\\
Figures \ref{cleant:s2} and \ref{noisyt:s2} are the trees trained on the clean and noisy datasets.
\\
Drawings of both trees have also been included as separate pdf's for clarity.

\begin{figure}
\centering
\includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{figures/clean_tree.png}
\caption{ Clean decision tree. }
\label{cleant:s2}
\end{figure}

\vspace{\floatsep}

\newpage

\begin{sidewaysfigure}
\centering
\includegraphics [width=\textwidth,height=\textheight,keepaspectratio]{figures/noisy_tree.png}
\caption{ Noisy decision tree. }
\label{noisyt:s2}
\end{sidewaysfigure}
\clearpage

\section{Bibliography}

\begin{thebibliography}{9}
\bibitem{eeprune}
Dr Saed Sayad, Overfitting. Accessed 25/01/2019
\\\texttt{http://www.saedsayad.com/decision{\_tree\_overfitting.htm}}
\end{thebibliography}

\end{document}


\chapter{Tool demonstration for load-following and safety analysis:
Transatomic Power MSR}
In order to be competitive in the current domestic energy market, \glspl{MSR}
may need the flexibility to follow net load on the grid. Such load-following
operation has the potential to increase the commercial competitiveness of
nuclear power dramatically. Due to the increasing penetration of renewables
into the electric grid, base-load operation carries the risk of
correspondingly frequent negative electric energy pricing. Thus,
responsiveness to net electricity demand is essential to market relevance
for new designs \cite{energy_information_administration_u.s._2016}.
This chapter presents a validation demonstration applying SaltProc v1.0 to
simulate fuel salt depletion with online reprocessing during short-term
transient to evaluate load-following capabilities of the \gls{TAP} \gls{MSR}.

\section{Technical aspects of load following with nuclear
reactors}\label{ch5:aspects}

The physical constraints limiting power variations in conventional \glspl{LWR}
include \cite{lokhov_technical_2011}:
\begin{itemize}[noitemsep, topsep=0pt]
	\item thermal strain and stress to fuel materials\footnote{This constrain
		does not apply to circulating-fuel \glspl{MSR} because the fuel is
		into a
		liquid form.};
	\item fuel burnup (low excess reactivity at the \gls{EOC});
	\item \emph{$^{135}$Xe poisoning (iodine pit)};
	\item reactivity thermal feedback (change in the temperature of the
	primary coolant and fuel causes negative reactivity insertion which limits
	power regulation capabilities).
\end{itemize}
Each of these physical effects is currently under active international
research.

This chapter focuses only on the fission product poisoning, especially the
``iodine pit''. The ``iodine pit'', also called the ``iodine hole'' or ``xenon
pit'', is the reactor's inability to start a few hours after the reactor power
decreases due to peak of $^{135}$Xe concentration in the core.
The $^{135}$Xe is the strongest known neutron absorber
($\sigma_{a,^{135}Xe}=2.6\times10^6$ barns) with a half-life
$\tau_{1/2}=9.17h$ and yield for $^{235}$U fission about 6.6\%.
Figure~\ref{fig:xe-reaction-chain} shows the entire decay chain, which
characterizes $^{135}$Xe gain and loss channels. The vast
majority of $^{135}$Xe (6.4\%) is produced from $^{135}$I decay
($\tau_{1/2}=6.6h$). About half of $^{135}$I is produced directly from fission
and half from $^{135}$Te decay ($\tau_{1/2}=19s$)
\cite{nuclear_power_production_2020}.
\begin{figure}[hbp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=0.4\textwidth]{ch5/xenon-135-reactions-decay.png}
	\caption{Mechanisms of $^{135}$Xe gain and loss in the reactor core
		(reproduced from \cite{nuclear_power_production_2020}).}
	\label{fig:xe-reaction-chain}
\end{figure}

Under normal operating conditions, $^{135}$Xe is transmuted to $^{136}$Xe
(`burned out') in the reactor core as it is produced.
So, while it harms the neutron economy, balancing the reactor controls can
compensate for its effect. The burnout of $^{135}$Xe for an operating reactor
can be described as follows:
\begin{align}
& \isotope[135]{Xe}+\isotope[1]{n}\rightarrow \isotope[136]{Xe} \;(stable)
\end{align}

Because $^{135}$Xe is produced partially from the $^{135}$I decay, the
$^{135}$Xe concentration directly depends on the $^{135}$I concentration.
Therefore, the iodine and xenon rate of change can be described as follows
\begin{align}
\frac{dI(t)}{dt} &= \gamma_I \Sigma_f\phi - \lambda_II \label{eq:iodine}\\
\frac{dX(t)}{dt} &= \lambda_II+\gamma_X\Sigma_f\phi - \lambda_XX -
\sigma_{a,X}\phi X \label{eq:xenon}
\intertext{where}
I, X &= \mbox{number density of $^{135}$I, $^{135}$Xe [cm$^{-3}$]}
\nonumber\\
\gamma_I,\gamma_X &= \mbox{effective yield of $^{135}$I, $^{135}$Xe
	[fission$^{-1}$]} \nonumber\\
\lambda_I,\lambda_X &= \mbox{decay constant of $^{135}$I, $^{135}$Xe
	[s$^{-1}$]}\nonumber\\
\Sigma_f &= \mbox{macroscopic fission cross section of $^{235}$U [s$^{-1}$]}
\nonumber\\
\sigma_{a,X} &= \mbox{microscopic absorption cross section of $^{135}$Xe
	[b]}\nonumber\\
\phi &= \mbox{neutron flux [$cm^{-2}s^{-1}$].}\nonumber
\end{align}

The difficulty comes when the reactor power is reduced, and there are fewer
neutrons to burn the $^{135}$Xe out, so its concentration increases and
further suppresses reactor power. In this case, the core takes some time to
recover from the power reduction impact of $^{135}$Xe. This response to
changing power levels, particularly from higher to lower power,
dramatically slows the reactor's response to power demand
\cite{lokhov_load-following_2011}.

In a liquid-fueled \gls{MSR}, gaseous fission products (e.g., xenon) can be
dynamically removed from the fuel salt by the gas separation system (see
Section~\ref{sec:gas-separ}). Thus, xenon gas, including problematic
$^{135}$Xe, can be removed from the fuel salt outside the reactor core to
eliminate its negative impact on the core neutronics. If the gas separation
system can remove the vast majority of xenon, it is possible to alter the
reactor power output in a wide range with very brief required recovery time.
Overall, $^{135}$Xe removal during reactor operation would potentially allow
precise and flexible dynamic control of the reactor power level to follow
power demands, typically referred to as `load following.'

This chapter presents modeling and simulation of load following transient
operation of the \gls{TAP} \gls{MSR}. This study focuses on the
$^{135}$Xe/$^{135}$I balance in the \gls{TAP} core and its effect on
reactor performance. In this chapter, I simulated short-term ($<24$ hours)
depletion with the core power changing in the [0,100\%] range for xenon
removal efficiency ($\epsilon_{Xe}$) varied between 0 and 0.915 (see
Table~\ref{tab:gas_removal_efficiency}).

This chapter also demonstrates an analysis of reactor load-following
capability for various moderator configurations and fuel salt compositions to
bound the necessary efficiency of the gas removal system to ensure
load-following operation.

\section{TAP MSR load following analysis}
All of the analysis herein used SaltProc v1.0 with the full-core 3-D model of
the \gls{TAP} \gls{MSR} developed using Serpent 2 (see
Section~\ref{sec:tap_model}). The multi-component, online reprocessing system
model with realistic noble gas removal efficiency described in
Section~\ref{sec:tap-online-model}, is used to simulate fission product
removal and fresh fuel injection during the anticipated transient. To
simulate transients with time-dependent power generation, I added to SaltProc
v1.0 a new capability to perform fuel salt depletion with variable time
step size and power level\footnote{For simplicity, the reactor power level
is adjusted by changing the normalization factor in Serpent (\emph{set power
P[W]}). This simplification assumes that spatial and energy distribution of
the neutron flux remains constant and only the magnitude of the flux changes
with time. That is, control rod movement and the corresponding change in the
flux spatial and energy distribution are not treated here.} during each
depletion step. The depletion calculation in the load following regime
captures the effects of $^{135}$Xe poisoning and illuminates the benefit of
using an online gas removal system in the \gls{TAP} concept.

\subsection{Power load curve selection approach}\label{sec:worst-load}
The load and generation must be continuously and almost instantly balanced in
an electric power system. This is a physical requirement independent of the
market structure. Regulation and load following (in the real-time energy
market they are provided  by the
intra-hour workings) are the two services
required to maintain a balance between power generation and power load.
Figure~\ref{fig:power-curve-ny} demonstrates the morning ramp-up decomposed
into the total load (green), smooth load-following ramp (blue), and regulation
(red). The smooth load-following slowly rises from 3566 MW to 4035 MW over 3
hours. Regulation compensates for high-frequency fluctuations in the load
around the underlying trend within the $\pm55$MW range. In the PJM region
(Delaware, Illinois, Indiana, Kentucky, Maryland, Michigan, New Jersey, North
Carolina, Ohio, Pennsylvania, Tennessee, Virginia, West Virginia, and the
District of Columbia), New York, and New England, the 5-min ramping capability
of a generator is required for the regulation, while in Texas and California
it is 15-min and 10-min, respectively \cite{kirby_method_2005}.
\begin{figure}[htp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=0.85\textwidth]{ch5/power-curve-ny-morning.png}
	\caption{Regulation (red) compensates for minute-to-minute fluctuations in
	system total load (green), load following (blue) compensates for the
	inter- and intra-hour ramps (reproduced from \cite{kirby_method_2005}).}
	\label{fig:power-curve-ny}
\end{figure}

In this context \emph{regulation} refers to the use of online generation or
storage that is equipped with automatic generation control and can change
output quickly (MW/min ramp rate) to compensate for the minute-to-minute
fluctuations in customer loads and correct for unintentional fluctuations
in power generation \cite{kirby_method_2005}. Typical natural gas peaking
plants can ramp at or above 10\% of their capacity per minute
\cite{huff_enabling_2018}. Elite combustion engine peakers (W\"{a}rtsil\"{a})
can ramp up from 10\% to 100\% load (or down) in less than one minute
\cite{wartsila_combustion_2020}. Hydropower plants also typically have
accurate, high-speed ramping capability suitable for regulation
\cite{kirby_method_2005}.

Conventional nuclear power plants (Generation III/III+) can be used for
load-following (blue curve on Figure~\ref{fig:power-curve-ny}) but have
limited maneuverability. For example, the German Konvoi reactors
are designed for 15,000 cycles with daily power variations from 100\% to 60\%
power level with ramp rate up to 2\%/min \cite{ludwig_load_2011}, which is by
order of magnitude slower than fossil-fueled plants.
The \glspl{MSR} must enable daily power variation with a much more flexible
range (from 100\% to 0\% and from 0\% to 100\%) and ramp rate up to 10\%/min
to compete with these generators. The physical constrains limiting power
variation range and ramp rate in nuclear reactors was listed in
Section~\ref{ch5:aspects}.
\emph{The current chapter of the dissertation focuses only on the $^{135}$Xe
poisoning effect.} Other physical effects, such as thermal strain and stress
in structural materials are not treated here.

Performing a depletion calculation with SaltProc v1.0 to mimic the
load-following maneuvering shown in Figure~\ref{fig:power-curve-ny} would
require a very fine time step (e.g., 15-minute step). To simulate power change
with the desired rump rate (0.1 \gls{HFP}/min), depletion time step resolution
of less than a 1-minute is needed.
Such fine resolution requires thousands of depletion time steps to simulate
12-hour transient involving unreasonable computational costs.
Instead, this chapter presents simulations with a 1-hour time step to
investigate the impact of gaseous fission product removal on the reactor
response to power demands.

The most challenging power transient for conventional \glspl{LWR} from the
viewpoint of xenon poisoning is well-defined in the literature. If after the
$^{135}$Xe concentration reaches equilibrium (40-50 hours after startup with
fresh fuel), the reactor power was decreased from 100\% to 0\% (e.g., the
reactor is tripped), the $^{135}$Xe concentration and corresponding negative
reactivity insertion would reach maximum in about 10-11 hours after shutdown
\cite{lamarsh_introduction_1975,
bell_nuclear_1970}. Notably, the time after
shutdown when $^{135}$Xe concentration reaches a maximum strongly depends on
the reactor neutron energy spectrum.

Thus, to demonstrate SaltProc v1.0 capabilities for a short-term transient
with
the reactor power change and to investigate load-following capabilities of the
\gls{TAP} reactor with a focus on the xenon poisoning, I selected following
worst-case power load profile:
\begin{enumerate}[label=(\alph*), noitemsep, topsep=0pt]
	\item operate on 100\% of \gls{HFP} long enough to reach
	$^{135}$I/$^{135}$Xe equilibrium;
	\item instantaneous power drop from 100\% to 0\%;
	\item shutdown for $t^{max}_X$ [hours] to reach the $^{135}$Xe
	concentration extremum;
	\item restart the reactor instantly from 0\% to 100\% power level and
	operate on 100\% for a few hours.
\end{enumerate}
Or in math formulation:
\begin{align}
P(t)& =
\begin{cases}
100\%,&  t < t_{eq}\\
0\%,  &  t_{eq} \leq t \leq t_{eq}+t^{max}_X\\
100\%,&  t > t_{eq}+t^{max}_X
\end{cases}
\intertext{where}
P(t) &= \mbox{reactor power level [\%]} \nonumber\\
t_{eq} &= \mbox{time after startup to reach $^{135}$Xe equilibrium
concentration [h]}
\nonumber\\
t^{max}_X &= \mbox{time after shutdown when $^{135}$Xe concentration peaks
[h].}\nonumber
\end{align}
This postulated worst-case transient could be considered as backing up solar
power with nuclear on a high-solar-penetration grid (e.g., in California).
Any other power load profile (i.e., blue load-following line shown in
Figure~\ref{fig:power-curve-ny}) would demonstrate a significantly milder
xenon poisoning effect because of the power demand change in the [0,100\%]
range realistically is not instantaneous. That is, if the \gls{TAP} \gls{MSR}
would be able to maintain criticality in the described stress test (e.g.,
$k_{eff}>1.0$ during all stages of the transient), then it is capable of
following a realistic load curve.

The local extremum of xenon concentration can be described as follows
\begin{align} \label{eq:xe-extremum}
\frac{dX(t)}{dt} &= 0
\end{align}
The system of Ordinary Differential Equations which consist of
Equations~\ref{eq:iodine}, \ref{eq:xenon}, and \ref{eq:xe-extremum} must be
solved to calculate when the $^{135}$Xe concentration reaches maximum.

If the $^{135}$I and $^{135}$Xe concentrations at shutdown is $I_0$ and $X_0$,
respectively, the time after shutdown when the $^{135}$Xe concentration peaks
is given by:
\begin{align}\label{eq:time-xe-max}
t^{max}_X &= \frac{1}{\lambda_X-\lambda_I}
log\left(\frac{\lambda_X(\lambda_I[X_0+I_0]-\lambda_XX_0)}{\lambda_I^2
I_0}\right)
\end{align}

Since the $^{135}$I and $^{135}$Xe concentrations at shutdown in the \gls{TAP}
core are expected to be different at the \gls{BOL} and \gls{EOL} due to
significant spectral shift, $t^{max}_X$ is recalculated for each case to
obtain the worst possible xenon poisoning effect. The ultimate goal of this
effort is to evaluate the timing and impact of problematic fission product
removal (i.e. xenon removal) on maximum negative reactivity insertion.

\subsection{Results and Analysis}
The \gls{TAP} full core depletion analysis was performed using SaltProc v1.0.
A 1-hour depletion time step captures rapid changes in reactivity and
isotopic composition during the transient.
Figure~\ref{fig:lf-tap-keff-eol-eoc-no} demonstrated the effective
multiplication factor evolution during postulated worst-case transient when
the reactor is tripped for $11$ hours (typical time to reach maximum
$^{135}$Xe concentration in conventional \glspl{LWR}) and then restarted.
\emph{The gas removal system for that demonstration case was inactive to
enhance the xenon poisoning effect.} At the beginning of the transient
(initial conditions), the reactor operated for 8448 days ($\approx23$ years),
and all moderator rods are inserted in the core (see 1668 rods configuration
in Figure~\ref{fig:tap-840-1668}). The negative effect of xenon poisoning is
expected to be the greatest at the \gls{EOL} when the core has the most
thermal neutron spectrum.
The multiplication factor decreases by 64 $pcm$ during the first two hours
after shutdown ($^{135}$Xe concentration reached its maximum) and then
increases by 242 $pcm$ because $^{135}$Xe loss due to decay overcame its gain
from $^{135}$I decay. The $k_{eff}$ increase accelerated after reactor power
turned back to 100\% due to $^{135}$Xe burnout.
Figure~\ref{fig:lf-tap-keff-eol-eoc-no} clearly indicates that the time after
shutdown when the $^{135}$Xe reaches its extremum ($t^{max}_X$) is
significantly shorter for the \gls{TAP} reactor than for \glspl{LWR} (11
hours).
\begin{figure}[htp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=0.9\textwidth]{ch5/keff_kl_1_eol_eoc.png}
	\caption{The effective multiplication factor dynamics for an 11-hour
		shutdown (well-known xenon peak time for \glspl{LWR}) for the TAP
		reactor,
		10 days before the \gls{EOL} (all moderator rods inserted), the gas
		removal system is turned off. Uncertainty ($\sigma\pm7$ $pcm$) is
		shaded.}
	\label{fig:lf-tap-keff-eol-eoc-no}
\end{figure}

Using $^{135}$I and $^{135}$Xe number densities at the 8448$^{th}$ day of
operation (the 10$^{th}$ day before the \gls{EOL}) from long-term realistic
analysis
(see Section~\ref{sec:long-term-real}) and Equation~\ref{eq:time-xe-max}, I
calculated the xenon peak time for the \gls{TAP} \gls{MSR} with all moderator
rods inserted: $t^{max}_X=2.76h$. To estimate maximum negative reactivity
insertion due to xenon poisoning, the transient simulation is repeated with
the finer time resolution (15 minutes instead of 1 hour) and shutdown time of
2.75 hours (e.g., the time between the shutdown and power ramp-up to 100\% is
equal $t^{max}_X$).

Figure~\ref{fig:lf-tap-keff-eol-eoc-no-15} shows that the effective
multiplication factor dropped by 70 $pcm$ during the first 2.75 hours after
shutdown as predicted by Equation~\ref{eq:time-xe-max}. After power ramps up
from 0\% to 100\%, $k_{eff}$ returned to its initial value (1.00151) in 75
minutes. The imbalance between $^{135}$I production and $^{135}$Xe burnout is
the main reason for this positive reactivity boost. Notably, maximum negative
reactivity insertion due to $^{135}$Xe buildup after shutdown in the
\gls{PWR} ($-1500$ $pcm$) is two orders of magnitude greater than in the
\gls{TAP} \gls{MSR} ($-70$ $pcm$).
Thus, the \gls{TAP} reactor with inactive gas removal system remains critical
throughout worst-case power change even during the 8448$^{th}$ of operation
(the 10$^{th}$ day before $k_{eff}$ drops below 1) when operative excess
reactivity is low ($151$ $pcm>70$ $pcm$). If the shutdown happens during the
last 9 days of the \gls{TAP} reactor operation, then the operator would not be
able to restart it until $t^{max}_X=2.76h$ after shutting down.
\begin{figure}[htp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=0.9\textwidth]{ch5/keff_kl_1_eol_eoc_15min.png}
	\caption{The effective multiplication factor dynamics for the worst-case
		load curve (2.75-hour shutdown) for the \gls{TAP} reactor, 10 days
		before the \gls{EOL} (all moderator rods inserted), the gas removal
		system is turned off. Uncertainty ($\sigma\pm7$ $pcm$) is shaded.}
	\label{fig:lf-tap-keff-eol-eoc-no-15}
\end{figure}

The analysis of the fuel composition evolution provides clearer information
about the $^{135}$Xe/$^{135}$I equilibrium and the core state.
Figure~\ref{fig:lf-tap-xe-i-eol-eoc-no-15} shows changes in the number density
of isotopes influential to the \gls{TAP} core neutronics throughout the
transient. The $^{135}$I/$^{135}$Xe number density ratio after reaching xenon
equilibrium is equal to 1.0. After shutdown, $^{135}$I decays to $^{135}$Xe
that is not burned up. The $^{135}$I decay caused xenon concentration to
increase by 4\% from equilibrium after 2.75 hours due to a shorter $^{135}$I
half-life ($\tau_{1/2}(^{135}I)=6.6h$ vs. $\tau_{1/2}(^{135}Xe)=9.17h$). Thus,
during the first 2.75 hours, $^{135}$Xe gain from $^{135}$I decay slightly
overcame $^{135}$Xe decay loss. In sum, the $^{135}$Xe peak is almost
negligible (+4\%) even in the worst-case load profile scenario due to a lower
$^{135}$I/$^{135}$Xe concentration ratio at the equilibrium: 1.0 and 2.3 for
the \gls{TAP} reactor and \gls{PWR}, respectively
\cite{rykhlevskii_impact_2019}.
\begin{figure}[htp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=\textwidth]{ch5/xe_i_kl_1_eol_eoc_15min.png}
	\caption{Number density of $^{135}$Xe and its direct precursor $^{135}$I
	for the worst-case load curve (2.75-hour shutdown) for the \gls{TAP}
	reactor, 10 days before the \gls{EOL} (all moderator rods inserted), the
	gas removal system is turned off.}
	\label{fig:lf-tap-xe-i-eol-eoc-no-15}
\end{figure}

Table~\ref{tab:lf-rho-change-eps-zero} shows that \emph{even without gas
removal} the \gls{TAP} reactor experienced \emph{insignificant effect of xenon
poisoning} during the transient, however, the effect worsened toward the
\gls{EOL}. I repeated the fuel
composition and multiplication factor evolution analysis described earlier to
evaluate impact of the reactor spectrum (geometry \#1 has a significantly
harder spectrum than geometry \#15) and the fuel salt composition on the
effect of xenon poisoning and on the reactor's potential ability to
follow load.
The effect of xenon  poisoning worsens toward the \gls{EOL} because the
$^{135}$Xe concentration peak is larger for the most thermal core
configuration (all moderator rods inserted, the largest moderator-to-fuel
ratio). Right after the final moderator configuration update (switch from
geometry
\#14 to \#15), the xenon concentration peak is slightly larger than at the
297$^{th}$ day of the cycle. The fissile $^{235}$U, $^{239}$Pu, and $^{241}$Pu
concentration decreasing during last cycle due to burnup, while poisonous
actinides (e.g., $^{238}$Pu, $^{240}$Pu, $^{242}$Pu, $^{236}$U) concentration
increases which impacts $^{135}$I/$^{135}$Xe number density ratio and,
consequently, $^{135}$Xe concentration peak value. Notably, such phenomena are
not observed for the \gls{BOL} (geometry \#1, SVF=0.903) or \gls{MOL}
(geometry \#8, SVF=0.766).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[htp!]
	\centering
	\caption{Effect of $^{135}$Xe poisoning after shutdown for the
		\gls{TAP} reactor operation with inactive gas removal system
		($\epsilon_{Xe}=0$). Stochastic uncertainty $\sigma_{\rho}=7$
		$pcm$.}
	\begin{tabularx}{\textwidth}{p{0.06\textwidth} p{0.03\textwidth} R R R R
			R}
		\hline
		Geo\-metry &	SVF [-] & Time after moderator configuration update
		[d] & Operative excess reactivity ($\rho_0$) [$pcm$] & Analytically
		predicted $^{135}$Xe peak
		time ($t^{max}_X$) [h] & Maximum relative $^{135}$Xe concentration
		change [\%] & Maximum reactivity change after shutdown ($\Delta\rho$)
		[$pcm$] \\ \hline
		1 & 0.903 & 3       & 3542 & 0.749 & +0.33 & -10  \\
		1 & 0.903 & 288     & 405  & 0.500 & +0.14 & -15  \\
		1 & 0.903 & 315     & 165  & 0.484 & +0.13 & -4   \\\hline
		8 & 0.766 & 3       & 3014 & 0.688 & +0.36 & -10  \\
		8 & 0.766 & 390     & 1529 & 0.722 & +0.39 & 0    \\
		8 & 0.766 & 777     & 204  & 0.751 & +0.42 & 0    \\\hline
		15& 0.536 & 3       & 2263 & 2.528 & +3.32 & -57  \\
		15& 0.536 & 153     & 1160 & 2.647 & +3.69 & -60  \\
		15& 0.536 & 297     & 129  & 2.758 & +4.07 & -70  \\
		\hline
	\end{tabularx}
	\label{tab:lf-rho-change-eps-zero}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Overall, the \gls{TAP} \gls{MSR} could be restarted after shutdown \emph{even
without gas removal} in worst-case initial conditions: the most thermal
moderator configuration, low operative excess reactivity at the end of the
burnup cycle, instantaneous power drop, and $^{135}$Xe concentration at its
extremum. To investigate the benefits of online fission gas removal on the
xenon poisoning effect, I repeated the postulated transient simulation for
different moments in time (e.g., \gls{BOL}, MOL, \gls{EOL}) with a fully
operational gas removal system ($\epsilon_{Xe}=0.915$).

Figure~\ref{fig:lf-tap-rho-kl100-eol-eoc} demonstrates a more notable xenon
poisoning effect for the case with high gas removal efficiency than for
the no-removal case. The reactivity drops by 100 $pcm$ during the
first hour after shutdown. The gas removal system keeps $^{135}$Xe
concentration very low by continuously extracting 91.5\% of xenon isotopes.
Simultaneously, the online reprocessing system extracts $^{135}$I very slowly
(cycle time is 60 days); hence, $^{135}$I/$^{135}$Xe concentration ratio is
significantly greater than for the no-removal case (11.0 vs. 1.0). According
to Equation~\ref{eq:time-xe-max}, $^{135}$Xe concentration should reach local
extremum in about 11 hours after shutdown, but this equation disregards online
reprocessing. The depletion simulation performed using SaltProc v1.0
demonstrated that $^{135}$Xe concentration peaked in one hour after the
shutdown and caused the reactivity drop by 100 $pcm$ (see
Figure~\ref{fig:lf-tap-rho-kl100-eol-eoc}). Afterward,
the reactivity restored quickly ($<2$ hours) to its initial value because
the gas removal system extracts 91.5\% of xenon every hour. Overall,
$^{135}$Xe loss due to its decay and online gas extraction is more significant
than $^{135}$Xe gain due to $^{135}$I decay throughout the transient.
\begin{figure}[htp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=0.97\textwidth]{ch5/rho_kl100_eol_eoc.png}
	\vspace{-5mm}
	\caption{Reactivity dynamics during an 11-hour shutdown for the
		\gls{TAP} reactor, 10 days before the \gls{EOL} (all moderator rods
		inserted), the gas removal system operates with efficiency
		$\epsilon_{Xe}=0.915$. Uncertainty ($\sigma\pm5$ $pcm$) is
		shaded.}
	\label{fig:lf-tap-rho-kl100-eol-eoc}
\end{figure}

Table~\ref{tab:lf-rho-change-eps-1} shows that the \gls{TAP} reactor with
high gas removal efficiency experienced \emph{small effect of xenon poisoning}
during the transient, and it also worsened toward the \gls{EOL}. Similar to
the analysis with inactive gas removal
system, maximum negative reactivity insertion due to xenon poisoning worsens
toward the \gls{EOL} because $^{135}$Xe absorption cross section drops
dramatically as energy grows. Notably,
the maximum $^{135}$Xe concentration peak is significantly greater for an
excellent gas removal efficiency ($\epsilon_{Xe}=0.915$) than for the
no-removal case ($\epsilon_{Xe}=0$): +197\% and +4\%, respectively. Despite
greater $^{135}$Xe concentration peak, negative change of reactivity after
shutdown for the $\epsilon_{Xe}=0.915$ case is slightly deeper than for the
$\epsilon_{Xe}=0$ case: -100 $pcm$ and -70 $pcm$, respectively. The reason for
this is the neutron energy spectrum in the \gls{TAP} \gls{MSR}, which is
harder than in conventional light-water thermal reactors. As we know,
fast reactors are unaffected by xenon poisoning because the absorption cross
section of $^{135}$Xe in the fast spectrum is insignificantly larger than
absorption cross section of other fission products \cite{bell_nuclear_1970,
svanstrom_load_2016-2}. The \gls{TAP} concept has intermediate spectrum which
softens towards the \gls{EOL}. Finally, the effect of xenon
poisoning in \gls{TAP} \gls{MSR} is almost negligible and can be easily
compensated by control rod movement, while in well-studied \gls{PWR} it
presents a challenge ($-1500$ $pcm$) \cite{rykhlevskii_impact_2019}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[htp!]
	\centering
	\caption{Effect of $^{135}$Xe poisoning after shutdown for the
		\gls{TAP} reactor operation with the high $^{135}$Xe removal
		efficiency ($\epsilon_{Xe}=0.915$). Stochastic uncertainty
		$\sigma_{\rho}=5$ $pcm$.}
	\begin{tabularx}{\textwidth}{p{0.06\textwidth} p{0.03\textwidth} R R R R
			R}
		\hline
		Geo\-metry &	SVF [-] & Time after moderator configuration update
		[d] & Operative excess reactivity ($\rho_0$) [$pcm$] &
		$^{135}$I/$^{135}$Xe concentration ratio before shutdown
		[-] & Maximum relative $^{135}$Xe concentration
		change [\%] & Maximum reactivity change after shutdown ($\Delta\rho$)
		[$pcm$] \\ \hline
		1 & 0.903 & 9       & 3344 & 8.96  & +174 & -50  \\
    	1 & 0.903 & 171     & 1930 & 8.76  & +173 & -40  \\
		1 & 0.903 & 324     & 570  & 8.66  & +172 & -38  \\\hline
		8 & 0.766 & 3       & 3570 & 8.87  & +175 & -61  \\
		8 & 0.766 & 366     & 2150 & 8.90  & +174 & -40  \\
		8 & 0.766 & 762     & 762  & 8.93  & +175 & -33  \\\hline
		15& 0.536 & 9       & 3370 & 11.07 & +194 & -105  \\
		15& 0.536 & 90      & 2771 & 11.17 & +195 & -108  \\
		15& 0.536 & 303     & 1265 & 11.42 & +197 & -100  \\
		\hline
	\end{tabularx}
	\label{tab:lf-rho-change-eps-1}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Additionally, I analyzed the neutron spectrum of both reactors to understand
the difference
between $^{135}$I/$^{135}$Xe gain and loss for the \gls{TAP} \gls{MSR} and
\gls{PWR}. Figure~\ref{fig:tap-pwr-spectrum}
demonstrates the neutron flux energy distribution normalized by unit lethargy
for both reactors. The \gls{TAP} reactor spectrum at the \gls{BOL} (SVF=0.903)
is much harder than for the \gls{PWR} due to a lack of moderation in the
\gls{TAP} core and its type (ZrH$_{1.66}$ instead of light water). The harder
neutron spectrum leads to weaker $^{135}$Xe transmutation because the capture
cross section declines rapidly with energy (see
Figure~\ref{fig:tap-pwr-spectrum}, lower plot, solid red line, energy range
from $10^{-7}$ to $10^{-4}$ MeV). As a result, the $^{135}$I/$^{135}$Xe number
density ratio is 0.78 for the \gls{TAP} \gls{MSR} at the \gls{BOL}, which is
significantly lower than that for the \gls{PWR} with fresh fuel (2.3).
Thus, $^{135}$Xe gain from $^{135}$I decay cannot overcome $^{135}$Xe loss due
to decay, and no xenon concentration peak is observed at the \gls{BOL}
(Table~\ref{tab:lf-rho-change-eps-zero}, first three rows).
\begin{figure}[hbp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=\textwidth]{ch5/tap_vs_pwr_spectrum_2.png}\\
	\vspace{-19mm}
	\hspace{+0.05mm}
	\includegraphics[width=\textwidth]{ch5/i_xe_xs.png}
	\vspace{-8mm}
	\caption{Neutron spectra normalized by lethargy for the \gls{PWR} and
		\gls{TAP} (upper) and $^{135}$I, $^{135}$Xe caption cross
		section (lower) \cite{rykhlevskii_impact_2019}.}
	\label{fig:tap-pwr-spectrum}
\end{figure}

The \gls{TAP} \gls{MSR} neutron spectrum thermalizes toward the \gls{EOL} due
to additional moderator rod insertion. Figure~\ref{fig:tap-pwr-spectrum}
shows that the \gls{TAP} core spectrum at the \gls{EOL} (after 23 years of
operation, all moderator rods inserted into the core) is thermal and  similar
to the \gls{PWR} spectrum. However, the $^{135}$I/$^{135}$Xe inventory ratio
for the \gls{PWR} with fresh fuel is significantly greater than for the
\gls{TAP} core at the \gls{EOL} despite similar spectra (2.3 and 1.0,
respectively). The reason for that difference is the different fissile
content. Results in Section~\ref{sec:long-term} shown that toward the
\gls{EOL} fissile $^{235}$U is being substituted with fissile $^{239}$Pu and
$^{241}$Pu. More specifically, instead of 6.8 t of $^{235}$U at startup,
at the \gls{EOL}, the fuel salt contains 1.3 t of $^{235}$U, 1 t of
$^{239}$Pu, and 0.5 t of $^{241}$Pu. That is, the fuel salt fissile inventory
in the \gls{TAP} \gls{MSR} at the \gls{EOL} contains 46 wt\% of $^{235}$U, 36
wt\% of $^{239}$Pu, and 18 wt\% of $^{241}$Pu.
%Once again, during the \gls{TAP}
%\gls{MSR} operation a few major changes which impacted $^{135}$I/$^{135}$Xe
%gain and loss are observed: (1)
%neutron spectrum is shifted from fast to thermal
%(Figure~\ref{fig:tap-pwr-spectrum});
%(2) fissile $^{235}$U is substituted with
%fissile plutonium isotopes (e.g., $^{239}$Pu and $^{241}$Pu).

Table~\ref{tab:fp-yield-thermal-fission} shows $^{135}$I and $^{135}$Xe yields
from thermal fission for all fissile isotopes contained in the fuel
salt. At the \gls{BOL}, $^{135}$I and $^{135}$Xe in the \gls{TAP}
reactor and \gls{PWR} are produced from $^{235}$U fission. The $^{135}$I
isotope production rate  per thermal fission stays approximately the same
during 23 years of operation because $^{135}$I yield is very close for all
considered fissile isotopes. However, the rate of $^{135}$Xe production
directly from fission for
fissile plutonium isotopes is significantly greater than for the $^{235}$U
(e.g., $\approx5$ times greater for $^{239}$Pu and $\approx8$ times greater
for $^{241}$Pu). Thus, a greater $^{135}$Xe production rate toward \gls{EOL}
with approximately the same $^{135}$I production rate leads to a smaller
$^{135}$I/$^{135}$Xe concentration ratio. Overall, $^{135}$I/$^{135}$Xe
number density ratio increasing from 0.78 to 1.0 during 25 years of the
\gls{TAP} \gls{MSR} operation, which leads to a more massive $^{135}$Xe
concentration peak after shutdown and worsens xenon poisoning effect.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[htp!]
	\centering
	\caption{Fission product yields (isotopes per fission) from thermal
	fission
	\cite{nichols_handbook_2008}.}
	\begin{tabularx}{0.6\textwidth}{p{0.12\textwidth} R R R}
		\hline
		\textbf{Isotope}  & \textbf{$^{235}$U} &
		\textbf{$^{239}$Pu} & \textbf{$^{241}$Pu} \\ \hline
		$^{135}$I  & 0.0639 & 0.0633 & 0.0684 \\
		$^{135}$Xe & 0.0022 & 0.0103 & 0.0017 \\
		\hline
	\end{tabularx}
	\label{tab:fp-yield-thermal-fission}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{table}[htp!]
%	\centering
%	\caption{Fission product yields (atoms per fission) from fast fission
%	\cite{nichols_handbook_2008}.}
%	\begin{tabularx}{0.6\textwidth}{p{0.12\textwidth} R R R }
%		\hline
%		\textbf{Isotope}  & \textbf{$^{235}$U} &
%		\textbf{$^{239}$Pu} & \textbf{$^{241}$Pu} \\ \hline
%		$^{135}$I  & 0.0601 & 0.0624 & 0.0696 \\
%		$^{135}$Xe & 0.0031 & 0.0126 & 0.0030 \\
%		\hline
%	\end{tabularx}
%	\label{tab:fp-yield-fast-fission}
%\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In conclusion, I observed a negligible xenon poisoning in the \gls{TAP}
reactor during the anticipated transient because it has a relatively hard
neutron energy spectrum even at the most thermal core configuration (all
moderator rods are inserted into the core). The harder spectrum gives
a small $^{135}$I/$^{135}$Xe concentration ratio which leads to a low
$^{135}$Xe concentration peak after the shutdown. Notably, the fission gas
removal with high efficiency did not significantly change the xenon poisoning
effect because the $^{135}$Xe absorption cross section fell dramatically as
neutron energy grows. Overall, the \gls{TAP} reactor can effectively
load-follow even without fission gas removal.

\section{Safety and operational parameters evolution during load following}
\label{ch5:saf_param}
To analyze the impact of the load-following transient on the \gls{TAP} concept
safety, I calculated safety and operational parameters at various moments
during postulated earlier worst-case power change transient (0\% power level
for 11 hours, instantaneous power boost to 100\%, and then 10 hours on 100\%
power level) using methodology from Section~\ref{sec:safety-param}. The
combination of fuel and moderator temperature feedback coefficients must
remain negative, and the reactivity worth of control rods must be sufficient
to shut down the reactor throughout the transient. Ideally, the reactor is
more controllable if major safety and operational parameters remain stable and
unaffected by the substantial power level change.

\subsection{Temperature coefficient of reactivity}
Figure~\ref{fig:lf-tap-tc-evo} shows the temperature feedback coefficient
evolution for the \gls{TAP} reactor during the power change transient. The
Fuel Temperature Coefficient ($\alpha_{T,F}$) became less negative during the
first hour of the transient due to a slight spectrum hardening because the
$^{135}$Xe concentration peak changes the Doppler effect in the fuel salt.
After turning the power back on, all three temperature coefficients of
reactivity remains stable because the fuel salt composition remain almost
unchanged. Overall, the isothermal temperature coefficient, $\alpha_{T,ISO}$
remains negative and strong throughout the postulated transient and
fluctuates slightly within stochastic error range
$\sigma_{\alpha_{T,ISO}}\pm0.043$ $pcm/K$.
\begin{figure}[htp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=\textwidth]{ch5/saf_par/tc_evo.png}
	\caption{Temperature feedback coefficients during the postulated
		transient for the \gls{TAP} reactor, 10 days before the \gls{EOL} (all
		moderator rods inserted), the gas removal system operates with
		efficiency $\epsilon_{Xe}=0.915$. The uncertainty, $\pm\sigma$, is
		shaded.}
		\label{fig:lf-tap-tc-evo}
\end{figure}

\subsection{Void coefficient of reactivity}
Figure~\ref{fig:lf-tap-void-evo} demonstrates the void coefficient of
reactivity evolution during the postulated transient.
The $\alpha_V$ remains almost constant throughout the postulated transient.
All observed changes in the void coefficient of reactivity are due to the
stochastic nature of the Monte Carlo method ($\sigma_{\alpha_V}\pm4$ $pcm/$\%).
\begin{figure}[htp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=\textwidth]{ch5/saf_par/void_evo.png}
	\caption{Void coefficient of reactivity as a function of time during
	postulated transient for the \gls{TAP} reactor, 10 days before the
	\gls{EOL} (all moderator rods inserted), the gas removal system operates
	with efficiency $\epsilon_{Xe}=0.915$.}
	\label{fig:lf-tap-void-evo}
\end{figure}

\subsection{Reactivity control rod worth}
Figure~\ref{fig:lf-tap-crw-evo} demonstrates the control rod worth evolution
during the power change transient. The control rod worth remains almost
constant and sufficient to shut down the reactor throughout the postulated
transient. During the first three hours of the transient, the control rod
worth decreases from $1998.9\pm8.9$ $pcm$ to $1988.3\pm8.9$ $pcm$ due to a
slight spectrum hardening caused by $^{135}$Xe concentration raise. Overall,
the control rod worth changes are insignificant and lie within the
stochastic error range ($\sigma_{CRW}\pm8.9$ $pcm$).
\begin{figure}[htp!] % replace 't' with 'b' to
	\centering
	\includegraphics[width=\textwidth]{ch5/saf_par/crw_evo.png}
	\caption{Total control rod worth as a function of time during postulated
	transient for the \gls{TAP} reactor, 10 days before the \gls{EOL} (all
	moderator rods inserted), the gas removal system operates with efficiency
	$\epsilon_{Xe}=0.915$.}
	\label{fig:lf-tap-crw-evo}
\end{figure}

\section{Concluding remarks}
This chapter demonstrated the short-term depletion simulations for the
\gls{TAP} reactor with the core power level variation in the range of [0,
100\%] using SaltProc v1.0 and Serpent. I considered two different noble gas
removal scenarios: (1) no gas removal (e.g., $\epsilon_{Xe}=0$),
and (2) fully operational gas removal system (e.g., $\epsilon_{Xe}=0.915$).
The results in the literature reported that negative xenon poisoning effect
for conventional \glspl{LWR} reaches its extremum $\Delta\rho\approx-1500$
$pcm$ in approximately 11 hours after shutdown. Such a vast reactivity drop
complicates the \glspl{LWR} load-following.

For the case with no gas removal ($\epsilon_{Xe}=0$), $^{135}$Xe
concentration peaks about 45 and 165 min after the shutdown at the
\gls{BOL} and \gls{EOL}, respectively. The xenon concentration peaks
sooner for the harder core configuration (e.g., at the \gls{BOL}, SVF=0.9)
because $^{135}$Xe absorption cross section drops dramatically as neutron
energy grows above 0.1 eV, thus, $^{135}$Xe burn out faster in a harder
spectrum. Thus, the harder spectrum leads to a smaller $^{135}$I/$^{135}$Xe
concentration ratio and, consequently, lower xenon concentration peak after
shutdown. Without gas removal (e.g., $^{135}$Xe loss after
shutdown due to decay only) xenon concentration at the \gls{BOL} remains
almost constant ($\Delta N_{^{135}Xe}=+0.33$\%), and no effect of xenon
poisoning was observed ($\Delta\rho=-10\pm7$ $pcm$). However, at the
\gls{EOL}, when all moderator rods are in and the neutron spectrum is more
thermal, I observed a more significant effect of poisoning: $^{135}$Xe
concentration increased by 4\% with corresponding negative reactivity
insertion of $-70$ $pcm$.

For the case with very effective noble gas removal ($\epsilon_{Xe}=0.915$),
the time when $^{135}$Xe concentration peaks cannot be predicted analytically,
because, after shutdown, the gas removal system removes a major
fraction of xenon gas at the end of each depletion step. Moreover, the
$^{135}$I/$^{135}$Xe ratio is significantly greater (e.g., between 8.66 and
11.42) than for the non-removal ($\epsilon_{Xe}=0$) case. Thus, $^{135}$I
decay leads to
a substantial increase in $^{135}$Xe concentration right after shutdown (up to
+200\% at the \gls{EOL}), and corresponding reactivity drop ($-108\pm5$ $pcm$
at the \gls{EOL}). However, after the first hour, reactivity increases quickly
because the gas removal system extracts most of the xenon every 1 hour (the
selected SaltProc v1.0 depletion time step). The true effect of xenon
poisoning for the \gls{TAP} reactor with active gas removal is expected to be
even less severe because the real system would remove noble gases
continuously, not discretely as simulated by SaltProc (e.g., xenon would be
removed with $\epsilon_{Xe}=0.915$ every moment, not once per hour). Overall,
more realistic results for load-following transients can be obtained with
better time resolution. Though the ideal depletion time step should be closer
to full loop time (20 seconds), such fidelity would require an enormous
computation burden.

Finally, this chapter demonstrated that the \gls{TAP} reactor maintains
required safety margins during postulated transients. The temperature feedback
coefficients, void coefficient of reactivity, and control rod worth all remain
within stochastic uncertainty throughout the transient. Small elevation in
total temperature coefficient and void coefficient of reactivity during the
first hour after shutdown is due to the $^{135}$Xe concentration raise and
corresponding short-term neutron spectrum hardening. In conclusion, the
\gls{TAP} \gls{MSR}, even without gas removal, is capable of the safe restart
after reducing power from 100\% to 0\% even when $^{135}$Xe concentration
peaks.
While this work has confirmed neutronics feasibility of resilience against the
iodine pit, separate thermomechanical structural analysis is needed to confirm
that structural materials could withstand such dramatic core power
fluctuations.
%The comprehensive material study must be done to prove that structural
%materials could withstand such dramatic core power fluctuations.


% --------------------------------------------------------------
% This is all preamble stuff that you don't have to worry about.
% Head down to where it says "Start here"
% --------------------------------------------------------------

\documentclass[12pt]{article}

\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{hyperref}
\setlength{\parindent}{2em}
\setlength{\parskip}{1em}
\usepackage{graphicx}
%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{listings}
\usepackage{color}
\usepackage{rotating}

\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{mystyle}{
	backgroundcolor=\color{backcolour},
	commentstyle=\color{codegreen},
	keywordstyle=\color{magenta},
	numberstyle=\tiny\color{codegray},
	stringstyle=\color{codepurple},
	basicstyle=\footnotesize,
	breakatwhitespace=false,
	breaklines=true,
	captionpos=b,
	keepspaces=true,
	numbers=left,
	numbersep=5pt,
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	tabsize=2
}

\lstset{style=mystyle}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}

\newenvironment{problem}[2][Problem]{\begin{trivlist}
		\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{solution}[2][Solution]{\begin{trivlist}
		\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{theorem}[2][Theorem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{lemma}[2][Lemma]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{exercise}[2][Exercise]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{reflection}[2][Reflection]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{proposition}[2][Proposition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{corollary}[2][Corollary]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}

\begin{document}

% --------------------------------------------------------------
%                         Start here
% --------------------------------------------------------------

%\renewcommand{\qedsymbol}{\filledbox}

\title{Final Project}%replace X with the appropriate number
\author{Sebastian Gomez-Cardona\\ %replace with your name
622 Computational Economics} %if necessary, replace with your course title

\maketitle

In this document I will replicate most of the paper "Income and wealth distribution in macroeconomics: a continuous-time approach" by Achdou et al. This papers has basic algorithms to solve heterogeneous agents models in continuous time. I will focus in 3 parts: i) a Huggett economy, for which I calculate the policy functions and the equilibrium interest rate, ii) MIT shocks in the context of the Huggett model, and iii) the Huggett model including housing, which introduces non-convexities.\\
This document is organize as follows: first I introduce the problem of an agent in the Huggett economy, then I describe the way to solve it based on the viscosity solution for partial differential equations. Third I present the results and an interpretation of them. Finally, I briefly describe the economy with two goods: bonds and housing, and present my results for this model.\\

\section{Huggett model in continuous time}
The economy is populated with a continium of individuals of measure 1. Each individual is infinitely lived, receives income $y_t$, can save in a risk-free asset and has a borrowing constraint of $\underline{a}$. Therefore, we can write
\begin{equation}\label{eq1}
\begin{split}
&\max_{c_t, t\geq 0} E_0 \int_0^\infty e^{-\rho t} u(c_t) dt\\
&\text{s.t.      } \dot{a}_t=y_t+r_t a_t-c_t \\
&a_t\geq \underline{a}
\end{split}
\end{equation}

If we assume that there are only two possible values for the income shock, $y_1, y_2$, then we can denote $g_j(a,t)$ as the pdf of the distribution of agents with wealth $a$ and income $y_j$ at time t. Therefore, the market clearing condition for this economy is (I have assumed that asset is in zero external supply):
\begin{equation}
\int_{\underline{a}}^{\infty}a g_1(a,t)da+\int_{\underline{a}}^{\infty}a g_2(a,t)da=0 \text{   } \forall t
\end{equation}

\section{Derivation of the HJB and KF equations}
For a period of length $\Delta$ individuals discount factor is $e^{-\rho\Delta}$, individuals with income $y_j$ have probability $e^{-\lambda_j\Delta}$ to keep the same income. With this, we can write the Bellman equation for problem \ref{eq1} as
\begin{equation}\label{eqBellman}
\begin{split}
&v_j(a_t)=\max_{c} u(c)\Delta+e^{-\rho\Delta}(e^{-\lambda_j\Delta} v_j(a_{t+\Delta})+(1-e^{-\lambda_j\Delta} )v_{-j}(a_{t+\Delta}))\\
&a_{t+\Delta}=\Delta(y_j+ra_t-c)+a_t\\
&a_{t+\Delta}\geq \underline{a}
\end{split}
\end{equation}
Since we'll make $\Delta\rightarrow 0$ then $e^{-\rho\Delta}\approx 1-\rho\Delta$ and $e^{-\lambda_j\Delta}\approx1-\lambda_j\Delta$. Substituting these in the problem defined in \ref{eqBellman}, and substracting $(1-\rho\Delta)v_j(a)$ from both sides of the objective function, we get
\begin{equation}\label{eqBellman2}
\begin{split}
&\Delta\rho v_j(a_t)=\max_{c} u(c)\Delta+(1-\rho\Delta)( v_j(a_{t+\Delta})-v_j(a_t)+(\Delta\lambda_j)(v_{-j}(a_{t+\Delta})-v_{j}(a_{t+\Delta}))\\
&a_{t+\Delta}=\Delta(y_j+ra_t-c)+a_t\\
&a_{t+\Delta}\geq \underline{a}
\end{split}
\end{equation}
Finally, since
\begin{equation}
\lim_{\Delta\rightarrow0}\frac{v_j(a_{t+\Delta})-v_j(a_t)}{\Delta}=\lim_{\Delta\rightarrow0}\frac{v_j(\Delta(y_j+ra_t-c)+a_t)-v_j(a_t)}{\Delta}=v'_j(a_t)(y_j+ra_t-c)
\end{equation}
dividing \ref{eqBellman2} by $\Delta$ and taking $\Delta\rightarrow0$ we get the HJB equation
\begin{equation}\label{eqHJB}
\rho v_j(a_t)=\max_{c} u(c)+v'_j(a_t)(y_j+ra_t-c)+\lambda_j(v_{-j}(a_{t})-v_{j}(a_{t}))
\end{equation}
Now, before dealing with the boundary condition let's define consumption and savings as derived from the problem above
\begin{equation}\label{eqS}
s_j(a_t)=y_j+ra_t-c_j(a_t)
\end{equation}
\begin{equation}\label{eqC}
c_j(a_t)=(u')^{-1}(v'_j(a_t))
\end{equation}
Now, the borrowing constraint never binds for $a>\underline{a}$ since being above the borrowing constraint at any point in time implies that the agent will also be above it in the immediate future. Now, when $a=\underline{a}$, the boundary condition implies that $s_j(\underline{a})=y_j+r\underline{a}_t-c_j(\underline{a})\geq0$ and the first order condition $u'(c_j(a_t))=v'_j(a_t)$ still holds so $v'_j(a_t)=u'(c_j(a_t))\geq u'(y_j+r\underline{a}_t)$. Therefore, the boundary condition is equivalent to
\begin{equation}\label{eqBoundary}
v'_j(a_t)\geq u'(y_j+r\underline{a}_t)
\end{equation}

Now, in order to derive the KF equation we analyze the evolution of wealth. For any individual the individual wealth evolves according to
\begin{equation}
a_t=a_{t+\Delta}-\Delta s_j(a_{t+\Delta})
\end{equation}
And define the CDF $G_j(a,t)=Pr(a_t\leq a,y_t=y_j)$, which satisfies $G_1(\underline{a},t)+G_2(\underline{a},t)=0$ and $\lim_{a\rightarrow a}(G_1(a,t)+G_2(a,t))=1$, and has densities $g_j(a,t)=\partial_a G_j(a,t)$. \\
Now, assume that for the level of wealth consider agents decumulate assets $s_j(a)\leq0$ (the case for accumulating wealth is symmetric), and that agents don't switch income, therefore
\begin{equation}
Pr(a_{t+\Delta}\leq a)=Pr(a_{t}\leq a)+Pr(a\leq a_{t}\leq a-\Delta s_j(a))=Pr(a_{t}\leq  a-\Delta s_j(a))
\end{equation}
where the first term in the equation above represents those agents already belowe $a$ and the second term represents the agents that crossed the threshold from $t$ to $t+\Delta$. Now, taking into account that agents can switch income
\begin{equation}
\begin{split}
&Pr(a_{t+\Delta}\leq a,t_{t+\Delta}=y_j)\\
&=(1-\Delta\lambda_j)Pr(a_{t}\leq  a-\Delta s_j(a),y_t=y_j)+\Delta\lambda_{-j} Pr(a_{t}\leq  a-\Delta s_j(a),y_t=y_{-j})
\end{split}
\end{equation}
Using the definition of $G(.,.)$, substracting $G_j(a,t)$ from both sides, dividing by $\Delta$ and taking $\Delta \rightarrow 0$
\begin{equation}
\partial_tG_j(a,t)=-s_j(a)\partial_aG_j(a,t)-\delta_jG_j(a,t)+\delta_{-j}G_{-j}(a,t)
\end{equation}
Taking derivatves in both sides with respect to $a$ we get the KF equation
\begin{equation}\label{eqKF}
\partial_tg_j(a,t)=-\partial_a[s_j(a) g_j(a,t)]-\delta_jg_j(a,t)+\delta_{-j}g_{-j}(a,t)
\end{equation}

Equations \ref{eqHJB}, \ref{eqS}, \ref{eqC}, \ref{eqBoundary} and \ref{eqKF} fully characterize equilibrium. In a stationary equilibrium the LHS of equation \ref{eqKF} is set to zero (the distribution doesn't change with time) and the rest of equations remain the same

\section{Numerical solution}
In order to solve the HJB equation a finite difference approached is used. An interval in variable $a$ is partitioned and the policy and value functions are approximated in those points (denote the points $a_i$ so that we define $v_{i,j}\equiv v_j(a_i)$). The value function can then be approximated iterating the following equation (which is the HJB equation in \ref{eqHJB})
\begin{equation}\label{eqHJBapp}
\frac{v_{i,j}^{n+1}-v_{i,j}^{n}}{\Delta}+\rho v_{i,j}^{n+1}=u(c_{i,j}^{n})+(v_{i,j}^{n+1})'(z_j+ra_i-c_{i,j}^{n})+\lambda_j(v_{i,-j}^{n+1}-v_{i,j}^{n+1})
\end{equation}
This is an implicit method because equation \ref{eqHJBapp} defines $v_{i,j}^{n+1}$ implicitly. Consumption is defined according to equation \ref{eqC} ($c_{i,j}^n=(u')^{-1}[(v_{i,j}^n)']$). Now, in order to approximate ${v'}_{i,j}^n$ we use a finite difference method, so we define the Forward and Backward difference approximation as
\begin{equation}
v'_{i,j,F}\equiv \frac{v_{i+1,j}-v_{i,j}}{\Delta a}\approx v'_j(a_i)
\end{equation}
\begin{equation}
v'_{i,j,B}\equiv \frac{v_{i-1,j}-v_{i,j}}{\Delta a}\approx v'_j(a_i)
\end{equation}
And the respective definition for savings as
\begin{equation}
s_{i,j,F}=z_j+ra_i-(u')^{-1}(v'_{i,j,F})
\end{equation}
\begin{equation}
s_{i,j,B}=z_j+ra_i-(u')^{-1}(v'_{i,j,B})
\end{equation}
We use one or the other approximation of ($v'(.)$) depending on the sign of the state variable, that is
\begin{equation}
v'_{i,j}=v'_{i,j,F} \bold{1}_{s_{i,j,F}>0}+v'_{i,j,B} \bold{1}_{s_{i,j,F}<0}+\bar{v}'_{i,j} \bold{1}_{s_{i,j,F}\leq0\leq s_{i,j,B}}
\end{equation}
where $\bar{v}'_{i,j}=u'(z_j+ra_i)$. So we can define, for any variable x, $x^{+}=max{x,0}$ and $x^{-}=min{x,0}$. This allows us to write equation \ref{eqHJBapp} as
\begin{equation}\label{eqHJBapp2}
\frac{v_{i,j}^{n+1}-v_{i,j}^{n}}{\Delta}+\rho v_{i,j}^{n+1}=u(c_{i,j}^{n})+\frac{v_{i+1,j}^{n+1}-v_{i,j}^{n+1}}{\Delta a}(s_{i,j,F}^n)^{+}+\frac{v_{i,j}^{n+1}-v_{i-1,j}^{n+1}}{\Delta a}(s_{i,j,B}^n)^{-}+\lambda_j(v_{i,-j}^{n+1}-v_{i,j}^{n+1})
\end{equation}
Defining $x_{i,j}=-\frac{(s_{i,j,B}^n)^{-}}{\Delta a}$, $z_{i,j}=\frac{(s_{i,j,F}^n)^{+}}{\Delta a}$ and $y_{i,j}=-x_{i,j}-z_{i,j}-\lambda_j$ the system of $2\times I$ (where I is the number of points in the partition of $a$) equations defined by \ref{eqHJBapp2} can be written as
\begin{equation}
B^n v^{n+1}=u^n+\frac{1}{\Delta}v^n
\end{equation}
where $B^n=\left(\frac{1}{\Delta}+\rho\right)I-A^n$,

\begin{equation}\nonumber
A^n=
  \begin{bmatrix}
	y_{1,1} & z_{1,1} & 0 & \dots & 0 & \lambda_1 & 0 & 0 & \dots & 0\\
	x_{2,1} & y_{2,1} & z_{2,1} & 0 & \dots & 0 & \lambda_1 & 0 & 0 &\dots\\
	0 & x_{3,1} & y_{3,1} & z_{3,1} & 0 & \dots & 0 & \lambda_1 & 0 & 0 \\
	\vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots \\
	0 & \ddots & \ddots & x_{I,1} & y_{I,1} & 0 & 0 & 0 & 0 & \lambda_1 \\
	\lambda_2 & 0 &0&0&0& y_{1,2} & z_{1,2} & 0 & 0 & 0\\
	0&\lambda_2 & 0 &0&0& x_{2,2}& y_{2,2} & z_{2,2} & 0 & 0\\
	0&0&\lambda_2 & 0 &0&0& x_{3,2}& y_{3,2} & z_{3,2}  & 0\\
	\vdots & \vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots & \ddots \\
	0 & \dots & \dots & 0 & \lambda_2 & 0 & \dots & 0 & x_{I,2} & y_{I,2}
  \end{bmatrix}
\text{,     }
u^n=
  \begin{bmatrix}
	u(c_{1,1}^n)\\
	\vdots\\
	\vdots\\
	u(c_{I,1}^n)\\
	u(c_{1,2}^n)\\
	\vdots\\
	\vdots\\
	u(c_{I,2}^n)
  \end{bmatrix}
\end{equation}
To solve the KF equation in stationary equilibrium we use the same idea to approximate $\partial_a [s_j(a) g_j(a,t)]$ in equation \ref{eqKF}:
\begin{equation}
-\frac{(s_{i,j,F}^n )^{+}g_{i,j}-(s_{i-1,j,F}^n )^{+}g_{i-1,j}}{\Delta a}-\frac{(s_{i+1,j,B}^n )^{-}g_{i+1,j}-(s_{i,j,B}^n )^{-}g_{i,j}}{\Delta a}-g_{i,j}\lambda_j+g_{i,-j}\lambda_{-j}=0
\end{equation}
which becomes $A^{T}g=0$.

\section{Results for the Huggett economy}
The following figures show the results for the Huggett economy with $\rho=0.05$, a CRRA utility function with $\sigma=2$, $y=[0.1, 0.2]$, $\lambda=[0.6,0.5]$ and a interest rate of 0.03. As expected, savings is decreasing in wealth and income, while consumption is increasing in wealth. Figure \ref{figDist} shows the distribution of agents. It is worth noting that there is a high density of agents with low income near the borrowing limit.
\begin{figure}
\center
\includegraphics{HuggettPolicies.png} \caption{Policy functions}
\end{figure}

\begin{figure}
\center
\includegraphics{HuggettDistribution.png} \caption{Distribution}\label{figDist}
\end{figure}

Now, Figure \ref{figDemand} shows the demand curve for bonds for different levels of interest rate. This shows that the function is increasing, so that it crosses any external value of asset supply. In the case of the graph, it is shown that an external supplyof 0 implies an interest rate close to 2\%. Finally, Figure \ref{figShock} shows the response to an unticipated increase in $\lambda_2$. In the long run the interest rate in equilibrium increases, while there is a sharp decrease in the first periods. The stationary distribution shows less agents in the new equilibrium with high income. It can be seen that this is a gradual process.

\begin{figure}
\center
\includegraphics{HuggettSupply.png} \caption{Demand Curve}\label{figDemand}
\end{figure}

\begin{figure}
\center
\includegraphics{HuggettShock.png} \caption{Shock to $\lambda_2$ from 0.5 to 0.9}\label{figShock}
\end{figure}

%delta=100, tol=1e-6 rho=0.05 sigma=2 z=0.1,0.2 lambda=0.6,0.5 r=0.03
%shock lambda2 to 0.9

\section{Model with housing}
In this model agents get utility from consumption ($c_t$) and housing ($h_t$), so that their expected utility is $E_0 \int_0^\infty e^{-\rho t}u(c_t,h_t)dt$. Housing can only be consumed in the set $\{0,[h_{min},\infty]\}$. The budget constraint is $\dot{b}_t+p \dot{h}_t=y_t+rb_t-c_t$. In addition, when buying a house the down payment has to be at least a fraction $1-\theta$ of the value of the house ($-b_t\leq \theta p h_t$). The paper focuses on quasi-linear utilities, so that $u(c,h)=\tilde{u}(c+f(h))\equiv \tilde{u}(x)$. So we can write the numerical problem to solve as
\begin{equation}
\begin{split}
&\rho v_j(a) = max_x \tilde{u}(x)+v'_j(a)(y_j+\tilde{f}(a)+ra-x)+\lambda_j(v_{-j}(a)-v_j(a))\\
&\tilde{f}=\max_{h\in \Gamma(a)}(f(h)-rph)
\end{split}
\end{equation}
where $\Gamma(a)=\{h:ph\leq\phi a\}\cap\{0,[h_{min},\infty]\}$

\section{Results for the model with housing}
Now, the model with housing is shown in Figure \ref{figHPol}. There is a decrease in savings up to the point where it is optimal to save in order to buy a house. When wealth is such that optimal housing is higher than $h_{min}$ savings decrease in order to pay for the house. Consumption is decreasing a big part of the state variable because of the savings necessary to achieve the minimum down payment for $h_{min}$. Finally, Figure \ref{figHDist} shows the distribution of agents. There is bunching in the borrowing constraint and above 2.

%delta=1000, tol=1e-6 rho=0.05 sigma=2 z=0.1,0.135 lambda=0.5,0.6 hmin=2.3 p=1, phi=2 alpha=1/3 eta=0.2 utility of housing η*(max(x-hmin,0))^α - r*p*x  r=0.03

\begin{figure}
\center
\includegraphics{HousingPolicies.png} \caption{Model with housing. Policy functions}\label{figHPol}
\end{figure}

\begin{figure}
\center
\includegraphics{HousingDistribution.png} \caption{Model with housing. Distribution}\label{figHDist}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% --------------------------------------------------------------
%     You don't have to mess with anything below this line.
% --------------------------------------------------------------

\end{document}


\documentclass{beamer}

\DeclareMathOperator*{\argmax}{arg\,max}

\usepackage{beamerthemesplit}
\usepackage{amsmath}
\usepackage{pstricks,pst-node,pst-tree}

\def\Pr{\mbox{\bf \sf P}}
\newcommand{\prob}[1]{{\bf \sf P}(#1)}
\newcommand{\empirprob}[1]{{\bf \sf \tilde P}(#1)}
\newcommand{\modelprob}[2]{{\bf \sf \hat P}_{#1}(#2)}
\newcommand{\condprob}[2]{{\bf \sf P}( #1 \,|\, #2 )}

\title{An Open-Source Hierarchical Phrase-Based Machine Translation System}
\author{Lane Schwartz \\ \texttt{lane@cs.umn.edu}}
\institute{University of Minnesota}

\date{}

\begin{document}

\frame{\titlepage}

\frame{\tableofcontents}

\section{Background}

\frame { \frametitle{Background}

  Translation is one of the oldest problems in computer science. {\\ \ }

  \pause

  \begin{itemize}[<+->]
  \item Rule-based translation
  	{\\ \ }
  	\uncover<+->{\\Requires highly trained bilingual linguists}
  	\uncover<+->{\\And lots and lots of time for them to develop rules}
  	\uncover<+->{\\Hard to extend to new domains}
{\\ \ }
  \item Statistical translation \uncover<+->{$\leftarrow$ We'll use this approach :)}
  \end{itemize}

}

\section{Statistical Methods}

\frame { \frametitle{Parallel Corpora}

Statistical translation requires large parallel texts.

\pause

  \begin{itemize}[<+->]
  \item Corporate documentation
  \item International news organizations
  \item Governments
	\begin{itemize}
	\item United Nations
	\item Canada
	\item European Union \uncover<+->{$\leftarrow$ We'll use this data :)}
	\end{itemize}

  \end{itemize}

}

\frame { \frametitle{Words}

  \begin{itemize}[<+->]
  \item Word-by-word translation
  %{\\ \ }
  \item Word alignments
	\begin{itemize}
	\item Align words by hand
		\uncover<+->{\\tedious and time-consuming}
	\item Automatic alignment
		\uncover<+->{\\uses EM on a parallel corpus; \\see Och \& Ney (2000)}
		\uncover<+->{\\Many researchers use the freely available GIZA++ tool to automatically extract word alignments}
	\end{itemize}
	%{\\ \ }
  \item Word alignments can be used in more sophisticated translation models.
  \end{itemize}

}

\frame { \frametitle{Phrases}
  \begin{itemize}[<+->]
  \item Phrases may work better than words
  \item Phrase-based translation
	\begin{itemize}
	\item Phrase table
	\item Reordering model
	\end{itemize}
  \item Phrases can be automatically extracted from word alignments.
  \end{itemize}
}

\frame { \frametitle{Statistical Models}

\begin{itemize}[<+->]

	\item Traditional noisy-channel approach \\[\baselineskip]
	\uncover<+->{\[ \argmax_{e} \condprob{e}{f} = \argmax_{e} \prob{e,f} \]}
	\uncover<+->{\[ \argmax_{e} \condprob{e}{f} = \argmax_{e} \prob{e} \times \condprob{f}{e} \] \\[\baselineskip]}

	\item Log-linear approach \\[\baselineskip]
	\uncover<+->{\[ weight = \prod_{i}{\phi_{i}^{\lambda_{i}}} \]}

\end{itemize}

}

\frame { \frametitle{Log-linear features}

	So what features should our log-linear model use?  \pause

	\begin{itemize}

		\item<2-> P$_{lm}(e)$
		\item<2-> $\condprob{f}{e}$
		\item<3-> $\condprob{e}{f}$
		\item<3-> $\condprob{f_w}{e_w}$
		\item<3-> $\condprob{e_w}{f_w}$

	\end{itemize}

	\uncover<2-> { Features used in noisy channel approach... \\ }
	\uncover<3-> { ...and other features empirically found to be useful!}

	%\uncover<2-> {
	%	$\alpha$ is a source language phrase. \\
	%	$\gamma$ is a target language phrase.
	%}

}

\section{Hierarchical phrase-based translation}

\frame { \frametitle{Hierarchical phrase-based translation}

  \begin{itemize}
  \item<1-> Phrase-based translation
	\begin{itemize}
	\item Phrase table
	\item Reordering model
	\end{itemize}

  \item<2-> What if we treat translation as a parsing task? \\
  	\uncover<3->{ $\rightarrow$ Phrase table becomes synchronous context free rules \\ }
  	\uncover<4->{ $\rightarrow$ Reordering model becomes implicit in rule applications }
  \end{itemize}

}

\frame { \frametitle{Chiang (2007)}

  Hierarchical phrase-based translation model \pause

  \begin{itemize}[<+->]
  \item Database of synchronous context-free rules
  \item Only two nonterminals!!!
	\begin{itemize}
	\item X \uncover<+->{ Used in extracted grammar rules }
	\item S \uncover<+->{ Allows for serial combination of phrases }
	\end{itemize}

  %\item<2-> What if we treat translation as a parsing task? \\
  	%\uncover<3->{ $\rightarrow$ Phrase table becomes synchronous context free rules \\ }
  	%\uncover<4->{ $\rightarrow$ Reordering model becomes implicit in rule applications }
  \end{itemize}

}

\frame { \frametitle{Our System}

\begin{itemize}[<+->]
	\item Open source implementation of Chiang (2007)
	\item Implemented in Java
	\item Designed to be easily extended
	\item Data structures map onto the hypergraph architecture of Huang \& Chiang (2005)
		\begin{itemize}
  			\item { This allows n-best lists to be easily obtained }
			\item { N-best lists are needed during parameter tuning }
		\end{itemize}
	\item Uses off-the-shelf minimum error rate trainer\\
	      for log-linear parameter training

\end{itemize}

}

\frame { \frametitle{Our System}

	What make this system unique? \pause

	\begin{itemize}[<+->]
		\item There are two other known implementations of a hierarchical phrase-based system
		\item Of the other two...,
			\begin{itemize}
  			\item { CMU SAMT - Open source, but doesn't implement cube pruning algorithm. C++ }
			\item { Chiang's Hiero - Closed source, does implement cube pruning algorithm. Python }
		\end{itemize}
		\item Our system...
			\begin{itemize}
  			\item { Open source}
			\item { Implements cube pruning algorithm. }
			\item { Java }
		\end{itemize}
	\end{itemize}

}

\frame { \frametitle{Our System}

Code available through anonymous svn at {\tt http://sf.net/projects/nlp-parsers} \\[\baselineskip]

Questions? \\[\baselineskip]

{\tt lane@cs.umn.edu}

}

\end{document}