% Instructions: you don't need to change anything in the macros, but
% feel free to define new commands as you wish. Starting from the main
% body, change the specs (e.g., your
% name). use \begin{solution} \end{solution} environment to write your
% solutions. Don't forget to list your collaborators.

\documentclass[12pt,answers]{exam}
%============Macros==================%
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage[margin=1in]{geometry}
%--------------Cosmetic----------------%
\usepackage{mathtools}
\usepackage{hyperref}
\usepackage{fullpage}
\usepackage{microtype}
\usepackage{xspace}
\usepackage[svgnames]{xcolor}
\usepackage[sc]{mathpazo}
\usepackage{enumitem}
\setlist[enumerate]{itemsep=1pt,topsep=2pt}
\setlist[itemize]{itemsep=1pt,topsep=2pt}
%----------Header--------------------%
\def\course{CS 584/684 Algorithm Design and Analysis}
\def\term{Portland State U, Winter 2021}
\def\prof{Lecturer: Fang Song}
\newcommand{\handout}[5]{
   \renewcommand{\thepage}{\arabic{page}}
   \begin{center}
   \framebox{
      \vbox{
    \hbox to 5.78in { \hfill \large{\course} \hfill }
       \vspace{2mm}
       \hbox to 5.78in { {\Large \hfill \textbf{#5}  \hfill} }
       \vspace{2mm}
       \hbox to 5.78in { \term \hfill \emph{#2}}
       \hbox to 5.78in { {#3 \hfill \emph{#4}}}
      }
   }
   \end{center}
   \vspace*{4mm}
}
\newcommand{\hw}[4]{\handout{#1}{#2}{#3}{#4}{Homework #1}}

%-----defs and commands-----%
\def\veps{\varepsilon}
\newcommand{\bit}{\{0,1\}}
\newcommand{\negl}{\text{negl}}
\newcommand{\corr}[1]{{\color{blue}{#1}}}
\newcommand{\alg}[1]{\textsf{#1}}
%=======Main document==============%
\begin{document}

%----Specs: change accordingly-----%
\newif\ifstudent % comment out false
\studenttrue
%\studentfalse

\def\texbp{5} % bonus for typing in latex
\def\hwnum{6} %
\def\issuedate{02/18/21} %
\def\duedate{03/02/21} %
\def\yourname{your name} % type your name here

%------------------------------%
\ifstudent
\hw{\hwnum}{\issuedate}{Student: \yourname}{Due: \duedate}%
\else
\hw{\hwnum}{\issuedate}{\prof}{Due: \duedate}%
\fi

\noindent \textbf{Instructions.} This problem set contains \numpages\
pages (including this cover page) and \numquestions\ questions. A
random subset of problems will be graded.

\begin{itemize}
\item Your solutions will be graded on \emph{correctness} and
  \emph{clarity}. You should only submit work that you believe to be
  correct, and you will get significantly more partial credit if you
  clearly identify the gap(s) in your solution. It is good practice to
  start any long solution with an informal (but accurate) summary that
  describes the main idea. You may opt for the ``I take 15\%'' option.

\item You need to submit a PDF file before the deadline. Either a
  clear scan of you handwriting or a typeset document is accepted. You
  will get $\texbp$ bonus points for typing in LaTeX (Download and use
  the accompany TeX file).

\item You may collaborate with others on this problem set. However,
  you must \textbf{{write up your own solutions}} and \textbf{{list
      your collaborators and any external sources}} for each
  problem. Be ready to explain your solutions orally to a course staff
  if asked.

\item For problems that require you to provide an algorithm, you must
  give a precise description of the algorithm, together with a proof
  of correctness and an analysis of its running time. You may use
  algorithms from class as subroutines. You may also use any facts
  that we proved in class or from the book.

\item \textbf{If you describe a Greedy algorithm, you will get no
    credit without a formal proof of correctness, even if your
    algorithm is correct.}

\end{itemize}
\paragraph{Exercises. Do not turn in.}
\begin{questions}
\question Let $f$ and $f'$ be feasible $(s,t)$-flows in a flow network
  $G$, such that $v(f') > v(f)$. Prove that there is a feasible
  $(s,t)$-flow with value $v(f') - v(f)$ in the residual network
  $G_f$.

\question Let $u\to v$ be an arbitrary edge in an arbitrary flow
  network $G$. Prove that if there is a minimum $(s,t)$-cut $(S,T)$
  such that $u\in S$ and $v\in T$, then there is \emph{no} minimum cut
  $(S',T')$ such that $u\in T'$ and $v\in S'$.

  \question Describe a linear program for the bipartite maximum
  matching problem. The input is a bipartite graph
  $G = (U \cup V; E)$, where $E \subseteq U \times V$; the output is
  the largest matching in $G$. Your linear program should have one
  variable for each edge.

\end{questions}
\newpage
\paragraph{Problems to turn in.}

\begin{questions}
  \question[10] (Stabbing points) Let $X$ be a set of $n$ intervals on
  the real line. We say that a set $P$ of points \emph{stabs} $X$ if
  every interval in $X$ contains at least one point in $P$. Describe
  an efficient algorithm to compute the smallest set of points that
  stabs $X$. Assume that your input consists of two arrays
  $L[1,\ldots,n]$ and $R[1,\ldots,n]$, representing the left and right
  endpoints of the intervals in $X$.

  \newpage

  \question[10] (Maximum spanning tree) Describe an algorithm to
  compute the \emph{maximum}-weight spanning tree of a given
  edge-weighted graph.

  \newpage

  \question[10] Suppose we are maintaining a data structure under a
  series of $n$ operations. Let $f(i)$ denote the actual running time
  of the $i$th operation. Suppose that $f(i)$ is the largest integer
  $k$ such that $2^k$ divides $i$. Determine the resulting amortized
  cost of a single operation.

\newpage
\question[15] (Vertex cover) A \emph{vertex cover} of an undirected
  graph $G = (V, E)$ is a subset of the vertices which touches every
  edge—that is, a subset $S \subseteq V$ such that for each edge
  ${u,v} \in E$, one or both of $u,v$ are in $S$.  Describe and
  analyze an algorithm, as efficient as you can, to find a minimum
  vertex cover in a bipartite graph.

  \newpage

  \question (Updating max flow) You are given a flow network
  $G = (V,E)$ with source $s$ and sink $t$, and integer capacities.
  \begin{parts}
    \part[10] Suppose that you are given a max flow in $G$. Now we
    increase the capacity of a single edge $(u,v)\in E$ by 1. Give an
    $O(m+n)$-time algorithm to update the max flow.
    \part[10] Now suppose all edges have unit capacity and you are
    given a parameter $k$. The goal is to delete $k$ edges so as to
    reduce the maximum $s-t$ flow in $G$ as much as possible. In other
    words, you should find a set of edges $F\subseteq E$ so that
    $|F|=k$ and the maximum $s-t$ flow in $G'=(V,E-F)$ is as small as
    possible subject to this. Describe a polynomial-time algorithm to
    solve this problem.
  \end{parts}
\end{questions}
\end{document}


\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{indentfirst}

\title{SICP Exercise 1-5}
\author{Samuel Lair}
\date{January 19, 2020}

\begin{document}

\maketitle

\section{Introduction}

Ben Bitdiddle executes the following program:

\begin{verbatim}
        (define (p) (p))
        (define (test x y)
            (if (= x 0)
               0
              y))
        (test 0 (p))
\end{verbatim}

Describe what happens under applicative-order and normal-order evaluation.

\section{Applicative-Order Evaluation}

Under applicative-order evaluation, operators and operands are evaluated before applying the resulting procedures.  This poses a problem when evaluating (test 0 (p)).  The definition of (p) is recursive with no terminating base case.  Therefore, an applicative-order interpreter will get stuck in an infinite loop when it tries to evaluate the (p) in (test 0 (p)).

The Scheme interpreter uses applicative-order evaluation so this is what actually happens when this program is evaluated.

\section{Normal-Order Evaluation}
Under normal-order evaluation, operands are not evaluated until their values are needed.  Therefore, (test 0 (p)) is expanded to:

\begin{verbatim}
        (if (= 0 0)
            0
            (p)))
\end{verbatim}

Since 0 equals 0, a normal-order interpreter will return 0 without evaluating (p).

\end{document}


\section{Thermodynamics - A Refresher}
We'll start with a quick overview of some of the important concepts from classical thermodynamics. Seeking a microscopic explanation for the macroscopic concepts presented here was an early motivation for the field of statistical mechanics. This section will also recap some content from 315.

In thermodynamics we study a system --- the part of the world that we are interested in --- that is separated from its surroundings --- the rest of the universe --- by some boundary.

We can classify the types of systems into three types based on the type of walls that define the system boundary:
\begin{itemize}
\item Adiabatic walls/isolated system --- no energy or matter is transferred
\item Diathermal walls/closed system --- no matter can be transfered but heat can flow through the walls.
\item (Semi-)permeable walls/open system --- in addition to heat, one or more chemical species can be transfered through the walls.
\end{itemize}

\subsection{The Four Laws of Thermodynamics}
Only four laws are required to construct the relationships that control much of classical thermodynamics. We'll see later, that somewhat amazingly, these macroscopic laws arise naturally from the mathematics of the microscope systems.

These are, in brief:
\begin{itemize}
\item {\bf Zeroth Law} Defines temperature and thermal equilibrium.
\item {\bf First Law} Formulates the principle of conservation of energy for thermodynamic systems. (Energy is conserved)
\item {\bf Second Law} Entropy increases; heat spontaneously flows from high to low temperatures.
\item {\bf Third Law} The absolute zero of temperature is not attainable.
\end{itemize}

We'll revisit the first two laws in a bit more detail and then make use of the second law to derive some familiar properties of heat.

\subsection{Zeroth Law}
If two systems are each in thermal equilibrium with a third system, then they are  also in thermal equilibrium with each other. This implies that they have some property in common. We call this property \emph{temperature}. (In the language of mathematics, thermal equilibrium is a transitive property.)

It is worth noting that thermal equilibrium is not the same as thermodynamic equilibrium. For the latter we also need mechanical equilibrium ($P_1=P_2$) and chemical equilibrium ($\mu_1=\mu_2$ --- equal rates of reaction).

\subsection{First Law}
Energy remains constant for a (collection of) system(s) isolated from the surroundings. The energy of a system changes if we do work on the system, and/or if we supply heat to the system. We denote work done \emph{on} a system as $W>0$, similarly, heat supplied \emph{to} the system is denoted $Q>0$.

When considering the change in energy $\Delta E$ of a system it is necessary to consider both work and heat.

E.g. System $A$ gains energy from system $B$, i.e. $\Delta E_A = -\Delta E_B \implies \Delta E_A + \Delta E_B =0$. But, in general, $\Delta E_A\neq W_{B\rightarrow A}$ since there can also be a heat flow $Q_{B\rightarrow A}$ due to a temperature difference.
So,
$$\Delta E_A = W_{B\rightarrow A} + Q_{B\rightarrow A}$$
$$\Delta E_B = W_{A\rightarrow B} + Q_{A\rightarrow B}.$$

Energy conservation gives
$$\underbrace{(W_{A\rightarrow B}+W_{B\rightarrow A})}_{\text{Work done by the composite system}} + \underbrace{(Q_{A\rightarrow B}+Q_{B\rightarrow A})}_{\text{Heat flow in the composite system}} = 0$$

In an adiabatic (isolated) system the fist law gives a sort of balance sheet for energy/work/heat:
$W_{A\rightarrow B}+W_{B\rightarrow A} = 0$ and $Q_{A\rightarrow B}+Q_{B\rightarrow A}$.

Revision: Adiabatic work and heat flow. Quasi-static processes (how slow is slow enough?). Path dependence of work.
 - see the notes from 315 that are in the repository. You may want to incorporate the relevant content from those notes, or other sources, into this document.

The \emph{internal energy} of a system is the energy associated with the internal degrees of freedom of the system. If a system is at rest and the potential energy of any external field is unimportant, then the internal energy of a system is the total energy of a system.

The equation of state for internal energy is usually written $E = E(T,V,N)$ or $E = E(T,P,N)$. Expressing these as infinitesimals (change in internal energy) gives
$$ dE = \frac{\partial E}{\partial T}\bigg\vert_{V,N}dT + \frac{\partial E}{\partial V}\bigg\vert_{T,N}dV +\frac{\partial E}{\partial N}\bigg\vert_{T,V}dN$$
a similarly, for the second formulation.

Note $ \frac{\partial E}{\partial T}\vert_{V,N} \neq \frac{\partial E}{\partial T}\vert_{P,N} $

\subsection{Heat Capacity}
Heat flowing into a system causes a change in temperature (except in the case of phase transitions). $T\rightarrow T=\Delta T$. The heat capacity of a system depends, in part on the experimental conditions of the system under consideration. Two important cases are constant volume and constant pressure.

For constant volume we have
$$C_V = \frac{\delta Q}{dT}\bigg\vert_V$$
similarly, for constant pressure,
$$C_P = \frac{\delta Q}{dT}\bigg\vert_P.$$

The first law of thermodynamics (conservation of energy) implies that $\delta Q = dE - \delta W = dE + PdV$  (since $W = PdV$). So
$C_V = \frac{\delta Q}{\partial T}\vert_{V,N} = \frac{\partial E}{\partial T}\vert_{V,N}$ (since $dV=0$ for fixed V.)
In the constant pressure case $C_P = \frac{\delta Q}{dT}\vert_{P,N} = \frac{\partial E}{\partial T}\vert_{P,N} + P\frac{\partial V}{\partial T}\vert_{P,N}$.

Constant pressure heat capacity implies that there is a change in volume, so think about how the volume changes. Define the \emph{volumetric thermal expansivity} $\alpha_p = \frac{1}{V}\frac{\partial V}{\partial T}\vert_{P,N} \implies V\alpha_p =\frac{\partial V}{\partial T}\vert_{P,N}$.

We can now write $C_P = \frac{\partial E}{\partial T}\vert_{P,N} + \alpha_pPV$.

An alternative way of thinking about $C_P$: constant pressure implies that $PdV = d(PV)$ so that $\delta Q = dE + \underbrace{dPV}_{=dW} = d(E+PV)$. We define the composite quantity $E+PV$ as \emph{enthalpy}, H, with the equation of state $H = H(T,P,N)$.

The infinitesimal for enthalpy is $dH = \underbrace{dE +PdV}_{\delta Q}+ VdP = \delta Q + VdP\vert_{P}$. The last term is zero, since $P$ is constant, so we get $C_P = \frac{\delta Q}{\partial T}\vert_{P,N} = \frac{\partial H}{\partial T}\vert_{P,N} $.

\subsection{Intensive \& Extensive Variables}

Intensive variables  describe the state of a system but are independent of the system size. E.g. $T,P$

Extensive, or additive, variables are proportionate to the size of a system (i.e. they depend on $N$).

It is possible to turn an extensive variable into an intensive variable by normalising by the system size. I.e. the variables come in dual pairs, e.g. pressure and volume.

(One important extensive variable is the entropy $S$ (or disorder) of a system. The dual variable is temperature.)

The intensive variables  can be found as derivatives of the internal energy with respect to the corresponding extensive variable, given all other extensive variables are held constant. For example, $T = \frac{\partial E}{\partial S}\vert_{V,N}$.

Given two systems 1 and 2, an extensive variable for the composite system $1\cup2$ can be found by simply adding the individual extensive variables. E.g. $N_{1\cup2} = N_1 + N_2$, $V_{1\cup2} = V_1 + V_2$, $E_{1\cup2} = E_1 + E_2$ ($E$ = internal energy).

Actually, the case of internal energy is not entirely correct since there is often an interaction term between the two systems at the interface. I.e. $E_{1\cup2} = E_1+E_2+E_{int}$. Since $E_{int}$ depends on the interface between the two systems it scales like an area as a function of system size, while $E_1$ and $E_2$ will scale like a volume, so typically $\frac{E_{int}}{E_1+E_2}\rightarrow0$ as the system size gets big. E.g. an oil water interface (insert an image?).

But this assumption clearly depends on the structural details of the interface. Imagine the oil-water interface in an emulsion like mayonnaise --- in this case the ratio  $\frac{E_{int}}{E_1+E_2}$ is more like $\mathcal{O}(1)$.
Similarly, if there are significant long range interactions. (E.g. gravity --- it might not work using stat mech to model celestial mechanics.)

\subsection{The Fundamental Hypothesis of Thermodynamics}
It is possible to characterise the state of a thermodynamic system by specifying the values of a set of extensive variables.

\subsection{The Central Problem of Thermodynamics}
Given the initial state of equilibrium of several thermodynamic systems that are allowed to interact, determine the final thermodynamic state of equilibrium. (The boundaries of the systems --- adiabatic, closed, open --- determine the types of interactions that are allowed.) We want to pick a final thermodynamic equilibrium state from the space of all possible equilibrium states.

Entropy plays a special role in this problem due to the entropy postulate (the second law of thermodynamics).

The entropy postulate: there exists a function $S$ of the extensive variables $X_1,X_2,\ldots,X_r$ called the entropy that assumes a maximum value for a state of equilibrium among the space of possible states.

Entropy has the following properties:
\begin{enumerate}
\item Extensivity: ($S$ is an extensive variable) If 1 and 2 are thermodynamic systems then $S_{1\cup2}=S_1+S_2$.
\item Convexity: If $X^1=(X_0^1,X_1^1,\ldots,X_r^1)$ and  $X^2=(X_0^2,X_1^2,\ldots,X_r^2)$ are two thermodynamic states of the same system then for $0\leq\alpha\leq1$
$$ S((1-\alpha)X^1+\alpha X^2)\geq (1-\alpha)S(X^1)+\alpha S(X^2) $$.
I.e. the entropy of a linear combination of states is greater than or equal to the same linear combination of entropies of the individual states.
A consequence of this is that if we take derivatives with respect to $\alpha$ at $\alpha=0$ we get
$$\frac{\partial}{\partial \alpha} S((1-\alpha)X^1+\alpha X^2) = \sum_{i=0}^r\frac{\partial S}{\partial X_i}(X_i^2-X_i^1)$$
and

$$\frac{\partial}{\partial \alpha} \left[ (1-\alpha)S(X^1)+\alpha S(X^2) \right] = S(X^2)-S(X^1).$$

So,
$$ \sum_{i=0}^r\frac{\partial S}{\partial X_i}(X_i^2-X_i^1)\geq  S(X^2)-S(X^1).$$
So the entropy surface (as a function of the other extensive variables) is always below the tangent plane of a point on the surface. We'll use this soon.
\item Monotonicity: $S(E,X_1,\ldots,X_r)$ is a monotonically increasing function of the internal energy $E$. I.e. $\frac{\partial S}{\partial E}\vert_{X_1,\ldots,X_r} = \frac{1}{T}>0$.
\end{enumerate}

Using these three properties, it is possible to find the final equilibrium thermodynamic state amongst the space of possible states. The equilibrium states is the state with maximum entropy that satisfies the constrains on the system. (I.e. Maximum disorder - can also think about this in terms of it being the state with the greatest possible number of corresponding microstates, but we haven't quite got that far yet.)

Worked example. Consider two systems, 1 and 2, in thermal contact such that they can exchange energy, but nothing else (I.e. no other extensive quantities change). The space of possible states is defined by
$$E^1+E^2 = X_0^1+X_0^2 = E = \text{const.}$$
$$X_i^1 = \text{const.}\quad i=1,2,\ldots,r$$
$$X_i^2 = \text{const.}\quad i=1,2,\ldots,r.$$
We want to find the maximum of $S$ as a function of $E^1$ (we could just as well use $E^2$). Start by taking the derivative of $S$.

$$\frac{\partial S}{\partial E^1} = \frac{\partial}{\partial E^1}\left(S^1(E^1,X_1^1,X_2^1,\ldots,X_r^1) + S^2(\underbrace{E-E^1}_{E=E^1+E^2},X_1^2,X_2^2,\ldots,X_r^2) \right) = \frac{\partial S^1}{\partial E^1}\bigg\vert_{E^1} -  \frac{\partial S^2}{\partial E^2}\bigg\vert_{E^2=E-E^1}.$$
For $E^1$ at equilibrium we will write $E^1_{eq}$ (sim. for $E^2$). Then to maximise $S$ we must have
$$\frac{\partial S}{\partial E^1}\bigg\vert_{E^1_{eq}} = \frac{\partial S^1}{\partial E^1}\bigg\vert_{E^1_{eq}} - \frac{\partial S^2}{\partial E^2}\bigg\vert_{E-E^1_{eq}}=0$$
so $\frac{\partial S^1}{\partial E^1}\vert_{E^1_{eq}} = \frac{\partial S^2}{\partial E^2}\vert_{E_{eq}^2}$. We already have our first result --- the equilibrium state is the one where the change in entropy of the two systems, wrt, $E$ is equal. (The  monotonicity postulate equated this with inverse temperature; hence, the equilibrium state must be the one where the temperatures of the two systems are equal.)

Where does the heat in flow to in the system? The system started in an initial state with $E = E^1_{in}+E^2_{in}$. Since entropy increases to reach the maximum  value at equilibrium we have $S^1(E^1_{eq}) + S^2(E^2_{eq}) \geq S^1(E^1_{in}) + S^2(E^2_{in})$, i.e. $ S^1(E^1_{in}) - S^1(E^1_{eq})  +  S^2(E^2_{in}) - S^2(E^2_{eq}\geq 0$.

The convexity property of entropy means that both systems have $S(E_{eq})-S(E_{in})\leq \frac{\partial S}{\partial E}\vert_{E_{in}}(E_{eq}-E_{in})$ and from the previous expression, the LHS of the inequality is bounded below by zero so we have
$$\frac{\partial S^1}{\partial E^1}\bigg\vert_{E^1_{in}}(E_{eq}^1-E_{in}^1) + \frac{\partial S^2}{\partial E^2}\bigg\vert_{E^2_{in}}(\underbrace{E-E_{eq}^1}_{=E^2_{eq}}-E_{in}^2).$$

But $E$ is conserved so $E=E^1_{in}+E^2_{in}$ so we have $E-E^1_{eq}-E^2_{in} = -(E^1_{eq}-E^1_{in})$ and therefore
$$\left[\frac{\partial S^1}{\partial E^1}\bigg\vert_{E^1_{in}} - \frac{\partial S^2}{\partial E^2}\bigg\vert_{E^2_{in}}\right]\left(E^1_{eq}-E^1_{in}\right)\geq 0.$$

This implies that energy flows to the  system with higher $\frac{\partial S}{\partial E}$. From the monotonicity postulate we identified  $\frac{\partial S}{\partial E}= \frac{1}{T}$ so energy flows into the system with lowest temperature, until the temperatures are equal.

\subsection{Suggested Reading}
Chapter 3 of \emph{Statistical Mechanics made Simple} (It's on the recommended reading list) covers the elements of thermodynamics nicely. Sections 3.1 to 3.5 in particular go over most of the concepts we have looked at here and introduce a few additional ideas.


\chapter{Charts and graphs}
\label{chap:charts}

\pagebreak

\section{Graphical presentation of the initial curve data}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/rates_with_fwd}
	\caption{Interpolated interest rates and instantaneous forward rate curves}
	\label{fig:rateswithfwd}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/rates_by_methods}
	\caption{Interpolated interest rates}
	\label{fig:ratesbymethods}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/zeros}
	\caption{Theoretical zero coupon bond prices inferred from the rate data by using different interpolation methods}
	\label{fig:zeros}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/rates_by_curve}
	\caption{Theoretical zero coupon bond prices inferred from the rate data}
	\label{fig:ratesbycurve}
\end{figure}

\section{Comparison of actual inferred rates and calibrated model prices without default risk}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A01}
	\caption{Calibrated rates by model $A(0,1)$}
	\label{fig:A01}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A11}
	\caption{Calibrated rates by model $A(1,1)$}
	\label{fig:A11}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A02}
	\caption{Calibrated rates by model $A(0,2)$}
	\label{fig:A02}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A12}
	\caption{Calibrated rates by model $A(1,2)$}
	\label{fig:A12}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A22}
	\caption{Calibrated rates by model $A(2,2)$}
	\label{fig:A22}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A03}
	\caption{Calibrated rates by model $A(0,3)$}
	\label{fig:A03}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A13}
	\caption{Calibrated rates by model $A(1,3)$}
	\label{fig:A13}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A23}
	\caption{Calibrated rates by model $A(2,3)$}
	\label{fig:A23}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A24}
	\caption{Calibrated rates by model $A(2,4)$}
	\label{fig:A24}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A33}
	\caption{Calibrated rates by model $A(3,3)$}
	\label{fig:A33}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A34}
	\caption{Calibrated rates by model $A(3,4)$}
	\label{fig:A34}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/A45}
	\caption{Calibrated rates by model $A(4,5)$}
	\label{fig:A45}
\end{figure}

\section{Comparison of different calibrations between models without default risk}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/comp_one_factor}
	\caption{Comparison of alternative calibrations for single factor models}
	\label{fig:comp_one_factor}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/comp_two_factor}
	\caption{Comparison of alternative calibrations for $2$-factor models}
	\label{fig:comp_two_factor}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/comp_three_fact}
	\caption{Comparison of alternative calibrations for multifactor models}
	\label{fig:comp_three_factor}
