\subsection{Hyper-parameters}
\subsubsection{Description}
The hyper-parameters used in the baseline CNN and his temporal coherence counterpart are presented in table~\ref{tab:hyperparams}.

\begin{table}[h]
\center
\begin{tabular}{@{}lp{8cm}@{}}
\toprule
Hyper-parameters       & Descritption                                                                                \\ \midrule
LR1                    & The learning rate associated with the standard CNN backpropagation stage.                                                        \\
LR2                    & The learning rate associated the backpropagation for two consecutives entries and for the one with two non-consecutives entries. \\
DC                     & The Decreasing constant of the learning rate. \\
Sizes                  & The sizes of the 4 different layers of the neural network.                                                                       \\
Seed                   & The seed of the random number generator. \\
Look-ahead Steps (LAS) & The amount of steps during training that the system will do after the condition                                                  \\
Look-ahead Delay (LAD) & Number of steps before the look-ahead is enabled.                                                                                \\
Mini-batch Size        & The size of the minibatch.                                                                                \\
margin                 & $\delta$ is defined at~\ref{eq:delta}.                                                                                \\ \bottomrule
\end{tabular}
\caption{Description of hyper-parameters.}
\label{tab:hyperparams}
\end{table}

Some values were fixed for simplicity and are shown at table~\ref{tab:hyperparamsvals}. As displayed in this table, LR2 and $\delta$ are not applicable for the baseline CNN but are used for temporal coherence CNN (TC-CNN).

\begin{table}[ht]
\label{tab:hyperparamsvals}
\begin{center}
\begin{tabular}{lll}

Hyper-parameters & CNN & TC-CNN \\
\midrule
LR2 & N/A & Variable \\

LAS & 5 & 10 \\

LAD & 0 & 7 \\

$\delta$ & N/A & 1 \\
\bottomrule
\end{tabular}
\caption{Predefined values of hyper-parameters.}
\end{center}
\end{table}

\subsubsection{Selection}
The exploration of the hyper-parameters was done iteratively. At the beginning, they were randomly attributed within a manually created set. Based on the success of specific sets, another subset was manually generated using the most promising hyper-parameters and using variations around those hyper-parameters thus converging toward a better solution. This procedure was repeated until an acceptable performance was attained. This procedure would benefit from more standardized methods.


\documentclass{article}

\usepackage{vtreport}
\usepackage{amsmath} % Advanced math typesetting
\usepackage[utf8]{inputenc} % Unicode support (Umlauts etc.)
\usepackage{hyperref} % Add a link to your document
\usepackage{graphicx} % Add pictures to your document
\usepackage{listings} % Source code formatting and highlighting

\title{Report Title}
\date{2019-3-13}
\author{Ian Boll}

\begin{document}
    \maketitle

    % basic text is entered like this
    Hello, World!

    $\int_{a}^{b} e^{2x} dx=\frac{1}{2}e^{2x}$

    \section{Section Title}
    \subsection{Subsection Title}
    \subsubsection{Subsubsection Title}

    \paragraph{Paragraph}
    This is a paragraph.
    \subparagraph{Subparagraph}
    This is a subparagraph.

    \section{Lists}
    \subsection{Unordered}
    \begin{itemize}
        \item One
        \item Two
        \item Three,
            with continuation
    \end{itemize}
    \subsection{Ordered}
    \begin{enumerate}
        \item First
        \item Second
        \item Third,
            with continuation
    \end{enumerate}
    \subsection{Nested}
    \begin{enumerate}
        \item First
        \item Second, with details
        \begin{itemize}
            \item Detail 1
            \item Detail 2
        \end{itemize}
        \item Third
    \end{enumerate}

    \newpage
    Plain text on a new page.
\end{document}


%%% Copyright 2017 International Business Machines Corporation
\documentclass[11pt]{article} % use larger type; default would be 10pt

\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
\usepackage[T1]{fontenc}

%%% PAGE DIMENSIONS
\usepackage[top=1.5in,bottom=1in,right=1in,left=1in,headheight=90pt,headsep=1cm]{geometry} % to change the page dimensions
\geometry{a4paper} % or letterpaper (US) or a5paper or....
 \geometry{margin=0.7in} % for example, change the margins to 2 inches all round

\usepackage{graphicx} % support the \includegraphics command and options

 \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent

%%% PACKAGES
\usepackage{amsmath}
\usepackage{cases}
\usepackage{ulem}
\usepackage{listings}
\usepackage{algorithm2e}

\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0.4pt} % customise the layout...
\lhead{}\chead{\footnotesize \textit{IBM}}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}

%%% SECTION TITLE APPEARANCE
\usepackage{sectsty}

\newenvironment{aside}
  {\begin{mdframed}[style=0,%
      leftline=false,rightline=false,leftmargin=2em,rightmargin=2em,%
          innerleftmargin=0pt,innerrightmargin=0pt,linewidth=0.75pt,%
      skipabove=7pt,skipbelow=7pt]\small}
  {\end{mdframed}}