\end{figure}

\pagebreak

\section{Model parameters for affine models without default risk}

\begin{table}[H]
	\centering
	\caption{Overnight index swap}
	\label{ois_table}

	\begin{adjustbox}{width=\textwidth}

\begin{tabular}{lrrlrllllllll}
	\toprule
	{} &   0, 1 &   1, 1 &            0, 2 &   1, 2 &            2, 2 &            1, 3 &                    0, 3 &            2, 3 &                   3, 3 &                   3, 4 &            2, 4 &                          4, 5 \\
	\midrule
	$X_0$   &        &  0.001 &                 &  0.001 &   [0.001, 0.08] &           0.002 &                         &  [0.001, 0.079] &  [0.017, 0.007, 0.031] &   [0.02, 0.084, 0.072] &   [0.019, 0.03] &  [0.041, 0.058, 0.038, 0.002] \\
	$Y_0$   & -0.030 &        &  [-0.046, 0.04] &  0.021 &                 &    [-0.08, 0.1] &   [-0.1, 0.062, -0.022] &          -0.054 &                        &                   -0.1 &   [-0.02, 0.09] &                        -0.038 \\
	$\alpha$ &        &  0.057 &                 &  0.338 &  [0.444, 0.703] &           0.396 &                         &  [2.654, 1.373] &  [2.173, 0.185, 1.918] &  [1.827, 2.999, 1.103] &  [0.308, 1.782] &      [3.0, 2.988, 2.992, 3.0] \\
	$\delta$ &  0.017 & -0.011 &            0.02 & -0.027 &           -0.08 &          -0.031 &                   0.049 &          -0.023 &                 -0.046 &                 -0.068 &          -0.095 &                        -0.089 \\
	$k$     &  0.287 &        &  [0.387, 2.362] &  0.894 &                 &  [2.539, 1.731] &   [0.483, 0.949, 2.998] &           0.404 &                        &                  0.059 &  [1.317, 2.993] &                         0.342 \\
	$\nu$    &  0.001 &        &  [0.029, 0.212] &  0.250 &                 &  [0.068, 0.246] &   [0.001, 0.237, 0.002] &           0.013 &                        &                  0.024 &  [0.176, 0.001] &                         0.001 \\
	$\rho$   &        &        &          -0.566 &        &                 &           -0.99 &  [0.872, -0.011, -0.19] &                 &                        &                        &           -0.99 &                               \\
	$\sigma$ &        &  0.240 &                 &  0.233 &  [0.118, 0.247] &           0.001 &                         &  [0.001, 0.133] &  [0.185, 0.249, 0.001] &   [0.046, 0.25, 0.245] &  [0.097, 0.055] &   [0.159, 0.249, 0.249, 0.25] \\
	$\theta$ &        &  0.100 &                 &  0.100 &      [0.1, 0.0] &           0.055 &                         &  [0.018, 0.023] &    [0.0, 0.075, 0.016] &   [0.085, 0.023, 0.05] &  [0.057, 0.066] &      [0.084, 0.0, 0.0, 0.021] \\
	\bottomrule
\end{tabular}

  \end{adjustbox}

\end{table}

\begin{table}[H]
	\centering
	\caption{Swap}
	\label{swap_table}

	\begin{adjustbox}{width=\textwidth}

\begin{tabular}{lrrlrllllllll}
	\toprule
	{} &   0, 1 &   1, 1 &            0, 2 &   1, 2 &            2, 2 &            1, 3 &                    0, 3 &            2, 3 &                   3, 3 &                   3, 4 &            2, 4 &                          4, 5 \\
	\midrule
	$X_0$   &        &  0.001 &                 &  0.001 &  [0.012, 0.069] &             0.1 &                         &  [0.001, 0.094] &  [0.003, 0.033, 0.061] &  [0.048, 0.025, 0.002] &    [0.098, 0.1] &   [0.016, 0.098, 0.001, 0.05] \\
	$Y_0$   & -0.031 &        &   [-0.1, 0.045] &  0.050 &                 &   [0.002, -0.1] &   [0.081, -0.1, -0.041] &          -0.038 &                        &                 -0.006 &  [-0.025, -0.1] &                        -0.076 \\
	$\alpha$ &        &  0.279 &                 &  0.381 &   [0.328, 0.92] &           0.734 &                         &  [0.388, 0.981] &  [0.291, 2.303, 1.296] &  [0.001, 2.249, 0.054] &  [1.356, 0.905] &  [0.306, 1.746, 2.521, 1.534] \\
	$\delta$ &  0.019 & -0.013 &           0.052 & -0.051 &          -0.079 &          -0.002 &                   0.048 &          -0.065 &                   -0.1 &                 -0.068 &          -0.076 &                          -0.1 \\
	k     &  0.326 &        &  [0.526, 0.969] &  0.888 &                 &  [2.722, 0.496] &    [1.04, 0.541, 2.541] &           2.636 &                        &                      3 &   [2.12, 0.527] &                         2.336 \\
	$\nu$    &  0.001 &        &   [0.001, 0.25] &  0.154 &                 &  [0.065, 0.001] &   [0.238, 0.049, 0.211] &           0.124 &                        &                  0.157 &  [0.001, 0.001] &                         0.041 \\
	$\rho$   &        &        &           0.456 &        &                 &           0.811 &  [-0.734, 0.416, 0.312] &                 &                        &                        &            0.99 &                               \\
	$\sigma$ &        &  0.129 &                 &  0.248 &   [0.25, 0.147] &           0.001 &                         &  [0.248, 0.214] &    [0.25, 0.25, 0.243] &   [0.025, 0.25, 0.166] &  [0.152, 0.222] &    [0.25, 0.101, 0.21, 0.003] \\
	$\theta$ &        &  0.035 &                 &  0.100 &  [0.094, 0.023] &           0.021 &                         &      [0.1, 0.0] &    [0.072, 0.063, 0.0] &    [0.045, 0.009, 0.1] &  [0.095, 0.001] &      [0.093, 0.0, 0.045, 0.0] \\
	\bottomrule
\end{tabular}

	\end{adjustbox}

\end{table}

\begin{table}[H]
	\centering
	\caption{Germany}
	\label{germany_table}

	\begin{adjustbox}{width=\textwidth}

		\begin{tabular}{lrrlrllllllll}
			\toprule
			{} &   0, 1 &   1, 1 &              0, 2 &   1, 2 &            2, 2 &             1, 3 &                     0, 3 &            2, 3 &                   3, 3 &                   3, 4 &             2, 4 &                          4, 5 \\
			\midrule
			$X_0$   &        &  0.053 &                   &  0.001 &  [0.016, 0.072] &            0.001 &                          &  [0.025, 0.068] &  [0.045, 0.061, 0.001] &    [0.057, 0.012, 0.1] &   [0.001, 0.051] &  [0.071, 0.001, 0.001, 0.075] \\
			$Y_0$   & -0.037 &        &  [-0.021, -0.094] & -0.055 &                 &  [0.057, -0.078] &  [-0.054, 0.022, -0.091] &          -0.014 &                        &                   -0.1 &  [-0.054, 0.094] &                        -0.039 \\
			$\alpha$ &        &  0.077 &                   &  0.022 &  [0.061, 0.873] &            0.004 &                          &  [0.052, 1.214] &    [0.008, 3.0, 0.565] &    [2.183, 0.057, 3.0] &   [0.004, 0.609] &    [3.0, 0.005, 0.534, 2.808] \\
			$\delta$ &  0.028 & -0.062 &               0.1 &  0.039 &          -0.098 &            0.031 &                    0.055 &          -0.097 &                   -0.1 &                 -0.071 &           -0.091 &                          -0.1 \\
			$k$     &  0.105 &        &    [0.428, 0.005] &  0.099 &                 &    [2.674, 0.58] &      [0.186, 1.371, 3.0] &           2.499 &                        &                  1.182 &    [1.48, 1.537] &                         0.855 \\
			$\nu$    &  0.016 &        &    [0.001, 0.001] &  0.038 &                 &    [0.01, 0.133] &     [0.036, 0.25, 0.189] &           0.023 &                        &                  0.246 &    [0.03, 0.086] &                          0.23 \\
			$\rho$   &        &        &             0.641 &        &                 &            0.558 &  [0.422, -0.924, -0.044] &                 &                        &                        &           -0.184 &                               \\
			$\sigma$ &        &  0.062 &                   &  0.001 &   [0.133, 0.15] &            0.001 &                          &  [0.073, 0.075] &  [0.001, 0.181, 0.072] &   [0.001, 0.001, 0.12] &    [0.001, 0.13] &  [0.002, 0.001, 0.225, 0.204] \\
			$\theta$ &        &  0.098 &                   &  0.100 &   [0.09, 0.071] &              0.1 &                          &  [0.077, 0.066] &    [0.1, 0.027, 0.035] &  [0.001, 0.031, 0.081] &     [0.095, 0.1] &   [0.05, 0.085, 0.057, 0.039] \\
			\bottomrule
		\end{tabular}

	\end{adjustbox}