%COLOURING
\usepackage{color}
\newcommand{\new}{\textcolor{red}}
%\input{rgb}

%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC

\title{Updating $\left(\uuline{A}^T \uuline{A}\right)^{-1}$ with the Addition and Removals of Columns in $\uuline{A}$}
\author{Cecilia Aas}
\date{October, 2015}

\def\layersep{2.5cm}

\begin{document}
\lstset{language=C++,
           commentstyle=\textcolor[rgb]{0.00,0.66,0.33},
           keywordstyle=\textcolor[rgb]{0.00,0.00,1.00},
           basicstyle=\footnotesize\ttfamily,
           frame=lines,
           framexleftmargin=2mm,
           numbers=left,
           numberstyle=\footnotesize,
           stepnumber=1,
           numbersep=1pt}
\maketitle
\section{Overview}
The algorithm aims to solve the following problem:\\

\begin{enumerate}
\item We have a matrix $\uuline{A}$ and we have calculated the inverse $\left(\uuline{A}^T\uuline{A}\right)^{-1}$.
\item We now add or remove a column $\uline{v}$ to the matrix $\uuline{A}$, forming matrix $\uuline{A}'$.
\item We want to calculate $\left(\uuline{A'}^T \uuline{A'}\right)^{-1}$ given our knowledge of $\left(\uuline{A}^T\uuline{A}\right)^{-1}$, instead of from scratch.
\end{enumerate}

\section{Background Theory}

\subsection{Matrix-Inversion Lemma}
It is known that for correctly-sized matrices $\uuline{A}$, $\uuline{U}$, $\uuline{C}$ and $\uuline{V}$ ,
\begin{equation}
\left(\uuline{A} + \uuline{U}\uuline{C}\uuline{V}\right)^{-1} = \uuline{A}^{-1} - \uuline{A}^{-1}\uuline{U} \left(\uuline{C}^{-1} + \uuline{V} \uuline{A}^{-1} \uuline{U}\right)^{-1}\uuline{V} \uuline{A}^{-1} \; .
\end{equation}

For the special case of adding the outer product of two column vectors $\uline{u}$ an $\uline{v}$, we obtain
\begin{equation}
\left(\uuline{A} + \uline{u}\uuline{v} \right)^{-1} = \uuline{A}^{-1} - c\uuline{A}^{-1}\uline{u} \uline{v}^T \uuline{A}^{-1} \; ,
\end{equation}
where
\begin{equation}
c = \frac{1}{1 + \uline{u}^T \uuline{A}^{-1}\uline{v}} \; .
\end{equation}

\subsection{Inverting a Partitioned Matrix}
The inverse of a partitioned matrix can be expressed as
\begin{equation}
\left[\begin{array}{cc} \uuline{A_{11}} & \uuline{A_{12}}\\ \uuline{A_{21}} & \uuline{A_{22}} \end{array} \right]^{-1} = \left[\begin{array}{cc} \uuline{F_{11}^{-1}} & -\uuline{F_{11}^{-1}}\uuline{A_{12}}\uuline{A_{22}^{-1}}\\ -\uuline{A_{22}^{-1}}\uuline{A_{21}}\uuline{F_{11}^{-1}} & \uuline{F_{22}^{-1}} \end{array} \right]^{-1} \; ,
\end{equation}
where
\begin{eqnarray}
\uuline{F_{11}^{-1}} & = & \uuline{A_{11}^{-1}} + \uuline{A_{11}^{-1}} \uuline{A_{12}} \uuline{F_{22}^{-1}} \uuline{A_{21}} \uuline{A_{11}^{-1}} \; ,\\
\uuline{F_{22}^{-1}} & = & \uuline{A_{22}^{-1}} + \uuline{A_{22}^{-1}} \uuline{A_{21}} \uuline{F_{11}^{-1}} \uuline{A_{12}} \uuline{A_{22}^{-1}} \; .
\end{eqnarray}
\clearpage