\end{table}

\begin{table}[H]
	\centering
	\caption{France}
	\label{france_table}

	\begin{adjustbox}{width=\textwidth}

\begin{tabular}{lrrlrllllllll}
	\toprule
	{} &   0, 1 &   1, 1 &              0, 2 &   1, 2 &            2, 2 &            1, 3 &                     0, 3 &            2, 3 &                   3, 3 &                   3, 4 &            2, 4 &                          4, 5 \\
	\midrule
	$X_0$   &        &  0.016 &                   &  0.019 &   [0.02, 0.064] &           0.067 &                          &   [0.06, 0.002] &  [0.095, 0.001, 0.009] &  [0.002, 0.012, 0.043] &   [0.093, 0.07] &  [0.085, 0.062, 0.001, 0.049] \\
	$Y_0$   & -0.049 &        &  [-0.088, -0.027] & -0.010 &                 &   [-0.1, 0.084] &  [-0.036, 0.028, -0.087] &           0.034 &                        &                  0.032 &   [0.039, -0.1] &                        -0.099 \\
	$\alpha$ &        &  0.159 &                   &  0.148 &  [2.999, 0.131] &             0.1 &                          &  [0.469, 0.005] &   [2.411, 1.31, 0.064] &   [0.012, 0.545, 2.65] &  [2.999, 0.134] &  [1.868, 0.018, 1.162, 2.772] \\
	$\delta$ &  0.039 & -0.025 &               0.1 & -0.026 &            -0.1 &          -0.066 &                      0.1 &           -0.09 &                   -0.1 &                 -0.087 &            -0.1 &                        -0.076 \\
	$k$     &  0.115 &        &    [0.005, 0.348] &  2.492 &                 &  [1.241, 1.384] &    [0.445, 2.866, 0.005] &           2.298 &                        &                  0.963 &  [2.995, 2.199] &                         0.047 \\
	$\nu$    &  0.021 &        &    [0.001, 0.001] &  0.097 &                 &  [0.026, 0.137] &     [0.011, 0.21, 0.001] &           0.001 &                        &                  0.177 &  [0.177, 0.189] &                         0.002 \\
	$\rho$   &        &        &             -0.99 &        &                 &          -0.374 &  [-0.836, -0.894, 0.503] &                 &                        &                        &          -0.572 &                               \\
	$\sigma$ &        &  0.006 &                   &  0.011 &  [0.179, 0.046] &           0.038 &                          &  [0.007, 0.001] &    [0.1, 0.116, 0.039] &  [0.023, 0.218, 0.195] &   [0.042, 0.01] &  [0.085, 0.085, 0.234, 0.005] \\
	$\theta$ &        &  0.047 &                   &  0.049 &    [0.028, 0.1] &             0.1 &                          &      [0.1, 0.1] &    [0.0, 0.095, 0.035] &  [0.049, 0.099, 0.021] &  [0.027, 0.099] &    [0.004, 0.049, 0.1, 0.008] \\
	\bottomrule
\end{tabular}

	\end{adjustbox}

\end{table}

\begin{table}[H]
	\centering
	\caption{Italy}
	\label{italy_table}

	\begin{adjustbox}{width=\textwidth}

		\begin{tabular}{lrrlrllllllll}
			\toprule
			{} &   0, 1 &   1, 1 &            0, 2 &   1, 2 &            2, 2 &             1, 3 &                   0, 3 &            2, 3 &                   3, 3 &                   3, 4 &             2, 4 &                          4, 5 \\
			\midrule
			$X_0$   &        &  0.001 &                 &  0.016 &  [0.001, 0.051] &             0.06 &                        &  [0.004, 0.093] &   [0.014, 0.018, 0.02] &    [0.1, 0.001, 0.033] &   [0.078, 0.004] &    [0.024, 0.003, 0.04, 0.08] \\
			$Y_0$   & -0.048 &        &   [-0.1, 0.064] &  0.024 &                 &  [0.022, -0.061] &  [0.1, -0.074, -0.065] &          -0.055 &                        &                 -0.077 &  [-0.026, 0.025] &                        -0.075 \\
			$\alpha$ &        &  0.213 &                 &  0.314 &  [0.433, 0.647] &            1.893 &                        &    [1.978, 3.0] &  [0.328, 1.651, 0.001] &  [1.503, 2.256, 1.875] &   [1.343, 0.413] &  [2.978, 0.376, 0.998, 0.822] \\
			$\delta$ &  0.039 & -0.008 &           0.039 & -0.032 &          -0.056 &           -0.012 &                  0.039 &          -0.025 &                  -0.05 &                 -0.058 &           -0.076 &                        -0.071 \\
			$k$     &  0.378 &        &  [0.511, 0.904] &  2.483 &                 &    [2.536, 0.43] &  [2.141, 2.818, 0.448] &           0.418 &                        &                  0.478 &   [0.906, 1.684] &                         0.789 \\
			$\nu$    &  0.001 &        &  [0.001, 0.001] &  0.114 &                 &   [0.063, 0.016] &  [0.012, 0.007, 0.001] &           0.001 &                        &                  0.009 &   [0.046, 0.057] &                         0.102 \\
			$\rho$   &        &        &          -0.886 &        &                 &             0.99 &  [0.868, 0.508, 0.868] &                 &                        &                        &            0.243 &                               \\
			$\sigma$ &        &  0.250 &                 &  0.216 &  [0.137, 0.142] &             0.16 &                        &  [0.029, 0.001] &   [0.09, 0.247, 0.018] &  [0.249, 0.112, 0.197] &    [0.12, 0.001] &   [0.233, 0.247, 0.016, 0.25] \\
			$\theta$ &        &  0.069 &                 &  0.086 &    [0.099, 0.0] &            0.053 &                        &  [0.029, 0.035] &   [0.07, 0.004, 0.006] &    [0.0, 0.046, 0.052] &   [0.061, 0.057] &    [0.028, 0.1, 0.001, 0.006] \\
			\bottomrule
		\end{tabular}

	\end{adjustbox}

\end{table}

\section{Comparison of parameters for affine models without default risk between different calibration attempts}

\label{defaultless_parameter_comparision}

\begin{tabular}{llll}
	\toprule
	OIS&       &               Original &            Alternative \\
	\midrule
	$A(0, 1)+$ & $Y_0$ &                  -0.03 &                  -0.03 \\
	& $\delta$ &                  0.017 &                  0.017 \\
	& $k$ &                  0.287 &                  0.286 \\
	& $\nu$ &                  0.001 &                  0.001 \\
	$A(0, 2)+$ & $Y_0$ &         [-0.046, 0.04] &           [0.04, -0.1] \\
	& $\delta$ &                   0.02 &                  0.055 \\
	& $k$ &         [0.387, 2.362] &         [0.864, 0.481] \\
	& $\nu$ &         [0.029, 0.212] &          [0.25, 0.013] \\
	& $\rho$ &                 -0.566 &                 -0.562 \\
	$A(1, 1)+$ & $X_0$ &                  0.001 &                  0.001 \\
	& $\alpha$ &                  0.057 &                  0.057 \\
	& $\delta$ &                 -0.011 &                 -0.011 \\
	& $\sigma$ &                   0.24 &                   0.24 \\
	& $\theta$ &                    0.1 &                    0.1 \\
	$A(2, 2)+$ & $X_0$ &          [0.001, 0.08] &         [0.059, 0.022] \\
	& $\alpha$ &         [0.444, 0.703] &         [0.807, 0.416] \\
	& $\delta$ &                  -0.08 &                 -0.079 \\
	& $\sigma$ &         [0.118, 0.247] &          [0.12, 0.103] \\
	& $\theta$ &             [0.1, 0.0] &           [0.0, 0.099] \\
	$A(3, 3)+$ & $X_0$ &  [0.017, 0.007, 0.031] &   [0.037, 0.03, 0.001] \\
	& $\alpha$ &  [2.173, 0.185, 1.918] &  [2.989, 2.964, 0.111] \\
	& $\delta$ &                 -0.046 &                  -0.06 \\
	& $\sigma$ &  [0.185, 0.249, 0.001] &    [0.25, 0.175, 0.25] \\
	& $\theta$ &    [0.0, 0.075, 0.016] &  [0.023, 0.021, 0.073] \\
	$A(3, 4)+$ & $X_0$ &   [0.02, 0.084, 0.072] &   [0.004, 0.07, 0.079] \\
	& $Y_0$ &                   -0.1 &                 -0.099 \\
	& $\alpha$ &  [1.827, 2.999, 1.103] &    [0.252, 2.995, 3.0] \\
	& $\delta$ &                 -0.068 &                 -0.044 \\
	& $k$ &                  0.059 &                  2.999 \\
	& $\nu$ &                  0.024 &                  0.019 \\
	& $\sigma$ &   [0.046, 0.25, 0.245] &   [0.181, 0.001, 0.25] \\
	& $\theta$ &   [0.085, 0.023, 0.05] &   [0.05, 0.016, 0.004] \\
	\bottomrule
\end{tabular}

\begin{tabular}{llll}
	\toprule
	Swap&       &               Original &            Alternative \\
	\midrule
	$A(0, 1)+$ & $Y_0$ &                 -0.031 &                 -0.031 \\
	& $\delta$ &                  0.019 &                  0.019 \\
	& $k$ &                  0.326 &                  0.326 \\
	& $\nu$ &                  0.001 &                  0.001 \\
	$A(0, 2)+$ & $Y_0$ &          [-0.1, 0.045] &         [0.055, -0.07] \\
	& $\delta$ &                  0.052 &                  0.019 \\
	& $k$ &         [0.526, 0.969] &         [1.062, 0.488] \\
	& $\nu$ &          [0.001, 0.25] &         [0.018, 0.001] \\
	& $\rho$ &                  0.456 &                 -0.643 \\
	$A(1, 1)+$ & $X_0$ &                  0.001 &                  0.001 \\
	& $\alpha$ &                  0.279 &                  0.096 \\
	& $\delta$ &                 -0.013 &                  -0.01 \\
	& $\sigma$ &                  0.129 &                   0.25 \\
	& $\theta$ &                  0.035 &                  0.071 \\
	$A(2, 2)+$ & $X_0$ &         [0.012, 0.069] &          [0.079, 0.02] \\
	& $\alpha$ &          [0.328, 0.92] &         [2.115, 0.418] \\
	& $\delta$ &                 -0.079 &                 -0.089 \\
	& $\sigma$ &          [0.25, 0.147] &         [0.137, 0.021] \\
	& $\theta$ &         [0.094, 0.023] &         [0.043, 0.065] \\
	$A(3, 3)+$ & $X_0$ &  [0.003, 0.033, 0.061] &  [0.054, 0.027, 0.001] \\
	& $\alpha$ &  [0.291, 2.303, 1.296] &  [0.736, 0.007, 0.079] \\
	& $\delta$ &                   -0.1 &                 -0.085 \\
	& $\sigma$ &    [0.25, 0.25, 0.243] &  [0.198, 0.048, 0.121] \\
	& $\theta$ &    [0.072, 0.063, 0.0] &    [0.047, 0.0, 0.075] \\
	$A(3, 4)+$ & $X_0$ &  [0.048, 0.025, 0.002] &    [0.001, 0.1, 0.001] \\
	& $Y_0$ &                 -0.006 &                 -0.009 \\
	& $\alpha$ &  [0.001, 2.249, 0.054] &  [2.012, 1.052, 0.381] \\
	& $\delta$ &                 -0.068 &                   -0.1 \\
	& $k$ &                      3 &                  1.625 \\
	& $\nu$ &                  0.157 &                  0.155 \\
	& $\sigma$ &   [0.025, 0.25, 0.166] &   [0.105, 0.164, 0.25] \\
	& $\theta$ &    [0.045, 0.009, 0.1] &    [0.042, 0.0, 0.096] \\
	\bottomrule
\end{tabular}

\begin{tabular}{llll}
	\toprule
	Germany&       &               Original &            Alternative \\
	\midrule
	$A(0, 1)+$ & $Y_0$ &                 -0.037 &                 -0.037 \\
	& $\delta$ &                  0.028 &                  0.028 \\
	& $k$ &                  0.105 &                  0.105 \\
	& $\nu$ &                  0.016 &                  0.016 \\
	$A(0, 2)+$ & $Y_0$ &       [-0.021, -0.094] &       [-0.022, -0.059] \\
	& $\delta$ &                    0.1 &                  0.025 \\
	& $k$ &         [0.428, 0.005] &         [0.063, 2.854] \\
	& $\nu$ &         [0.001, 0.001] &         [0.001, 0.219] \\
	& $\rho$ &                  0.641 &                   0.99 \\
	$A(1, 1)+$ & $X_0$ &                  0.053 &                  0.027 \\
	& $\alpha$ &                  0.077 &                  0.139 \\
	& $\delta$ &                 -0.062 &                 -0.036 \\
	& $\sigma$ &                  0.062 &                  0.009 \\
	& $\theta$ &                  0.098 &                  0.052 \\
	$A(2, 2)+$ & $X_0$ &         [0.016, 0.072] &         [0.012, 0.002] \\
	& $\alpha$ &         [0.061, 0.873] &         [0.005, 0.304] \\
	& $\delta$ &                 -0.098 &                 -0.028 \\
	& $\sigma$ &          [0.133, 0.15] &         [0.001, 0.221] \\
	& $\theta$ &          [0.09, 0.071] &           [0.1, 0.027] \\
	$A(3, 3)+$ & $X_0$ &  [0.045, 0.061, 0.001] &  [0.021, 0.036, 0.023] \\
	& $\alpha$ &    [0.008, 3.0, 0.565] &  [0.175, 0.001, 1.515] \\
	& $\delta$ &                   -0.1 &                 -0.086 \\
	& $\sigma$ &  [0.001, 0.181, 0.072] &   [0.033, 0.223, 0.25] \\
	& $\theta$ &    [0.1, 0.027, 0.035] &  [0.099, 0.087, 0.005] \\
	$A(3, 4)+$ & $X_0$ &    [0.057, 0.012, 0.1] &  [0.001, 0.082, 0.099] \\
	& $Y_0$ &                   -0.1 &                 -0.099 \\
	& $\alpha$ &    [2.183, 0.057, 3.0] &  [0.512, 0.613, 0.624] \\
	& $\delta$ &                 -0.071 &                   -0.1 \\
	& $k$ &                  1.182 &                  0.005 \\
	& $\nu$ &                  0.246 &                  0.001 \\
	& $\sigma$ &   [0.001, 0.001, 0.12] &   [0.242, 0.242, 0.25] \\
	& $\theta$ &  [0.001, 0.031, 0.081] &    [0.1, 0.058, 0.064] \\
	\bottomrule
\end{tabular}

\begin{tabular}{llll}
	\toprule
	France&       &               Original &            Alternative \\
	\midrule
	$A(0, 1)+$ & $Y_0$ &                 -0.049 &                 -0.049 \\
	& $\delta$ &                  0.039 &                  0.039 \\
	& $k$ &                  0.115 &                  0.115 \\
	& $\nu$ &                  0.021 &                  0.021 \\
	$A(0, 2)+$ & $Y_0$ &       [-0.088, -0.027] &       [-0.027, -0.088] \\
	& $\delta$ &                    0.1 &                    0.1 \\
	& $k$ &         [0.005, 0.348] &         [0.349, 0.005] \\
	& $\nu$ &         [0.001, 0.001] &         [0.003, 0.001] \\
	& $\rho$ &                  -0.99 &                  -0.65 \\
	$A(1, 1)+$ & $X_0$ &                  0.016 &                  0.053 \\
	& $\alpha$ &                  0.159 &                  0.107 \\
	& $\delta$ &                 -0.025 &                 -0.062 \\
	& $\sigma$ &                  0.006 &                  0.071 \\
	& $\theta$ &                  0.047 &                    0.1 \\
	$A(2, 2)+$ & $X_0$ &          [0.02, 0.064] &         [0.001, 0.001] \\
	& $\alpha$ &         [2.999, 0.131] &         [0.185, 0.004] \\
	& $\delta$ &                   -0.1 &                 -0.016 \\
	& $\sigma$ &         [0.179, 0.046] &         [0.231, 0.001] \\
	& $\theta$ &           [0.028, 0.1] &           [0.041, 0.1] \\
	$A(3, 3)+$ & $X_0$ &  [0.095, 0.001, 0.009] &  [0.001, 0.002, 0.076] \\
	& $\alpha$ &   [2.411, 1.31, 0.064] &  [0.004, 0.489, 0.725] \\
	& $\delta$ &                   -0.1 &                 -0.083 \\
	& $\sigma$ &    [0.1, 0.116, 0.039] &   [0.001, 0.143, 0.14] \\
	& $\theta$ &    [0.0, 0.095, 0.035] &    [0.098, 0.098, 0.0] \\
	$A(3, 4)+$ & $X_0$ &  [0.002, 0.012, 0.043] &  [0.016, 0.069, 0.001] \\
	& $Y_0$ &                  0.032 &                 -0.004 \\
	& $\alpha$ &   [0.012, 0.545, 2.65] &   [0.005, 2.999, 0.39] \\
	& $\delta$ &                 -0.087 &                 -0.075 \\
	& $k$ &                  0.963 &                  2.175 \\
	& $\nu$ &                  0.177 &                  0.001 \\
	& $\sigma$ &  [0.023, 0.218, 0.195] &   [0.001, 0.222, 0.16] \\
	& $\theta$ &  [0.049, 0.099, 0.021] &     [0.1, 0.034, 0.04] \\
	\bottomrule
\end{tabular}

\begin{tabular}{llll}
	\toprule
	Italy&       &               Original &            Alternative \\
	\midrule
	$A(0, 1)+$ & $Y_0$ &                 -0.048 &                 -0.048 \\
	& $\delta$ &                  0.039 &                  0.039 \\
	&  $k$ &                  0.378 &                  0.378 \\
	&  $\nu$ &                  0.001 &                  0.001 \\
	$A(0, 2)+$ & $Y_0$ &          [-0.1, 0.064] &          [0.062, -0.1] \\
	& $\delta$ &                  0.039 &                  0.041 \\
	& $k$ &         [0.511, 0.904] &         [0.919, 0.512] \\
	& $\nu$ &         [0.001, 0.001] &         [0.057, 0.001] \\
	& $\rho$ &                 -0.886 &                  0.173 \\
	$A(1, 1)+$ & $X_0$ &                  0.001 &                  0.001 \\
	& $\alpha$ &                  0.213 &                  0.213 \\
	& $\delta$ &                 -0.008 &                 -0.008 \\
	& $\sigma$ &                   0.25 &                   0.25 \\
	& $\theta$ &                  0.069 &                  0.069 \\
	$A(2, 2)+$ & $X_0$ &         [0.001, 0.051] &         [0.038, 0.011] \\
	& $\alpha$ &         [0.433, 0.647] &         [0.005, 0.318] \\
	& $\delta$ &                 -0.056 &                 -0.055 \\
	& $\sigma$ &         [0.137, 0.142] &         [0.021, 0.005] \\
	& $\theta$ &           [0.099, 0.0] &         [0.066, 0.057] \\
	$A(3, 3)+$ & $X_0$ &   [0.014, 0.018, 0.02] &  [0.001, 0.046, 0.011] \\
	& $\alpha$ &  [0.328, 1.651, 0.001] &  [0.028, 2.362, 0.385] \\
	& $\delta$ &                  -0.05 &                  -0.05 \\
	& $\sigma$ &   [0.09, 0.247, 0.018] &   [0.25, 0.087, 0.227] \\
	& $\theta$ &   [0.07, 0.004, 0.006] &  [0.076, 0.018, 0.069] \\
	$A(3, 4)+$ & $X_0$ &    [0.1, 0.001, 0.033] &  [0.047, 0.025, 0.086] \\
	& $Y_0$ &                 -0.077 &                   -0.1 \\
	& $\alpha$ &  [1.503, 2.256, 1.875] &  [1.761, 2.749, 1.214] \\
	& $\delta$ &                 -0.058 &                 -0.065 \\
	& $k$ &                  0.478 &                  0.525 \\
	& $\nu$ &                  0.009 &                  0.001 \\
	& $\sigma$ &  [0.249, 0.112, 0.197] &  [0.121, 0.234, 0.016] \\
	& $\theta$ &    [0.0, 0.046, 0.052] &    [0.011, 0.094, 0.0] \\
	\bottomrule
\end{tabular}

\section{Actual prices and calibrated prices of default models}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.8\linewidth]{pic/OISvsSWAP}
	\caption{Calibration and actual prices for OIS and swap rate}
	\label{fig:OISvsSWAP}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.8\linewidth]{pic/OISvsITA}
	\caption{Calibration and actual prices for OIS and Italy}
	\label{fig:OISvsSWAP}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.8\linewidth]{pic/GERvsFRA}
	\caption{Calibration and actual prices for Germany and France}
	\label{fig:GERvsFRA}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.8\linewidth]{pic/GERvsITA}
	\caption{Calibration and actual prices for Germany and Italy}
	\label{fig:GERvsITA}
\end{figure}

\section{Relative errors of default models}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/credit_relative_errors}
	\caption{Relative calibration errors for credit risk models}
	\label{fig:credit_relative_errors}
\end{figure}

\begin{figure}[H]
	\centering
	\includegraphics[width=1\linewidth]{pic/credit_absolute_errors}
	\caption{Absolute relative calibration errors for credit risk models}
	\label{fig:credit_absolute_errors}