\section{Algorithms for Adding and Removing Columns}
\begin{algorithm}
\hrulefill \\
Inputs: original matrix $\uuline{A}$, inverse $\uuline{B} = \left(\uuline{A}^T \uuline{A}\right)^{-1}$, column vector $\uline{v}$, column index $j$\\
Outputs: updated inverse $\uuline{B}' = \left(\uuline{A'}^T \uuline{A'}\right)^{-1}$\\
Procedure:
\begin{enumerate}
\item $\uline{u_1} \leftarrow \uuline{A}^T \uline{v}$
\item $\uline{u_2} \leftarrow \uuline{B} \uline{u_1}$
\item $d \leftarrow \left( \uline{v}^T\uline{v} - \uline{u_1}^T\uline{u_2} \right)^{-1}$
\item $\uline{u_3} \leftarrow d \uline{u_2}$
\item $\uuline{Q} \leftarrow \uuline{B} + d\uline{u_2}\uline{u_2}^T$
\item $\uuline{B}' \leftarrow \left[ \begin{array}{cc} \uuline{Q} & -\uline{u_3}\\ -\uline{u_3}^T & d \\\end{array} \right]$
\item Permute the last row of $\uuline{B}'$ to row $j$, and permute the last column of $\uuline{B}'$ to column $j$.
\end{enumerate}
\hrulefill
\caption{Algorithm for updating $\left(\uuline{A}^T\uuline{A}\right)^{-1}$ upon adding a column $\uline{v}$ to $\uuline{A}$ at column index $j$.}
\end{algorithm}

\begin{algorithm}
\hrulefill \\
Inputs: original matrix $\uuline{A}$, inverse $\uuline{B} = \left(\uuline{A}^T \uuline{A}\right)^{-1}$, column index $j$\\
Outputs: updated inverse $\uuline{B}' = \left(\uuline{A'}^T \uuline{A'}\right)^{-1}$\\
Procedure:
\begin{enumerate}
\item Permute row $j$ to the last row of $\uuline{B}'$, and permute column $j$ to the last column of $\uuline{B}$.
\item $\uuline{Q} \leftarrow \uuline{B_{1:n-1, 1:n-1}}$ (i.e., remove last row and last column from $\uuline{B}$)
\item $d \leftarrow B_{nn}$
\item $\uline{u_3} \leftarrow\uuline{B_{1:n-1, n}}$
\item $\uline{u_2} \leftarrow \frac{1}{d} \uline{u_3}$
\item $\uuline{B}' \leftarrow \uuline{Q} - d\uline{u_2} \uline{u_2}^T$
\end{enumerate}
\hrulefill
\caption{Algorithm for updating $\left(\uuline{A}^T\uuline{A}\right)^{-1}$ upon removing a column $\uline{v}$ from $\uuline{A}$ at column index $j$.}
\end{algorithm}

\end{document}


\documentclass{memoir}
\usepackage{notestemplate}

%\logo{~/School-Work/Auxiliary-Files/resources/png/logo.png}
%\institute{Rice University}
%\faculty{Faculty of Whatever Sciences}
%\department{Department of Mathematics}
%\title{Class Notes}
%\subtitle{Based on MATH xxx}
%\author{\textit{Author}\\Gabriel \textsc{Gress}}
%\supervisor{Linus \textsc{Torvalds}}
%\context{Well, I was bored...}
%\date{\today}

%\makeindex

\begin{document}

% \maketitle

% Notes taken on

Recall the fundamental theorem of finitely generated abelian groups.

\begin{thm}[Structure Theorem for Abelian Groups]
	A finitely generated abelian group V is a direct sum of cyclic subgroups \(C_{d_1},\ldots,C_{d_k}\) and a free abelian group \(L\):
	\begin{align*}
		V = C_{d_1}\bigoplus \ldots \bigoplus C_{d_k}\bigoplus L,
	\end{align*}
	where the order \(d_i\) of \(C_{d_i}\) is greater than one, and \(d_i \mid d_{i+1}\) for \(i<k\).
\end{thm}

\begin{thm}[Structure Theorem (Alternate Form)]
	Every finite abelian group is a direct sum of cyclic groups of prime power orders.
\end{thm}
\begin{thm}[Uniqueness for Structure Theorem]
	Suppose that a finite abelian group \(V\) is a direct sum of cyclic groups of prime power orders \(d_j = p_j^{r_k}\). The integers \(d_j\) are uniquely determined by the group \(V\).
\end{thm}

\subsection{Analogues for Polynomial Rings and Linear Operators}
\label{sub:analogues_for_polynomial_rings_and_linear_operators}

\begin{thm}
	Let \(R = F[t]\) be a polynomial ring in one variable over a field \(F\) and let \(A\) be an \(m\times n\) \(R\)-matrix. There are products \(Q,P\) of elementary \(R\)-matrices such that
	\begin{align*}
		A' = Q^{-1}AP
	\end{align*}
	is diagonal, each non-zero diagonal entry \(d_i\) of \(A'\) is a monic polynmial, and \(d_1\mid \ldots\mid d_k\).
\end{thm}

\begin{rmrk}
Let \(M\) be a free cyclic \(R\)-module. Then there is a surjective homomorphism \(\varphi:R\to M\) defined by \(r\mapsto rv\), where \(v\) is the singular generating element in \(M\). The kernel of \(\varphi\) is a submodule of \(R\) and hence an ideal \(I \triangleleft R\). Therefore, \(M\) is isomorphic to the \(R\)-module \(R / I\). When \(R = F[t]\), the ideal \(I\) will be principal.
\end{rmrk}

\begin{thm}[Structure Theorem for Modules over Polynomial Rings]
	Let \(R = F[t]\) be the ring of polynomials in one variable with coefficients in a field \(F\). Let \(V\) be a finitely generated module over \(R\). Then V is a direct sum of cyclic modules \(C_1,C_2,\ldots,C_k\) and a free module \(L\), where \(C_i\) is isomorphic to \(R / (d_i)\), the elements \(d_1,\ldots,d_k\) are monic polynomials of positive degree and satisfy both (but not simultaneously)
\begin{itemize}
	\item \(d_1\mid d_2\mid \ldots\mid d_k\)
	\item Each \(d_i\) is a power of a monic irreducible polynomial
\end{itemize}
\end{thm}

% \printindex
\end{document}


\documentclass[10pt] {article}

\usepackage{cite}

\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{psfrag}
\usepackage{amsmath}
\usepackage{color}

\newcommand{\comment}[1]{ \marginpar{{\scriptsize \color{red} #1 }}}

\begin{document}
\title{Applying MMS in Wasatch Using Taylor Vortex Flow Analytical Solution and Corresponding Convergence Studies}

\author{Amir Biglari\\
University of Utah}
\maketitle

\section{Introduction}

In this document, at first, we are going to show how we have used method of manufactured solution (MMS) in Wasatch using two dimensional Taylor Vortex flow by detail. Afterwards, we will explain what has been done in order to examine the grid convergence and temporal convergence of this solutions.

This can be useful for the future users who want to use this MMS or repeat some thing similar to this work and do the convergence study. They can easily repeat all of these works after reviewing this document.

\section{Taylor Vortex Flow}

The solution that we have used in the method of manufactured solution in order to verifying the the consistency of the Wasatch solvers with the mathematical models and checking the order of convergence.

The Taylor Vortex flow actually is a fluid between two cylinders which are rotating and causes the fluid to have some vortices in radial direction. The geometry of this system is like

The reason that we have used this flow is that it doesn't have any specified boundary and there is no need to specify any boundary conditions in order to solve this flow as long as the boundary conditions has not been implied in Wasatch yet.

The analytical transient solution of two dimensional Taylor Vortex flow for velocity in $x$ direction, $u$, velocity in $y$ direction , $v$, and pressure, $p$, are obtained from the following simplified form of the momentum equation:

$$\frac{\partial\textrm{u}}{\partial t}+\textrm{u}.\nabla(\textrm{u})=-\nabla p+\nu\nabla^{2}\textrm{u}$$\\
Where $\textrm{u}=[u,v]^T$, and they are as follows \cite{rjm_diss}:

$$u(x,y,t)=1-A\cos(x-t)\sin(y-t)\exp(-2\nu t)$$

$$v(x,y,t)=1+A\sin(x-t)\cos(y-t)\exp(-2\nu t)$$

$$p(x,y,t)=\frac{-A^{2}}{4}\left[\cos(2(x-t))+\cos(2(y-t))\right]\exp(-4\nu t)$$\\
Where $A$ is the amplitude of the function and $\nu$ is the kinematic viscosity of the fluid.

\section{How to Apply MMS in Wasatch}

In this work we have used analytical solution of velocity in $x$ and $y$ direction as the initial conditions for velocity. The amplitude is assumed to be 4 and the kinematic viscosity is assumed to be 0.1. You should be careful to enter exactly the same values for amplitude and kinematic viscosity in all of the equation to be consistent with each other. Also, the diffusive constant that you should use in the diffusive flux expressions should be equal to the value of this kinematic viscosity as long as they are representing the same thing.

For the source terms we have used analytical solution for pressure. Actually, we put the source term for velocity in $x$ and $y$ directions to be equal to $\frac{\partial p}{\partial x}$ and $\frac{\partial p}{\partial y}$ respectively.

$$\frac{\partial p}{\partial x}=\frac{A^{2}}{2}\sin(2(x-t))\exp(-4\nu t)$$

$$\frac{\partial p}{\partial y}=\frac{A^{2}}{2}\sin(2(y-t))\exp(-4\nu t)$$

For the Convective terms in the transport equation we have two options. First is to consider the analytical solution for velocities directly as the advecting velocities, and the second option is to put the velocity that we are solving for implicitly as the advecting velocity. With the former we will get the exact solution profile for velocities with small errors. However, with the latter we will have growing errors in projecting velocity profiles as we go trough time, which can be because of the exact solution of pressure that we are using for source terms that can cause the solution to act unusual.

There are three things which has been done before creating the input file:

\begin{itemize}
\item
We need to create expressions for the velocities and source terms (which are basically pressure gradients). These expressions have been created in ``uintah/src/CCA/Components/Wasatch/Expressions/MMS/TaylorVortex.h" with template variables and they can be accessible from ``TaylorVortexMMS" tab.
\item
We have to introduce these expressions in\\``uintah/src/CCA/Components/Wasatch/Expressions/BasicExprBuilder.cc" and parse their independent variable apropriately over ther in order to be able to build these expressions specifically for Taylor Vortex MMS. You can find all of these works in the pointed location.
\item
The last thing is to specify the specifications of these expressions in\\``uintah/src/StandAlone/inputs/UPS$\textunderscore$SPEC/wasatch$\textunderscore$spec.xml" which has been already implemented over there for the so called expressions.
\end{itemize}

\section{Results From MMS in Wasatch}

Here you can see the pseudocolor profiles of velocity in $x$ direction at different times in Fig.~\ref{fig:velx}.

\begin{figure*}[]
\centering
  \hfill
  \subfigure[]{
  \includegraphics[width=2.27in]{t_0.png}
  \label{fig:vxt1}
  }
  \hfill
  \subfigure[]{
  \includegraphics[width=2.27in]{t_1_5.png}
  \label{fig:vxt2}
  }
  \hfill
  \subfigure[]{
  \includegraphics[width=2.27in]{t_3_2.png}
  \label{fig:vxt3}
  }
  \hfill
  \subfigure[]{
  \includegraphics[width=2.27in]{t_5.png}
  \label{fig:vxt4}
  }
  \hfill
  \caption{\label{fig:velx} Pseudocolor profiles of velocity in $x$ direction at different snapshots of time \subref{fig:vxt1} t=0.0 s \subref{fig:vxt2} t=1.5 s \subref{fig:vxt3} t=3.2 s \subref{fig:vxt4} t=5.0 s}
\end{figure*}

As you can see, if we go forward in time our solution for velocity in x direction will be unstable and in longer times the profile looks like a turbulent flow which is not right for Taylor Vortex flow. As we said this can be because of inconsistency between our solution and pressure analytical solution that we use from the beginning.

\section{How to Do The Convergence Studies}

In this work we have done two kinds of convergence studies, grid convergence study and temporal convergence study. We know that our spatial accuracy is second order and our temporal accuracy is first order accurate. So, we are going to check the validity of these two.

In order to do the grid convergence study we looked at the four different grid resolutions for our domain, 50X50, 100X100, 200X200 and 400X400, and we chose 0.001, 0.0005, 0.00025 and 0.000125 respectively for their time step. However, we just looked at the results after the first time step. This is in  order to neglecting the temporal accuracy in the explicit solvers. Because, those terms will be calculated in the previous time step, therefore, in all of our cases they will be calculated at time zero. So, because of using the same time for these terms we don't let the time accuracy to influence our results for grid convergence study.

Note that we have defined the variables that we want to study, in the input file in order to be saved, like VelX, VelY, XXVOL etc.

After running each case we need to follow these tasks in order to save the outputs in an appropriate way:

\begin{itemize}
\item
At first we have to extract the variables that we have defined in the input file. For doing this we use $lineextract$ method which is already in\\``uintah/build/StandAlone/tools/extractors''. Here you can see one example of using this method inorder to extract variables after running 50X50 case:

./lineextract -v VelY\_rhs -timestep 1 -istart 0 0 0 -iend 50 50 0 -uda ../../wasatch\_test.uda

Here you should put the name of the variable that you are looking for after the -v, after -timestep you specify your timestep and after -istart and iend you need to put the starting point of the domain that you are looking for and the end point. Here we just want to look at a plane because it is a two dimensional problem. After -uda you have to specify the address of your output ``.uda" file. You can also write only ``./lineextract" to see the help for this method.
\item
When you do the lineextract, the results will be appear in four long columns.The first three of them are just the node indices. So, in order to store them in a more applicable way at first we copy and paste this long column in a text file and we name it ``a.txt", then we use following lines of codes in MATLAB for example for the velocity in $y$ direction (VelY):

load a.txt\\
for i=1:50\\
b(:,i)=a((a(:,2)==i-1),4);\\
end\\
VelY50=b';\\
clear ans a i b

\item
We should do the same thing and extract velocity in $x$ direction. Also we need the location of x-staggered volumes and y staggered volumes which means (XXVOL, YXVOL, XYVOL, YYVOL).

\end{itemize}

We have to do all of this for all of the grid resolutions that we have and store the results somewhere with specific name to recognize. Then we can calculate the analytical velocities from the analytical solution that we have and look at the second norm of the difference between those velocities and our output velocities as the error.

Now if we plot the log of error vs the log of grid resolution ($\Delta$x) and compare it with the second and first order accurate results, we can see our grid convergence order os accuracy. Here you can see a sample code in MATLAB in this regard:\\
\\
t=0.001;\\
u=1-4*cos(XXVOL50-t).*sin(YXVOL50-t)*exp(-2*0.1*t);\\
err(1)=norm(u-VelX50);\\
t=0.0005;\\
u=1-4*cos(XXVOL100-t).*sin(YXVOL100-t)*exp(-2*0.1*t);\\
err(2)=norm(u-VelX100);\\
t=0.00025;\\
u=1-4*cos(XXVOL200-t).*sin(YXVOL200-t)*exp(-2*0.1*t);\\
err(3)=norm(u-VelX200);\\
t=0.000125;\\
u=1-4*cos(XXVOL400-t).*sin(YXVOL400-t)*exp(-2*0.1*t);\\
err(4)=norm(u-VelX400);\\
dx=[2*pi/50,2*pi/100,2*pi/200,2*pi/400];\\
O1=[err(1),err(1)/2,err(1)/4,err(1)/8];\\
O2=[err(1),err(1)/4,err(1)/16,err(1)/64];\\
plot(log(dx),log(err),'.r');\\
hold\\
plot(log(dx),log(O1),'.b');\\
plot(log(dx),log(O2),'.g');\\

For doing temporal convergence study you can follow the same tasks with small differences. Here we have to consider a specific point in time in order to look at and compare the errors in that time. In this work we chose 0.1 second as our reference point in time. So, we should extract for the appropriate time step in each case.

At the end instead of the log of grid resolution we should plot with respect to the log of time step.

\section{Results From Convergence Studies}
Here you can see the convergence studies results for velocity in $x$ and $y$ direction where we have compared our actual convergence with second and first accurate results.

\begin{figure*}[h]
\centering
  \hfill
  \subfigure[]{
  \includegraphics[width=2.27in]{grid_conv_velx_dx.pdf}
  \label{fig:vx_x}
  }
  \hfill
  \subfigure[]{
  \includegraphics[width=2.27in]{grid_conv_vely_dx.pdf}
  \label{fig:vy_x}
  }
  \hfill
  \subfigure[]{
  \includegraphics[width=2.27in]{grid_conv_velx_dt.pdf}
  \label{fig:vx_t}
  }
  \hfill
  \subfigure[]{
  \includegraphics[width=2.27in]{grid_conv_vely_dt.pdf}
  \label{fig:vy_t}
  }
  \hfill
  \caption{\label{fig:conv} Convergence study of velocity in $x$ and $y$ directions \subref{fig:vx_x} Grid convergence of VelX \subref{fig:vy_x} Grid convergence of VelY \subref{fig:vx_t} Temporal convergence of VelX \subref{fig:vy_t} Temporal convergence of VelY}
\end{figure*}

Here you can see that temporal convergence is first order accurate and grid convergence is second order accurate as we were expecting.
\clearpage
\bibliographystyle{unsrt}
\bibliography{Wasatch_MMS}

 \end{document}


\chapter{Conclusion} \label{chapter:Conclusion}
To conclude the presented work, a brief summary of the results as well as an outlook to future research is provided in the following.

\section{Summary}
In the scope of the Interdisciplinary Project on the topic \textit{Leads and Lags of Corporate Bonds and Stocks}, a data extraction tool tailored to the interface of Refinitiv Datastream has been developed. It allows the user to conveniently enter request details for the desired financial data and to download it with significantly lesser overhead than manually via request tables. To prepare the downloaded data for future usage, a comprehensive formatting and cleaning procedure has been developed and documented. In order to make the extracted bond data comparable with equities, a matching algorithm based on the fuzzy string matching and the CUSIP-6 approaches has been derived, and can be extended to further use cases. Finally, a brief statistical analysis of the extracted data, in particular of calculated corporate bond returns has been conducted, and found to be in-line with widely accepted assumptions of the underlying statistical distributions. A basic analysis of the lead and lag relationships between corporate bond and stock returns has produced statistically significant results, according to which stock returns are faster in incorporating new information, and thus predict future corporate bond returns in the case of high-yield bonds.

\section{Outlook}
While the bond and equity data extracted from Datastream is of relatively high quality, it could still benefit from a cross-check with corresponding data samples from other financial data providers, such as e.g. Bloomberg or Markit. Both for this purpose, and to further improve the existing bond-stock matching, it is recommended to estimate automated download potential for other financial data sources. A notable mention would be for example the Bloomberg Python API and its likes. For the matching procedure specifically, it would make sense to search for and evaluate additional unique company identifiers to make key-based matching possible for the entire dataset.

Concerning the statistical analysis part, I suggest to conduct a more complex and intensive series of regression analyses to extend the existing lead and lag relationship results. The returns for the regression could be prepared portfolio-wise and the model chosen to be a non-linear one to improve on the current $r^2$ statistic by reducing variance that is currently not induced by the independent variable. If desired to go a step further, a neural network approach with 2 to 5 hidden layers could be tried to fit the prediction model more tightly. The need for such an extensive approach should be analyzed thoroughly though, as there might be too few learnable features, which can cause such a complex model to overfit. Finally, the calculated regression model could be tested in real life on newly incoming bond data over a one or more years period to estimate its practical usability for the most reliable bond classes and regions.


\clearpage
\phantomsection
\addcontentsline{toc}{subsection}{NOT}
\label{insn:not}
\subsection*{NOT: negate a value}

\subsubsection*{Format}

\textrm{NOT \%rd, \%r1}

\begin{center}
\begin{bytefield}[endianness=big,bitformatting=\scriptsize]{32}
\bitheader{0,7,8,15,16,23,24,31} \\
\bitbox{8}{0x0C}
\bitbox{8}{r1}
\bitbox{8}{r2}
\bitbox{8}{rd}
\end{bytefield}
\end{center}

\subsubsection*{Description}

The \instruction{not} instruction negates the value found in
\registerop{r1} and places the result into \registerop{rd}.
\subsubsection*{Pseudocode}

\begin{verbatim}
%rd = ~%r1
\end{verbatim}

\subsubsection*{Constraints}

\subsubsection*{Failure modes}

This instruction has no run-time failure modes beyond its constraints.


\section*{Appendix}

\renewcommand\thesubsection{\Alph{subsection}}

\subsection{Permutations by ARX}
\label{ssec:permarx}

The code below shows how to generate arbitrary permutations by solely ARX primitives.
This code is written in Python3 syntax, but is functionally equivalent to any other
programming languages.

\begin{figure}[h!]
\lstinputlisting[
    language=Python,
    %caption={Python program of permutations by ARX},
    %label={lst:perm-py}
]{permutation.py}
\vspace{-5mm}
\end{figure}

%\begin{figure}[t]
%\begin{center}
%\fbox{\rule{0pt}{2in} \rule{0.9\linewidth}{0pt}}
%   %\includegraphics[width=0.8\linewidth]{egfigure.eps}
%\end{center}
%   \caption{Example of caption.  It is set in Roman so that mathematics
%   (always set in Roman: $B \sin A = A \sin B$) may be included without an
%   ugly clash.}
%\label{fig:long}
%\label{fig:onecol}
%\end{figure}
%
%\begin{figure*}
%\begin{center}
%\fbox{\rule{0pt}{2in} \rule{.9\linewidth}{0pt}}
%\end{center}
%   \caption{Example of a short caption, which should be centered.}
%\label{fig:short}
%\end{figure*}


    \filetitle{eval}{Evaluate posterior density at specified points}{poster/eval}

	\paragraph{Syntax}\label{syntax}

\begin{verbatim}
[X,L,PP,SrfP,FrfP] = eval(Pos)
[X,L,PP,SrfP,FrfP] = eval(Pos,P)
\end{verbatim}

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

\begin{itemize}
\item
  \texttt{Pos} {[} poster {]} - Posterior object returned by the
  \href{model/estimate}{\texttt{model/estimate}} function.
\item
  \texttt{P} {[} struct {]} - Struct with parameter values at which the
  posterior density will be evaluated; if \texttt{P} is not specified,
  the posterior density is evaluated at the point of the estimated mode.
\end{itemize}

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

\begin{itemize}
\item
  \texttt{X} {[} numeric {]} - The value of log posterior density
  evaluated at \texttt{P}; N.B. the returned value is log posterior, and
  not minus log posterior.
\item
  \texttt{L} {[} numeric {]} - Contribution of data likelihood to log
  posterior.
\item
  \texttt{PP} {[} numeric {]} - Contribution of parameter priors to log
  posterior.
\item
  \texttt{SrfP} {[} numeric {]} - Contribution of shock response
  function priors to log posterior.
\item
  \texttt{FrfP} {[} numeric {]} - Contribution of frequency response
  function priors to log posterior.
\end{itemize}

\paragraph{Description}\label{description}

The total log posterior consists, in general, of the four contributions
listed above:

\begin{verbatim}
X = L + PP + SrfP + FrfP.
\end{verbatim}

\paragraph{Example}\label{example}


\section{Experiment}

\begin{frame}
	\frametitle{Environment}
	Experiments on
	\begin{itemize}
		\setlength\itemsep{1em}
		\item
			Intel Xeon E5-2620 v3
			\begin{itemize}
				\setlength\itemsep{1em}
				\item
					2.4 Ghz processor, hyper-threading, and each
					processor has six cores.
				\item
					384 KB of L1 cache, 1536 KB of L2 cache, and 15 MB
					of shared L3 cache.
			\end{itemize}
		\item
			Ubuntu 14.04
		\item
			C++ and OpenMP \\
			Using gcc with {\tt -O2} and {\tt -fopenmp} flag.
	\end{itemize}
\end{frame}

\subsection{Blocked and Unblocked Sparse Table}
\begin{frame}
    \frametitle{Blocked and Unblocked Sparse Table}
    Compare the performance of {\em two} data structures for supporting
	parallel range maximum query.

	\begin{itemize}
		\item
			{\em Unblocked} sparse table ({\sc ST})
		\item
			{\em Blocked} sparse table ({\sc BST})
	\end{itemize}
	\vspace{1em}
	The experiments test the cases of all possible query range sizes,
	and build only the {\em necessary} blocks before answering the
	queries.
\end{frame}

\begin{frame}
	Blocked sparse table is $1.4$ times faster than unblocked sparse
	table when $N$ reaches $100000$.
	\begin{center}
	\scalebox{0.65} { \begin{minipage}{1.53\textwidth}
			\input{\TablePath/tlb-CORMQ.tex}
			\end{minipage}
		}
	\end{center}
\end{frame}

\subsection{Incremental Suffix Maximum Query}
\begin{withoutheadline}
\begin{frame}
    \frametitle{Incremental Suffix Maximum Query}
    Compare the performance of {\em four} data structures for supporting
	incremental suffix maximum query only.

    \begin{description}
    	\setlength\itemsep{1em}
    	\item[{Disjoint set}] \hfill \\
    		described earlier
    	\item[{Sparse table}] \hfill \\
    		described earlier
    	\item[{Rightmost-pops} encoding sparse table] \hfill \\
    		It has an amortized insertion time $O(1)$ and query time
			$O(s)$, where $s$ is the size of the block and is set to
			$16$ in the experiments.
    	\item[{LCA} table sparse table]  \hfill \\
    		It has $O(1)$ for both amortized insertion time and the
			query time.
    \end{description}
\end{frame}
\end{withoutheadline}

\begin{frame}
	When $n$ is greater than $10^7$, the rightmost-pops encoding sparse
	table runs $1.8$ times faster than the disjoint set, and runs up to
	$1.5$ times faster than the LCA table.
	\begin{center}
	\scalebox{0.7} { \begin{minipage}{1.3\textwidth}
			\begin{figure}
			  \centering
			  \includegraphics[width=\linewidth]{\GraphicPath/fig-ISMQ.pdf}
			  \caption{The performance of the different data structures for
			    supporting incremental suffix maximum query on an E5-2620 server}
			  \label{fig:fig-ISMQcmp}
			\end{figure}
			\end{minipage}
		}
	\end{center}
\end{frame}

\begin{withoutheadline}
\begin{frame}
	\frametitle{More Complex Scenario}
	We set the number of the queries to be {\em ten} times of the number
	of insertions to show that LCA table sparse table has better
	performance than the rightmost-pops encoding one.

	\begin{description}
		\item[$p$]
			the probability of inserting a larger next element,
		\item[$q$]
			the probability of inserting a zero, and
		\item[$L$]
			the maximum interval being queried.
	\end{description}
	\begin{center}
	\scalebox{0.65} { \begin{minipage}{1.53\textwidth}
			\input{\TablePath/tlb-ISMQcmp-new.tex}
			\end{minipage}
		}
	\end{center}
\end{frame}
\end{withoutheadline}

\subsection{Variable Gapped Longest Common Subsequence}

\begin{withoutheadline}
\begin{frame}
    \frametitle{Variable Gapped Longest Common Subsequence}
	Four combinations of data structures in solving the VGLCS problem
	and evaluated their performance.

	\begin{description}
		\setlength\itemsep{0.5em}
		\item[Peng's algorithm] \hfill \\
			uses disjoint set on {\em both} the first stage and second stage.
		\item[{\sc DS-ST}] \hfill \\
			uses disjoint set in the first stage and standard sparse table in the
			second stage.
		\item[{\sc DS-BST}] \hfill \\
			uses disjoint set in the first stage and rightmost-pops
			encoding sparse table in the second stage.
		\item[{\sc BST2}] \hfill \\
			uses rightmost-pops encoding sparse table in both first and
			second stage.
	\end{description}
\end{frame}
\end{withoutheadline}

\begin{frame}
	\begin{center}
		\scalebox{0.9} { \begin{minipage}{\textwidth}
			\begin{figure}
			  \centering
			  \includegraphics[width=0.9\linewidth]{\GraphicPath/fig-parallel-n.pdf}
			  \label{fig:fig-parallel}
			  \caption{
			  	The execution time result of our parallel
			    implementations on an E5-2620 server with 6 cores and
			    hyper-threading}
			\end{figure}
			\end{minipage}
		}
	\end{center}
\end{frame}

\begin{frame}
	\begin{center}
		\scalebox{0.9} { \begin{minipage}{\textwidth}
			\begin{figure}
			  \centering
			  \includegraphics[width=0.9\linewidth]{\GraphicPath/fig-parallel-p.pdf}
			  \label{fig:fig-parallel-scala}
			  \caption{
			  	The scalability result of our parallel implementations
			    on an E5-2620 server with 6 cores and hyper-threading}
			\end{figure}
			\end{minipage}
		}
	\end{center}
\end{frame}