\end{figure}

\section{Comparison of calibrated parameters for affine models with default risk}

\label{default parameter_comparision}

\begin{table}[H]
	\centering
	\caption{Overnight index swap and swap curve}
	\label{ois_swap}

	\begin{adjustbox}{width=\textwidth}

\begin{tabular}{lllllll}
	\toprule
	{} & (0, 0, 1),(0, 1, 0) & (0, 0, 1),(1, 0, 0) & (1, 0, 0),(1, 0, 0) & (1, 0, 0),(0, 1, 0) & (0, 0, 0),(0, 1, 1) & (0, 0, 0),(1, 1, 0) \\
	\midrule
	LGD    &                0.97 &               0.426 &               0.441 &               0.435 &               0.776 &               0.748 \\
	$X_0$    &                0.01 &               0.047 &               0.001 &               0.013 &                 NaN &                 NaN \\
	$Y_0$    &              -0.032 &              -0.036 &              -0.033 &              -0.036 &      [-0.032, 0.01] &     [0.012, -0.036] \\
	$a_m$    &                 [0] &                 [0] &                 [1] &                 [1] &                  [] &                  [] \\
	$\alpha$  &                   3 &               0.544 &               0.228 &               2.857 &                 NaN &                 NaN \\
	$b_m$    &                 [1] &                 [1] &                 [1] &                 [1] &                  [] &                  [] \\
	$c_i$    &                 [1] &                 [1] &                 [1] &                 [1] &              [1, 0] &              [1, 1] \\
	$d_i$    &                 [0] &                 [1] &                 [1] &                 [0] &              [0, 1] &              [1, 0] \\
	$\delta$  &               0.017 &               0.017 &               0.005 &               0.017 &               0.017 &               0.017 \\
	$k$      &               0.314 &               0.384 &               2.508 &               0.342 &      [0.321, 2.727] &       [2.48, 0.342] \\
	$\nu$     &               0.001 &               0.002 &               0.219 &               0.001 &       [0.007, 0.25] &      [0.001, 0.001] \\
	$\rho$    &                 NaN &                 NaN &                 NaN &                 NaN &               -0.99 &               0.258 \\
	$\sigma$  &               0.041 &               0.041 &               0.032 &               0.161 &                 NaN &                 NaN \\
	spread &               0.002 &               0.002 &               0.002 &               0.002 &               0.004 &               0.002 \\
	$\theta$  &                   0 &                   0 &               0.015 &                   0 &                 NaN &                 NaN \\
	\bottomrule
\end{tabular}

	\end{adjustbox}

\end{table}

\begin{table}[H]
	\centering
	\caption{Overnight index swap and Italy}
	\label{ois_italy}

	\begin{adjustbox}{width=\textwidth}

\begin{tabular}{lllllll}
	\toprule
	{} & (0, 0, 1),(0, 1, 0) & (0, 0, 1),(1, 0, 0) & (1, 0, 0),(1, 0, 0) & (1, 0, 0),(0, 1, 0) & (0, 0, 0),(0, 1, 1) & (0, 0, 0),(1, 1, 0) \\
	\midrule
	LGD    &               0.294 &               0.798 &                0.95 &               0.766 &               0.911 &                0.56 \\
	$X_0$    &               0.004 &               0.037 &               0.049 &               0.001 &                     &                     \\
	$Y_0$    &              -0.031 &              -0.038 &              -0.056 &               0.021 &    [-0.046, -0.071] &    [-0.023, -0.017] \\
	$a_m$    &                 [0] &                 [0] &                 [1] &                 [1] &                  [] &                  [] \\
	$\alpha$  &               0.577 &               1.335 &               2.601 &               0.146 &                     &                     \\
	$b_m$    &                 [1] &                 [1] &                 [1] &                 [1] &                  [] &                  [] \\
	$c_i$    &                 [1] &                 [1] &                 [1] &                 [1] &              [1, 0] &              [1, 1] \\
	$d_i$    &                 [0] &                 [1] &                 [1] &                 [0] &              [0, 1] &              [1, 0] \\
	$\delta$  &               0.017 &               0.024 &               0.004 &              -0.016 &               0.017 &               0.017 \\
	$k$      &               0.303 &               0.276 &               0.736 &               2.761 &       [0.596, 2.63] &      [0.316, 2.403] \\
	$\nu$     &               0.001 &               0.032 &                0.01 &                0.17 &      [0.007, 0.151] &      [0.016, 0.141] \\
	$\rho$    &                     &                     &                     &                     &              -0.594 &              -0.896 \\
	$\sigma$  &               0.014 &               0.066 &               0.212 &               0.234 &                     &                     \\
	spread &               0.001 &               0.007 &               0.013 &               0.001 &               0.023 &               0.025 \\
	$\theta$  &               0.022 &               0.035 &               0.012 &                0.06 &                     &                     \\
	\bottomrule
\end{tabular}

	\end{adjustbox}

\end{table}

\begin{table}[H]
	\centering
	\caption{Germany and Italy}
	\label{germany_italy}

	\begin{adjustbox}{width=\textwidth}

		\begin{tabular}{lllllll}
			\toprule
			{} & (0, 0, 1),(0, 1, 0) & (0, 0, 1),(1, 0, 0) & (1, 0, 0),(1, 0, 0) & (1, 0, 0),(0, 1, 0) & (0, 0, 0),(0, 1, 1) & (0, 0, 0),(1, 1, 0) \\
			\midrule
			LGD    &               0.354 &               0.583 &               0.665 &               0.605 &                0.37 &               0.328 \\
			$X_0$    &               0.003 &               0.083 &               0.001 &               0.001 &                     &                     \\
			$Y_0$    &              -0.028 &              -0.042 &              -0.006 &              -0.018 &    [-0.028, -0.022] &    [-0.022, -0.063] \\
			$a_m$    &                 [0] &                 [0] &                 [1] &                 [1] &                  [] &                  [] \\
			$\alpha$  &                0.87 &               1.809 &                0.04 &               0.591 &                     &                     \\
			$b_m$    &                 [1] &                 [1] &                 [1] &                 [1] &                  [] &                  [] \\
			$c_i$    &                 [1] &                 [1] &                 [1] &                 [1] &              [1, 0] &              [1, 1] \\
			$d_i$    &                 [0] &                 [1] &                 [1] &                 [0] &              [0, 1] &              [1, 0] \\
			$\delta$  &               0.014 &               0.013 &              -0.011 &              -0.002 &               0.014 &               0.023 \\
			$k$      &               0.237 &               0.485 &                1.88 &               0.175 &      [0.237, 0.883] &      [1.803, 0.631] \\
			$\nu$     &               0.001 &               0.005 &               0.005 &               0.001 &      [0.001, 0.001] &      [0.063, 0.087] \\
			$\rho$    &                     &                     &                     &                     &              -0.348 &               0.012 \\
			$\sigma$  &               0.111 &               0.115 &                0.18 &               0.023 &                     &                     \\
			spread &               0.001 &               0.024 &               0.013 &               0.009 &               0.026 &               0.027 \\
			$\theta$  &               0.025 &               0.002 &               0.094 &               0.016 &                     &                     \\
			\bottomrule
		\end{tabular}

	\end{adjustbox}

\end{table}

\begin{table}[H]
	\centering
	\caption{Germany and France}
	\label{germany_france}

	\begin{adjustbox}{width=\textwidth}

\begin{tabular}{llllll}
	\toprule
	{} & (0, 0, 1),(0, 1, 0) & (0, 0, 1),(1, 0, 0) & (1, 0, 0),(1, 0, 0) & (0, 0, 0),(0, 1, 1) & (0, 0, 0),(1, 1, 0) \\
	\midrule
	LGD    &               0.817 &               0.891 &                   1 &               0.596 &               0.263 \\
	$X_0$    &               0.001 &                0.01 &               0.008 &                     &                     \\
	$Y_0$    &              -0.039 &              -0.027 &              -0.016 &    [-0.038, -0.011] &    [-0.008, -0.031] \\
	$a_m$    &                 [0] &                 [0] &                 [1] &                  [] &                  [] \\
	$\alpha$  &               0.116 &               0.001 &               0.029 &                     &                     \\
	$b_m$    &                 [1] &                 [1] &                 [1] &                  [] &                  [] \\
	$c_i$    &                 [1] &                 [1] &                 [1] &              [1, 0] &              [1, 1] \\
	$d_i$    &                 [0] &                 [1] &                 [1] &              [0, 1] &              [1, 0] \\
	$\delta$  &               0.029 &               0.019 &              -0.009 &               0.029 &               0.023 \\
	$k$      &               0.116 &               0.127 &                2.98 &       [0.103, 1.38] &      [2.307, 0.105] \\
	$\nu$     &               0.018 &               0.008 &                0.25 &      [0.016, 0.034] &      [0.094, 0.016] \\
	$\rho$    &                     &                     &                     &              -0.978 &              -0.853 \\
	$\sigma$  &               0.008 &               0.163 &               0.085 &                     &                     \\
	spread &                   0 &               0.013 &                   0 &               0.003 &               0.004 \\
	$\theta$  &               0.007 &               0.022 &               0.079 &                     &                     \\
	\bottomrule
\end{tabular}

	\end{adjustbox}

\end{table}

\section{Dynamic Euribor calibration without credit risk}

\begin{figure}[H]
	\centering
	\includegraphics[width=0.75\linewidth]{pic/euribor_errors_by_maturities}
	\caption{Relative errors in Euribor fitting by maturities.}
	\label{fig:euribor_errors_by_maturities}
\end{figure}


\documentclass{article}
%\documentclass[prl,amsmath,amssymb]{revtex4} % PRL

% margins of 1 inch:
\setlength{\topmargin}{-.5in}
\setlength{\textheight}{9in}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.5in}

\usepackage[pdftex]{hyperref} % hyperlink equation and bibliographic citations
\usepackage[dvips]{graphicx,color}
\usepackage{amsmath} % advanced math
\usepackage{verbatim}
\usepackage{natbib} % bibilography
\usepackage{mciteplus} % collapse multiple citations in bibilography
\usepackage{multicol}
\usepackage[toc,page]{appendix} % http://tex.stackexchange.com/questions/49643/making-appendix-for-thesis

% from http://www.flakery.org/search/show/569
%\newcommand{\infint}{\ensuremath{\int_{-\infty}^{\infty}}}
\newcommand{\cf}{\textit{c.f.}} % "compare". In context the abbreviation advises readers to consult other material, drawing attention to related ideas that provide additional arguments or information.
\newcommand{\ie}{\textit{i.e.}} % i.e. is used to explain, clarify or rephrase a statement
\newcommand{\eg}{\textit{e.g.}} % “for the sake of example”. Used to introduce an example or list of examples to illustrate what is being discussed.
\newcommand{\eqn}[1]{Eq.\ (\ref{#1})}
\newcommand{\pfrac}[2]{\ensuremath{\frac{\partial #1}{\partial #2}}}
\newcommand{\pdg}{Physics Derivation Graph}

\begin{document}
\title{Introduction to the \pdg}

\author{Ben Payne$^{1}$\footnote{Corresponding author: ben.is.located@gmail.com}, Michael Goff$^{2}$\\
{\it $^{1}$Department of Fun, University Name \& Town, city, State Zip}\\
{\it $^{2}$Department of Mathematics, University of Maryland, Baltimore 21228}}

\date{\today}

\maketitle % declares end of title page
\begin{abstract}
An overview of the project. No prior background on this project is assumed. General knowledge of Physics and Mathematics at the first year college level is expected.
\end{abstract}

\begin{multicols}{2}

\tableofcontents

%\newpage

% Introduction: scope = ?

\section{Introduction\label{sec:intro}}

% relevant project background
The \pdg\ is an effort to capture mathematical physics knowledge.

Historically, knowledge about physics has been recorded in the form of notes, letters, journal articles, and text books.
The content is typically composed of text, equations, and pictures.
The presentation is in a linear sequence, though references are often made to link the current section with previous sections and later sections.

A recent addition to the toolset for capturing knowledge has been the use of linked webpages.
A primary example of this is Wikipedia, an \href{https://en.wikipedia.org/wiki/HTML}{HTML}-based encyclopedia.
Webpages such as Wikipedia still use text, equations, and pictures, but add a distinct capability: hyperlinks.
Hypertext Markup Language offers the ability to connect content to any other content.
This enables non-linear exploration of content, in contrast to a textbook which is designed to be read sequentially.
The \pdg\ applies the concept of non-linear documentation to mathematical physics content.

A \href{https://en.wikipedia.org/wiki/Graph_(mathematics)}{graph} is composed of nodes and edges. The graph associated with the \pdg\ has two essential types of nodes: mathematical expressions and inference rules. Every mathematical expression is connected to an inference rule by a directed edge. An example is provided here which illustrates the concepts.

\subsection{Example Derivation Step\label{sec:example}}
Derivations in Physics are composed of steps.
Each step involves one or more expressions, and one inference rule.
Inference rules are described in section~\ref{sec:inference_rules}.

Frequency $f$ and period $T$ are related by
\begin{equation}
T\ f = 1
\label{eq:period_and_freq}
\end{equation}
Thus, frequency in terms of the period is
\begin{equation}
f = 1/T
\label{eq:freq_is_inverse_period}
\end{equation}
The relation between \eqn{eq:period_and_freq} and \eqn{eq:freq_is_inverse_period} is that both sides of \eqn{eq:period_and_freq} were divided by $T$.

In the above example, there are two mathematical expressions: \eqn{eq:period_and_freq} and \eqn{eq:freq_is_inverse_period}.
These expressions are related by an inference rule: ``Divide both sides of first expression by a scalar value to yield the second expression.''
This inference rule takes an argument, referred to here as the ``feed'', which in this example is $T$.
This set of steps is shown graphically in~Fig.~\ref{fig:freq_period}

\begin{center}
\begin{figure}
%\includegraphics[scale=1]{images/frequency_period_relation.png}
\caption{Relation between period $T$ and frequency $f$.\label{fig:freq_period}}
\end{figure}
\end{center}

\section{Graph content\label{sec:content}}

The content associated with the \pdg\ takes the form of expressions (\textit{equations and inequalities}), symbols, and inference rules. \textit{An inference rule is an atomic transformation of one expression to another.} In the example provided in section~\ref{sec:example}, the two expressions are~\eqn{eq:period_and_freq} and~\eqn{eq:freq_is_inverse_period}. The symbols are period $T$ and frequency $f$. The inference rule being applied is ``Divide both sides of first equation by a value to yield the second equation.'' This inference rule takes an argument, referred to here as the ``feed'', which in this example is $T$. This simple step between two expressions is documented in five separate databases: expressions, symbols, feeds, inference rules, and connections.

Each expression, symbol, and inference rule appears only once in the respective database. Each time an expression, symbol, or inference rule is used in a derivation, that unique instance is referenced. That referencing of unique nodes is what constructs the graph. For example, if \eqn{eq:period_and_freq} is used in two distinct derivations, the same expression is referenced. Similarly, when the symbol $T$ is used in any derivation, it refers to period. This referencing of unique expressions, symbols, and inference rules is done using a numeric identifier (alphanumeric for inference rules). This uniqueness of expressions, symbols, and inference rules is the core utility of the \pdg. This results in no duplication and fixed references (a static directed graph). The \pdg\ is designed to show one instance of each expression, but feeds and inference rules will have duplicates on the graph.

Symbol re-use is common in science and can be addressed by the use of unique identifiers. For example, $c$ is typically used to stand for the speed of light, but the same symbol is also used in the quadratic equation
\begin{equation}
a x^2+b x+c =0.
\label{eq:quadratic}
\end{equation}
In this expression, we are not referring to the speed of light. This is distinguishable in the \pdg\ because the $c$ referring to the speed of light has a different numeric identifier than the $c$ in \eqn{eq:quadratic}.

% inference rules
Inference rules are necessary to perform derivations in physics, but have received little attention as they are typically left to the field of logic. One result of an education in mathematics is building a library of inference rules, though that is not the common description in the field of math education. In Physics, knowing that it is valid to multiply both sides of an expression by one is assumed to have been learned in a math course. In the math course, the inference rule of multiplying both sides of an expression by one is taught with the common explanation that students need that inference rule to solve the relevant problems provided in the class.
%These inference rules are a significant source of confusion and a source of error when used. Using inference rules correctly and applying them atomically are tasks which take patience and practice.
One of the consequences of constructing the \pdg\ is the enumeration of inference rules necessary for Physics.

\section{Inference Rules\label{sec:inference_rules}}

Inference rules operate on expressions to produce new expressions. In section~\ref{sec:example}, the inference rule between \eqn{eq:period_and_freq} and \eqn{eq:freq_is_inverse_period} is ``Divide both sides of first expression by a scalar value to yield the second expression.''

Inference rules for the \pdg\ are designed to meet a threshold -- can the computer algebra system validate that the claim is true?

Inference rules are useful for catching simple mistakes by CAS validation. Common mistakes include not carrying the negative symbol through a derivation or unintentionally dropping a term. The inference rules are atomic (simplest step possible) and first order -- they only relate nearest-neighbor expressions.

\section{Administrivia}
General notes about the \pdg\ are provided here.
\subsection{Scope of Project\label{sec:scope}}

The core of the \pdg\ is documenting the graph associated with mathematical physics. Once this content is available, there are many potential tasks. The following section (\ref{sec:stages}) provides a specific set of stages for potential future work. Not expected within the scope of the \pdg\ are inclusion of graphics, explanatory text, animations of concepts, and interactive models.

Tasks in section~\ref{sec:stages} such as checking the validity of the graph using a Computer Algebra System, visualization of the graph, and interactivity of input are follow-on tasks once the graph content has been developed to describe mathematical physics.

\subsection{Access to Content\label{sec:access}}

The \pdg\ is free and open source under the Creative Commons Attribution-ShareAlike 3.0 Unported license. This content is free because it is intended to be accessible to anyone; cost should not be a barrier to access. The content is open source so that other researchers can build upon what exists. Once content is built, it should not need to be built again.

\subsection{Similar Projects\label{sec:similar_projects}}

The scope and intention of the \pdg\ is unique, though aspects are shared by several active projects. Five examples are provided in this section: HyperPhysics, EquationMap, Formula Database, Symbolab, and Wolfram Alpha. The purpose is not to review these projects for utility or to comprehensively survey similar work. Instead, they are used here to contrast the scope and intention of the \pdg.

The HyperPhysics website\cite{2015_Hyperphysics} is a static set of linked concept maps for topics in Physics. Concept maps are linked to text, graphs, and equations. The licensing of the content is described as ``not freeware or shareware'' by the author, though the site is free to access. Although hyperlinked concept maps are a departure from the standard textbook presentation of physics, the leaves of this tree are the same content found in textbooks.

The website EquationMap\cite{2015_EquationMap} is an interface for derivations, focused primarily on mathematical sciences. There is no backend database of content; instead content is dynamically generated by the user. Equations are manually entered using \LaTeX syntax and the graph of the derivation can be visualized using the same interface. The content is not open source and access is currently free. This is close to what the GUI for the \pdg\ is intended to behave like, with the exception that EquationMap doesn't include the concept of atomic inference rules.

Formula Database\cite{2015_FormulaDatabase} is a website described by the authors as a ``math search engine'' which has a built-in equation editor. The search feature is not just matching the Latex input -- it understands dot product and cross product. They have created a browser-based equation editor, similar to the equation editor in Microsoft Word. The search is of a backend database of content. The backend database of equations and symbols was manually entered by the project authors. A team of people have been working since about 2010 on this project. The data is stored as a high-dimensional graph. This project is not open source but access is currently free. A commercial launch is planned, though no date has been publicized.

The objective is to allow students to search through literature. If you are a researcher, you might want to find whether the model already exists in literature. The grand view is that formula-database will serve as a universal reference for equations.

SymboLab\cite{2015_Symbolab} is another backend database of content. This project is not open source but access is currently free.

Wolfram Alpha\cite{2015_WolframAlpha} has a backend database of content which is not open source; access is a mix of free and paid.

\section{Development Stages\label{sec:stages}}

This project is expected to evolve through distinct steps. Each step can be characterized by different users and associated requirements.

% \subsection{Gathering Examples}
The first step is prototyping and involves a small number of expert users interested in gathering content for the \pdg. This exploratory phase involves research on appropriate syntax for the graph, brainstorming use cases, and minimal interaction with an external community. This is the current status of the project.

% \subsection{Proof of Concept}
The second phase is when sufficient examples exist to constitute a proof of concept. This requires breadth of coverage across all the domains of physics (\ie, classical mechanics, quantum mechanics, relativity, thermodynamics, statistical mechanics, etc). As a consequence, much of mathematics covered up to undergraduate level is likely to be required.

% \subsection{Interface Creation}
Once the breadth of coverage is demonstrated, the next step is to enable development of in-depth creation for the \pdg. Currently, content is manually entered into an CSV database, and visualization of the graph is generated via the command line. To make both data entry and visualization more accessible to users and developers, a web browser-based interaction is planned. As noted in section~\ref{sec:scope}, this is outside of the project scope regarding graph content, but would make addition of content more accessible. Graph visualization libraries which are free and opensource are available, making this issue tractable. New standards such as HTML5 and libraries like d3js will be investigated to determine suitability.

% \subsection{Community Utilization}
Adoption and utilization by the scientific and education communities is the intended outcome. Widespread use is dependent on having useful and reliable content, intuitive interfaces, and addressing a need. The \pdg\ does not currently exist, implying the needs being addressed are either unclear or sufficiently complex to make solution difficult.

The steps listed above are intended to be worked on concurrently. Exploration of an intuitive interface can take place while examples are being gathered. In the next section, use cases which motivate users of this project are described.

\section{Use Cases\label{sec:use_cases}}

While curiosity has driven the development of the \pdg, the resulting work is expected to be useful to multiple audiences and users. Viewers of the content could include students in math and physics, and analysis of the content could help shape curriculum. Contributors to the \pdg\ would be scientists who add new developments based on their work.

\subsection{Students in Math and Physics}

Currently students in Math and Physics are taught content using lectures, textbooks, and homework. The method of presentation varies, but the overarching story is often historically driven. Algebra is old, calculus is newer, and topology is recent. Classical mechanics is old, thermodynamics is newer, and quantum mechanics is recent. When teaching, these subjects are taught by building on previous content -- calculus leverages algebra, thermodynamics leverages classical mechanics.

\subsection{Scientific Articles}

Peer-reviewed journal articles are one of the current methods of demonstrating value in the scientific community. Conciseness is a feature of this writing style, and the mathematics presented is correspondingly sparse -- just sufficient to covey the author's intention. This results in a burden on the reader of the article, either to take the author's claims on faith, or to rederive the mathematical expressions. A reader's derivation is complicated by implicit assumptions made by the author and unintentional mistakes in calculation.

With journals allowing supplemental materials for articles, calculations could be included. However, it is not clear what the appropriate level of detail is in supplied calculations. The intention is to be able to reproduce the work, but

validation via computer

\subsection{Education Curriculum Design}

A less direct use case but potentially important impact of the \pdg\ is on understanding the relevance of what is being taught in the education system. Math classes essentially teach a set of inference rules, and physics is the application of those inference rules. The \pdg\ could answer two important questions: ``When am I going to use this inference rule?'' and ``What's the relative importance of this math skill?''

The focus for students in mathematics classes is on the technique, \ie, ``integrate both sides with respect to $Y$,'' and application is necessarily of secondary importance. Physics students are expected to know the mathematical techniques and teaching is focused on application. The \pdg\ can assist both scenarios. The student in a math class can see where the inference rules they learn are applied in Physics. The student in the Physics class can see which inference rules are required in their field.

Each inference rule seems equally important, since it currently isn't known what the frequency of use for that inference rule is. From the \pdg, it is simple to count utilization of inference rules. Thus, we are able to measure the ratio of how often ``multiply both sides by X'' is used relative to ``integrate both sides with respect to $Y$.''

\section{Summary\label{sec:summary}}
This article provides an introduction to the \pdg.

\section{Bibliography}

\bibliographystyle{unsrt}
\bibliography{../bibliography} % external bibtex flat-file database
\end{multicols}

\newpage
\appendix
%\begin{appendices}
%\include{appendix_test_cases}
%\end{appendices}

\end{document}


\documentclass[../psets.tex]{subfiles}

\pagestyle{main}
\renewcommand{\leftmark}{Problem Set \thesection}
\setcounter{section}{1}

\begin{document}

\section{Sound and Light}
\begin{enumerate}[label={\arabic*)}]
    \item \marginnote{8/12:}\textcite{bib:YoungFreedman}: Problem 15.25.\par
    A jet plane at takeoff can produce sound of intensity $\SI{10.0}{\watt\per\square\meter}$ at $\SI{30.0}{\meter}$ away. But you prefer the tranquil sound of normal conversation, which is $\SI{1.0}{\micro\watt\per\square\meter}$. Assume that the plane behaves like a point source of sound.
    \begin{enumerate}
        \item What is the closest distance you should live from the airport runway to preserve your peace of mind?
        \item What intensity from the jet does your friend experience if she lives twice as far from the runway as you do?
        \item What power of sound does the jet produce at takeoff?
    \end{enumerate}
    \item \textcite{bib:YoungFreedman}: Problem 15.28.\par
    \textbf{Reflection.} A wave pulse on a string has the dimensions shown in the following figure at $t=0$. The wave speed is $\SI{40}{\centi\meter\per\second}$.
    \begin{center}
        \begin{tikzpicture}[scale=1.2]
            \footnotesize
            \draw [orx,very thick] (0,0) -- (2,0) -- (3,1) -- (4,0) -- (6,0) node[circle,fill=pix,inner sep=1.5pt,label={[black]right:$O$}]{};

            \draw [very thin,|-|] (1.85,0.05) -- node[left]{$\SI{4.0}{\milli\meter}$} ++(0,0.95);
            \draw [very thin,|-|] (2,1.15) -- node[above]{$\SI{4.0}{\milli\meter}$} ++(1,0);
            \draw [very thin,|-|] (3,1.15) -- node[above]{$\SI{4.0}{\milli\meter}$} ++(1,0);
            \draw [very thin,|-|] (4,0.2) -- node[above]{$\SI{8.0}{\milli\meter}$} ++(2,0);

            \draw [grx,ultra thick,-latex] (4.7,0.8) -- node[above,black]{$v=\SI{40}{\centi\meter\per\second}$} ++(1,0);
        \end{tikzpicture}
    \end{center}
    \begin{enumerate}
        \item If point $O$ is a fixed end, draw the total wave on the string at $t=\SI{15}{\milli\second}$, $\SI{20}{\milli\second}$, $\SI{25}{\milli\second}$, $\SI{30}{\milli\second}$, $\SI{35}{\milli\second}$, $\SI{40}{\milli\second}$, and $\SI{45}{\milli\second}$.
        \item Repeat part (a) for the case in which point $O$ is a free end.
    \end{enumerate}
    \item \textcite{bib:YoungFreedman}: Problem 16.24.\par
    The fundamental frequency of a pipe that is open at both ends is $\SI{524}{\hertz}$.
    \begin{enumerate}
        \item How long is the pipe?
    \end{enumerate}
    If one end is now closed, find the new fundamental's
    \begin{enumerate}[resume]
        \item Wavelength;
        \item Frequency.
    \end{enumerate}
    \item \textcite{bib:YoungFreedman}: Problem 16.35.\par
    Two loudspeakers, $A$ and $B$, are driven by the same amplifier and emit sinusoidal waves in phase. Speaker $B$ is $\SI{12.0}{\meter}$ to the right of speaker $A$. The frequency of the waves emitted by each speaker is $\SI{688}{\hertz}$. You are standing between the speakers, along the line connecting them, and are at a point of constructive interference. How far must you walk toward speaker $B$ to move to a point of destructive interference?
    \item \textcite{bib:YoungFreedman}: Problem 16.50.\par
    The siren of a fire engine that is driving northward at $\SI{30.0}{\meter\per\second}$ emits a sound of frequency $\SI{2000}{\hertz}$. A truck in front of this fire engine is moving northward at $\SI{20.0}{\meter\per\second}$.
    \begin{enumerate}
        \item What is the frequency of the siren's sound that the fire engine driver hears reflected from the back of the truck?
        \item What wavelength would this driver measure for these reflected sound waves?
    \end{enumerate}
    \item \textcite{bib:YoungFreedman}: Problem 16.62.\par
    A bat flies toward a wall, emitting a steady sound of frequency $\SI{1.70}{\kilo\hertz}$. This bat hears its own sound plus the sound reflected by the wall. How fast should the bat fly in order to hear a beat frequency of $\SI{8.00}{\hertz}$?
    \item \textcite{bib:YoungFreedman}: Problem 33.39.\par
    A ray of light is incident in air on a block of a transparent solid whose index of refraction is $n$. If $n=1.38$, what is the \emph{largest} angle of incidence $\theta_a$ for which total internal reflection will occur at the vertical face (point $A$ in the below figure)?
    \begin{center}
        \begin{tikzpicture}[scale=0.6]
            \footnotesize
            \filldraw [very thin,fill=blt] (0,0) rectangle (3,4);
            \draw [densely dashed] (1.5,5) -- (1.5,4) coordinate (B) -- (1.5,3);

            \draw [rex,thick,-latex] (3,5) coordinate (A) -- (1.5,4) coordinate (C) -- (0,1.5) node[left,black]{$A$};
            \pic [draw,<-,angle radius=4mm,angle eccentricity=1.5,pic text={$\theta_a$}] {angle=A--B--C};
        \end{tikzpicture}
    \end{center}
    \item \textcite{bib:YoungFreedman}: Problem 33.52.\par
    Light is incident in air at an angle $\theta_a$ on the upper surface of a transparent plate, the surfaces of the plate being plane and parallel to each other.
    \begin{center}
        \begin{tikzpicture}
            \footnotesize
            \filldraw [very thin,fill=blt] (0,0) rectangle (5,2);
            \draw [very thin,|-|]
                (-0.2,0) node[below right,xshift=4mm]{$n$}
                --       node[right      ,xshift=4mm]{$n'$} node[fill=white,inner sep=2pt]{$t$}
                ++(0,2)  node[above right,xshift=4mm]{$n$}
            ;

            \draw [very thin,densely dash dot]
                (1.65,1)   coordinate (p11)
                -- ++(0,2) coordinate (p12)
            ;
            \draw [very thin,densely dash dot]
                (3.15,-1)  coordinate (p21)
                -- ++(0,2) coordinate (p22)
            ;
            \draw [very thin,densely dashed]
                (3.15,0) node[below left]{$P$}
                -- ++(0.5,1) node[above right]{$Q$}
            ;
            \draw [very thin,<->,shorten >=1pt,shorten <=1pt] (4.85,-0.85) -- node[fill=white,inner sep=2pt]{$d$} ++(0.5,1);

            \draw [
                rex,thick,postaction={decorate},
                decoration={
                    markings,
                    mark={at position 0.15 with {\arrow{latex}}},
                    mark={at position 0.85 with {\arrow{latex}}}
                }
            ]
                (-0.35,3)     coordinate (A)
                -- ++(2,-1)   coordinate (B)
                -- ++(1.5,-2) coordinate (C)
                -- ++(2,-1)   coordinate (D)
            ;
            \draw [rex,thick,densely dashed] (1.65,2) -- ++(4,-2);

            \pic [draw,->,shorten >=1pt,angle eccentricity=1.5,pic text={$\theta_a$},pic text options={yshift=1pt}] {angle=p12--B--A};
            \pic [draw,->,shorten >=1pt,angle eccentricity=1.5,pic text={$\theta_b'$},pic text options={yshift=-1pt}] {angle=p11--B--C};
            \pic [draw,->,shorten >=1pt,angle eccentricity=1.5,pic text={$\theta_b$},pic text options={yshift=1pt}] {angle=p22--C--B};
            \pic [draw,->,shorten >=1pt,angle eccentricity=1.5,pic text={$\theta_a'$},pic text options={yshift=-1pt}] {angle=p21--C--D};
        \end{tikzpicture}
    \end{center}
    \begin{enumerate}
        \item Prove that $\theta_a=\theta'_a$.
        \item Show that this is true for any number of different parallel plates.
        \item Prove that the lateral displacement $d$ of the emergent beam is given by the relationship
        \begin{equation*}
            d = t\cdot\frac{\sin(\theta_a-\theta'_b)}{\cos\theta_b'}
        \end{equation*}
        where $t$ is the thickness of the plate.
        \item A ray of light is incident at an angle of $\ang{66.0}$ on one surface of a glass plate $\SI{2.40}{\centi\meter}$ thick with an index of refraction of 1.80. The medium on either side of the plate is air. Find the lateral displacement between the incident and emergent waves.
    \end{enumerate}
    \item An airplane has a defective speedometer. In order to figure out how fast the plane is flying, the pilot (an aspiring opera singer) leans out the window and sings "middle C" (a note of frequency $\SI{262}{\hertz}$) at a mountain looming ahead. The echo off the mountain is heard by the pilot as "middle A" (frequency $\SI{440}{\hertz}$). How fast is the plane flying?
\end{enumerate}

\end{document}