\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath, amssymb, graphics, setspace}
\setlength\parindent{0pt}
\begin{document}

Quick tips before trying to solve the OLG model.
\begin{enumerate}
    \item Determine whether the zero steady state is possible: \\
    If $f(0) = 0$ (or, equivalently, $w(0) = 0$), then the zero (autarky) steady state exists.
    It may be stable or unstable, but it exists.
    \begin{itemize}
    \item Cobb-Douglas production function:\\
    $f(k) = k^\alpha \implies f(0) = 0$
    \item CES production function: \\
        \textbf{Important remark}: verify the exact functional form of the production function, in particular how the exponents are written.\\
        $f(k) = (\alpha k^\rho +(1-\alpha))^\frac{1}{\rho}$
        \begin{itemize}
            \item Complementary inputs ($\rho < 0$)\\
            $\lim_{k \rightarrow 0} f(k) = 0,$ assuming $\rho<0,\alpha \in (0,1).$
        \item Substitue inputs ($\rho > 0$)\\
            $\lim_{k \rightarrow 0} f(k) = (1-\alpha)^\frac{1}{\rho},$ assuming $\rho>0,\alpha \in (0,1).$
        \end{itemize}
    \end{itemize}

    \item Determine whether the interest rate appears in the savings function:
        \begin{itemize}
            \item If log-utility, the interest rate does not appear.\\
                $u(c) = \log (c) \implies u^\prime(c) = \frac{1}{c}$ \\
                The savings function is obtained in this case by solving:\\
                $u^\prime(w-s) = \beta R u^\prime(Rs)$ so $s = \frac{\beta}{1+\beta}w$
            \item Under a CIES, $R$ appears in the savings function:\\
                $u^\prime(c) = x^\frac{-1}{\sigma}$ \\
                The savings function is obtained in this case by solving:\\
                $(w-s)^\frac{-1}{\sigma} = \beta R (Rs)^\frac{-1}{\sigma}$ \\
                $s = \frac{w}{1+\beta^{-\sigma}R^{1-\sigma}}$
        \end{itemize}
\end{enumerate}

\section*{Examples}
\subsection*{Example 1}
Production function:    $f(k)=k^{0.5}$

Utility function:       $u(c)=2 \sqrt{c}$

Savings function:       $s(w(k_t),f^\prime(k_{t+1}))=\frac{16. R w}{25.\, +16. R}$

Substituting: $s(w(k_t),f^\prime(k_{t+1}))= \frac{4.}{25.\, +\frac{8.}{k^{0.5}}}$

Steady States:          Solve $k_{t+1} = \frac{1}{1+n}s(w(k_t),f^\prime(k_{t+1}))$

With the parameters: $\{k\to 0.\},\{k\to 0.0733398\}$

Stability:             Compute the derivative of $k_{t+1}$ with respect to $k_t$ and evaluate at each steady state.

With the parameters:

\quad Steady state 1, Capital level: $0$. Derivative=$\infty$ Unstable.

\quad Steady state 2, Capital level: $0.0733398$ Derivative=$0.406773$ Stable.

\includegraphics{xamples_gr1.eps}
\subsection*{Example 2}
Production function:    $f(k)=\frac{1}{\sqrt{0.5\, +\frac{0.5}{k^2}}}$

Utility function:       $u(c)=2 \sqrt{c}$

Savings function:       $s(w(k_t),f^\prime(k_{t+1}))= \frac{16. R w}{25.\, +16. R}$

Substituting:           $s(w(k_t),f^\prime(k_{t+1}))= \frac{8. \left(\frac{1}{\sqrt{0.5\, +\frac{0.5}{k^2}}}-\frac{0.5}{\left(0.5\, +\frac{0.5}{k^2}\right)^{3/2} k^2}\right)}{\left(25.\, +\frac{8.}{\left(0.5\, +\frac{0.5}{k^2}\right)^{3/2} k^3}\right) \left(0.5\, +\frac{0.5}{k^2}\right)^{3/2} k^3}$

Steady States:          Solve ${k}_{t+1}= \frac{1}{(1+n)}s(w(k_t),f^\prime(k_{t+1}))$

With the parameters: $\{k\to 0\}\}$

Stability:             Compute the derivative of $k_{t+1}$ with respect to $k_{t}$ and evaluate at each steady state.

With the parameters:

\quad Steady state 1, Capital level: $0$, Derivative=$0$. Stable.

\includegraphics{xamples_gr2.eps}
\subsection*{Examples 3}
Production function:    $f(k)=\frac{1}{\sqrt{0.5\, +\frac{0.5}{k^2}}}$

Utility function:       $u(c)=\log(c)$

Savings function:       $s(w(k_t),f^\prime(k_{t+1}))= 0.444444 w$

Substituting: $s(w(k_t),f^\prime(k_{t+1}))= 0.444444 \left(\frac{1}{\sqrt{0.5\, +\frac{0.5}{k^2}}}-\frac{0.5}{\left(0.5\, +\frac{0.5}{k^2}\right)^{3/2} k^2}\right)$

Steady States:          Solve ${k}_{t+1}= \frac{1}{(1+n)}s(w(k_t),f^\prime(k_{t+1}))$

With the parameters: $\{k\to 0\}\}$

Stability:             Compute the derivative of $k_{t+1}$ with respect to $k_{t}$ and evaluate at each steady state.

With the parameters:

\quad Steady state 1, Capital level: $0$ Derivative=$0$. Stable.

\includegraphics{xamples_gr3.eps}

\subsection*{Example 4}
Production function:    $f(k)=\left(0.5\, +0.5 k^{0.5}\right)^{2.}$

Utility function:       $u(c)log(c)$

Savings function:       $s(w(k_t),f^\prime(k_{t+1}))= 0.444444 w$

Substituting: $s(w(k_t),f^prime(k_{t+1}))= 0.444444 \left(\left(0.5\, +0.5 k^{0.5}\right)^{2.}-0.5 \left(0.5\, +0.5 k^{0.5}\right)^{1.} k^{0.5}\right)$

Steady States:          Solve ${k}_{t+1}= \frac{1}{(1+n)}s(w(k_t),f^\prime(k_{t+1}))$

With the parameters: $\{k\to 0.154832\}\}$

Stability:             Compute the derivative of $k_{t+1}$ with respect to $k_{t}$ and evaluate at each steady state.

With the parameters:

\quad Steady state 1, Capital level: $0.154832$ Derivative=$0.141188$  Stable.

\includegraphics{xamples_gr4.eps}

\subsection*{Example 5}
Production function:    $f(k)=\left(0.5\, +0.5 k^{0.5}\right)^{2.}$

Utility function:       $u(c)=2 \sqrt{c}$

Savings function:       $s(w(k_t),f^\prime(k_{t+1}))= \frac{16. R w}{25.\, +16. R}$

Substituting:           $s(w(k_t),f^\prime(k_{t+1}))= \frac{\left(8. \left(0.5\, +0.5 k^{0.5}\right)^{1.} \left(\left(0.5\, +0.5 k^{0.5}\right)^{2.}-0.5 \left(0.5\, +0.5 k^{0.5}\right)^{1.} k^{0.5}\right)\right)}{\left(\left(25.\, +\frac{8. \left(0.5\, +0.5 k^{0.5}\right)^{1.}}{k^{0.5}}\right) k^{0.5}\right)}$

Steady States:          Solve ${k}_{t+1}= \frac{1}{(1+n)}s(w(k_t),f^\prime(k_{t+1}))$

With the parameters: $\{k\to 0.128222\}$

Stability:             Compute the derivative of $k_{t+1}$ with respect to $k_{t}$ and evaluate at each steady state.
With the parameters:

\quad Steady state 1, Capital level: $0.128222$ Derivative=$0.107258$ Stable.

\includegraphics{xamples_gr5.eps}

\subsection*{Example 6}
Production function:    $f(k)=k^{0.5}$

Utility function:       $u(c)=\log(c)$

Savings function:       $s(w(k_t),f^\prime(k_{t+1}))= 0.444444 w$

Substituting:      $s(w(k_t),if^\prime(k_{t+1}))= 0.222222 k^{0.5}$

Steady States:          Solve ${k}_{t+1}= \frac{1}{(1+n)}s(w(k_t),f^\prime(k_{t+1}))$

With the parameters: $\{k\to 0.\},\{k\to 0.0493827\}$

Stability:             Compute the derivative of $k_{t+1}$ with respect to $k_{t}$ and evaluate at each steady state.

With the parameters:

\quad Steady state 1, Capital level: $0$. Derivative=$\infty$ Unstable.

\quad Steady state 2, Capital level: $0.0493827$ Derivative=$0.5$ Stable.

\includegraphics{xamples_gr6.eps}

\subsection*{Example 7}
Production function:    $f(k)=\frac{1}{0.9\, +\frac{0.1}{k}}$

Utility function:       $u(c)=2 \sqrt{c}$

Savings function:       $s(w(k_t),f^\prime(k_{t+1}))= \frac{16. R w}{25.\, +16. R}$

Substituting:           $s(w(k_t),f^\prime(k_{t+1})= \frac{1.6 \left(\frac{1}{0.9\, +\frac{0.1}{k}}-\frac{0.1}{\left(0.9\, +\frac{0.1}{k}\right)^2 k}\right)}{\left(25.\, +\frac{1.6}{\left(0.9\, +\frac{0.1}{k}\right)^2 k^2}\right) \left(0.9\, +\frac{0.1}{k}\right)^2 k^2}$

Steady States:          Solve ${k}_{t+1}= \frac{1}{(1+n)}s(w(k_t),f^\prime(k_{t+1}))$

With the parameters: $\{k\to 0.018251\},\{k\to 0.206304\}$

Stability:             Compute the derivative of $k_{t+1}$ with respect to $k_{t}$ and evaluate at each steady state.

\includegraphics{xamples_gr7.eps}

\end{document}


\section{Algebra}

\formdesc{Arithmetic Operations}
\vspace{-3.5em}
\begin{center}
\[
\def\arraystretch{2.5}
 \begin{array}{ll}
  a \left( \frac{b}{c} \right) = \frac{ab}{c}   & \frac{\frac{a}{b}}{c} = \frac{a}{bc}               \\
   \frac{a}{\frac{b}{c}} = \frac{ac}{b}         & \frac{a}{b} \pm \frac{c}{d} = \frac{ad \pm bc}{bd} \\
   \frac{a - b}{c - d} = \frac{b - a}{d - c}    & \frac{ab + ac}{a} = b + c,~ \forall a \neq 0        \\
   \frac{a + bc}{c} = \frac{a}{c} = \frac{b}{c} & \frac{\frac{a}{b}}{\frac{c}{d}} = \frac{ad}{bc}
 \end{array}
\]
\end{center}
\hformbar

\formdesc{Exponents}

\vspace{-3.5em}
\begin{center}
\[
\def\arraystretch{2.5}
 \begin{array}{ll}
   x^a \cdot x^b = x^{a + b}           & \frac{x^a}{x^b} = x^{a - b}     \\
   (xy)^a = x^a y^a                    & \frac{x}{y}^a = \frac{x^a}{y^a} \\
   x^0 = 1 \note                       & x^{-n} = \frac{1}{x} \note      \\
   x^{\frac{1}{a}} = \sqrt[a]{x} \note & (xy)^a = x^a y^a                \\
   x^{-a} = \frac{1}{x^a}             & \left( \frac{x}{y}   \right)^{-a} = \left( \frac{y}{x} \right)^a = \frac{y^a}{x^a}
 \end{array}
\]
\end{center}

$\note \forall x \neq 0$

\hformbar

\formdesc{Radicals}

\vspace{-2.5em}
\begin{center}
\[
\def\arraystretch{2.5}
 \begin{array}{ll}
   \sqrt[a]{x} = x^{\frac{1}{a}} & \sqrt[a]{xy} = \sqrt[a]{x} \sqrt[a]{y}
 \end{array}
\]
\end{center}

\hformbar

\formdesc{Logarithms}

Defined as $y = log_b x \equiv x = b^y$, with domain of $x > 0$

\begin{center}
\vspace{-2em}
\[
\def\arraystretch{1.6}
 \begin{array}{ll}
   log_b b = 1 & log_b 1 = 0 \\
   log_b b^x = x & b^{log_b x} = x \\
   log_b \left( x^r \right) = r ~ log_b x &  \\
   log_b \left( \frac{x}{y} \right) = log_b x - log_b y & \\
   log_b (xy) = log_b x + log_b y &
 \end{array}
\]
\end{center}

\hformbar

\formdesc{Factoring}

\begin{center}
\vspace{-2em}
\[
\def\arraystretch{1.6}
 \begin{array}{c}
   x^2 - a^2 = (x + a)(x -a ) \\
   x^2 \pm 2ax + a^2 = (x \pm a)^2 \\
   x^2 + (a + b)x + ab = (x + a)(x + b)
 \end{array}
\]
\end{center}

\hformbar

\formdesc{Functions}

\begin{itemize}
	\item A rule for a relationship between an input and an output quantity where each input \textit{uniquely determines} an output value
	\item Must be of the form $y = f(x)$
\end{itemize}

\begin{footnotesize}
  \begin{tabular}{ll}
    \textsc{type} & \textsc{form} \\
    \midrule
    Constant & $f(x) = c$ \\
    Identity & $f(x) = x$ \\
    Absolute & $f(x) = |x|$\\
    Quadratic & $f(x) = x^2$  \\
    Cubic     & $f(x) = x^3$  \\
    Reciprocal & $f(x) = \frac{1}{x^2}$  \\
    Square root & $f(x) = \sqrt{x}$  \\
  \end{tabular}
\end{footnotesize}
\hformbar

\formdesc{Transformations of Functions}

\vspace{.3em}
\begin{footnotesize}
  \begin{tabular}{ll}
  \centering
    \textsc{Transformation} & \textsc{Form} \\
    \midrule
    Vertical shift & $f'(x) = f(x) + k$ \\
    Horizontal shift & $f'(x) = f(x - k)$\\
    Horizontal reflection & $f'(x) = f(-x)$\\
    Vertical reflection & $f'(x) = -f(x)$  \\
    Vertical stretch     & $f'(x) = kf(x), ~ k > 1$ \\
    Vertical compression & $f'(x) = kf(x), ~ k 0 < k < 1$  \\
  \end{tabular}
\end{footnotesize}
\hformbar

\formdesc{Distance Formula}

\begin{equation}
	d(P_1, P_2) = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}
\end{equation}

is the distance between points $P_1 = (x_1, y_1)$ and $P_2 = (x_2, y_2)$
\hformbar

\formdesc{Linear Functions}

\begin{itemize}
	\item Linear functions have a constant rate of change, $m$

		\begin{equation}
			m = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1} = \frac{f(x_2) - f(x_1)}{x_2 - x_1}
		\end{equation}
	\item Estimate horizontal line by solving $f(x) = 0$
	\item Find the point where two non-parallel lines meet: set $f(x) = g(x)$ and solve for $x$
	\item Estimate slope from two points by solving for $m$:
	    \begin{equation}
	        y_1 - y_2 = m(x_1 - x_2)
	    \end{equation}
\end{itemize}
\hformbar

\formdesc{Quadratic Functions}

\begin{center}
  \begin{tabular}{ll}
    Standard form                  & $f(x) = ax^2 + bx + c$                   \\[.7em]
    Vertex or transformation form  & $f(x) = a(x - h)^2 + k$                  \\[.7em]
    Quadratic eq.                  & $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ \\[.7em]
  \end{tabular}
\end{center}

\begin{itemize}
    \item $b^2 - 4ac > 0 \Rightarrow$ Two real unequal solutions
    \item $b^2 - 4ac = 0 \Rightarrow$ Repeated real solution
    \item $b^2 - 4ac < 0 \Rightarrow$ Two complex solutions
\end{itemize}

\hformbar

\formdesc{Polynomial Functions}

\begin{equation}
  f(x) = a_0 + a_1x + a_2x^2 + \cdots + a_nx^n = \sum_{k=0}^n a_k x^{n-k}
\end{equation}

\begin{center}
  \begin{tabular}{ll}
    $a_0$     & Constant term                         \\
    $a_n$     & Polynomial coefficient                \\
    $a_nx^m$  & Term ($m$ is called \textit{degree})  \\
  \end{tabular}
\end{center}

\hformbar

\formdesc{Rational Functions}

Can be written as a quotient of two polynomials $P(x)$ and $Q(x)$:

\begin{equation}
  f(x) = \frac{P(x)}{Q(x)} = \frac{\sum_{k=0}^n a_k x^{n-k}}{\sum_{k=0}^n b_k x^{n-k}}
\end{equation}

  \begin{itemize}
    \item Horizontal Intercept is the inputs where the output is 0
    \item Vertical Intercept is where input is 0 (if defined)
  \end{itemize}

\hformbar

\formdesc{Asymptotes}

The ``line'' a function approaches but never touches

\begin{description}
	\item[Vertical] A vertical line $x = a$ where the graph tends towards positive or negative
	                infinity as the inputs approach $a$:
	                \begin{equation}
	                    x \rightarrow a,\, f(x) \rightarrow \pm~ \infty
	                \end{equation}
	\item[Horizontal] A horizontal line $y = b$ where the graph approaches the line as the
	                  input gets larger:
	                   \begin{equation}
	                       x \rightarrow \pm~ \infty,\, f(x) \rightarrow b
	                   \end{equation}
\end{description}
\hformbar

\formdesc{Asymptotes of Rational Functions}

\begin{description}
    \item[Vertical] Where denominator = 0 but numerator $\neq 0$
    \item[Horizontal] Determined by respective degrees of numerator and denominator:
        \begin{itemize}
            \item Degree of denominator $>$ degree of numerator $\Rightarrow$ Horizontal asymptote at $y = 0$
            \item Degree of denominator $<$ degree of numerator $\Rightarrow$ No horizontal asymptote
            \item Degree of denominator = degree of numerator $\Rightarrow$ Horizontal asymptote is ratio of leading coefficients
        \end{itemize}
\end{description}
\hformbar

\formdesc{Exponential Functions}

Rate of change is as a percent, i.e., not an constant (absolute) rate. Takes the form:

\begin{equation}
    f(x) = a(1 + r)^x
\end{equation}

or,

\begin{equation}
    f(x) = ab^x,~ b = 1 + r
\end{equation}

Can always be rewritten in terms of logarithms:

\begin{equation}
    b^a = c \equiv log_b~ c = a
\end{equation}

\begin{description}
    \item[Continuous Growth] Use $e = 2.718282\dots$ for continuous growth, often natural phenomena
        \begin{equation}
            f(x) = ae^{rx}
        \end{equation}

        where

        \begin{itemize}
            \item $a \equiv$ initial quantity
            \item $r \equiv$ continuous growth rate
        \end{itemize}
\end{description}

\textit{ALMOST ALWAYS USE CONTINUOUS $e$ FORM!}\\

Solve by:

\begin{enumerate}
    \item Isolate exponential expression, where possible
    \item Take log on both sides
    \item Use \textit{exponent property} of logs to pull variables of out exponent
    \item Use algebra to solve for variable
\end{enumerate}
\hformbar

\formdesc{Graphing Exponential Functions}

\begin{itemize}
    \item $a \equiv$ vertical intercept
        \begin{itemize}
            \item $a > 0 \Rightarrow$ concave up
            \item $a < 0 \Rightarrow$ concave down
        \end{itemize}
    \item $b \equiv$ rate of growth
        \begin{itemize}
            \item $b > 1 \Rightarrow$ growing
            \item $0 < b < 1 \Rightarrow$ decaying
        \end{itemize}
    \item Horizontal asymptote is where $y = 0$
\end{itemize}
\hformbar

\formdesc{Logarithmic Functions}

The inverse of exponential functions; use to solve exponential functions. Commonly used to express quantities that vary widely in size. Form:

\begin{equation}
    log_b~ x
\end{equation}

which can be rewritten in terms of exponents:

\begin{equation}
    b^a = c \equiv log_b~ c = a
\end{equation}

\begin{description}
    \item[Inverse Property of Logs]
        \begin{eqnarray}
            log_b~ b^x &=& x \\
            b^{log_b~ x} &=& x
        \end{eqnarray}

    \item[Exponent Property]
        \begin{equation}
            log_b~ A^r = r log_b~ A
        \end{equation}
\end{description}

\newpage


\section{Methods}

\subsection{Model design}

We modeled the vertical accretion of a tidal platform ($\sfrac{d\eta}{dt}$) using a zero-dimensional mass balance approach initially described by \citet{kroneMethodSimulatingMarsh1987} and validated by subsequent studies \citep{allenSaltmarshGrowthStratification1990,frenchNumericalSimulationVertical1993,temmermanModellingLongtermTidal2003,temmermanModellingEstuarineVariations2004}. The rate of vertical accretion is described as
\begin{equation}\label{eq:mass_bal}
	\frac{d\eta(t)}{dt} = \frac{dS_m(t)}{dt} + \frac{dS_o(t)}{dt} + \frac{dP(t)}{dt} + \frac{dM(t)}{dt},
\end{equation}
where $\sfrac{dS_m(t)}{dt}$ is the rate of mineral sedimentation, $\sfrac{dS_o(t)}{dt}$ is the rate of organic matter sedimentation, $\sfrac{dP(t)}{dt}$ is the rate of shallow compaction after dewatering of the deposited sediment, and $\sfrac{dM(t)}{dt}$ is the rate of tectonic subsidence. We considered $\sfrac{dS_o(t)}{dt}$, $\sfrac{dP(t)}{dt}$, $\sfrac{dM(t)}{dt}$ to be constants and used characteristic yearly rates for each; while, $\sfrac{dS_m(t)}{dt}$ varies within a tidal cycle \citep{haleSeasonalVariabilityForces2019} and requires additional treatment.

To solve for $\sfrac{dS_m(t)}{dt}$, we began by conceptualizing a tidal platform periodically inundated by sinusoidal tides. We first defined depth to be
\begin{equation}\label{eq:depth}
	h(t) = \zeta(t) - \eta(t),
\end{equation}
where $\zeta(t)$ is the water-surface elevation and $\eta(t)$ is the sediment-surface elevation which also implies that
\begin{equation}\label{eq:depth_dt}
	\frac{dh(t)}{dt} = \frac{d\zeta(t)}{dt} - \frac{d\eta(t)}{dt}.
\end{equation}
Independently, we assume while $h(t) > 0$, the rate of mineral sedimentation is
\begin{equation}\label{eq:sed_flux}
	\frac{dS_m(t)}{dt} = \frac{w_sC(t)}{\rho_b},
\end{equation}
where $w_s$ is the nominal settling velocity of a sediment grain, $C(t)$ is the depth-averaged suspended sediment concentration (SSC) in the water column, and $\rho_b$ is the bulk density of the sediment. We assumed no resuspension of mineral sediment which is practical and consistent with previous studies \citep{kroneMethodSimulatingMarsh1987, allenSaltmarshGrowthStratification1990, frenchNumericalSimulationVertical1993, temmermanModellingLongtermTidal2003, temmermanModellingEstuarineVariations2004}.

In order to solve for $C(t)$ in \cref{eq:sed_flux}, we first defined a mass balance of sediment within the water column as
\begin{equation}\label{eq:conc_mass_bal}
	\frac{d}{dt}[h(t)C(t)] = -w_s C(t) + C_b \frac{dh(t)}{dt},
\end{equation}
which can be expanded and rerranged as
\begin{equation}\label{eq:conc_dt}
	\frac{dC(t)}{dt} = - \frac{w_sC(t)}{h(t)} - \frac{1}{h(t)}[C(t) - C_b]\frac{dh(t)}{dt}.
\end{equation}
We assumed advection of new sediment to only occur during flood tide by constraining mass flux from the boundary term when $\sfrac{dh}{dt} > 0$. We formalized this mathematically using a Heaviside function which serves as a binary switch and is given as
\begin{equation}\label{eq:heaviside}
	S = \frac{dh}{dt},\quad	H(S) =
	\begin{cases}
		0 & \text{if $S < 0$}\\
		1 & \text{if $S \geq 0$}.
	\end{cases}
\end{equation}
\Cref{eq:conc_dt} then becomes
\begin{equation}\label{eq:conc_sol}
	\frac{dC(t)}{dt} = - \frac{w_s C(t)}{h(t)} - \frac{H(S)}{h(t)} [C(t) - C_b]\frac{dh(t)}{dt}.
\end{equation}
\Crefnosort{eq:conc_sol,eq:sed_flux,eq:mass_bal} were then solved in that order to obtain the change in elevation during one time step.

We integrated this series of equations for each inundation cycle using an explicit Runge-Kutta method of order 5(4) \citep{dormandFamilyEmbeddedRungeKutta1980} implemented in Python using SciPy \citep{virtanenSciPyFundamentalAlgorithms2020}. We used an adaptive step size which provided computational efficiency by decreasing step size as needed - i.e. beginning and end of an inundation cycle. To avoid numerical errors due to very small depths in \cref{eq:conc_sol}, we only allowed the model to integrate while water depths were \SI{>1}{\milli\meter}. Outside of the integration (i.e. while the platform was dry), we continued to apply linear rates for $\sfrac{dS_o(t)}{dt}$, $\sfrac{dP(t)}{dt}$, $\sfrac{dM(t)}{dt}$.

We indentified indundation cycles by filtering the tidal curve for water-surface elevations that were above the corresponding sediment-surface elevation. The time of first element of the filtered data was used to initialize the integration. The adaptive step size method required a continuous function for water-surface elevations so we converted the tidal data to an interpolated univariate spline during the integration. The integration continued until the water-surface elevation fell below the sediment-surface elevation. We repeated this process for all subsequent inundation cycles through the prescribed length of each simulation to obtain a final elevation.

\subsection{Field observations and model parameters}

\bigskip

\subsubsection*{Tidal data}

The tidal curve was derived from observations at Sutarkhali station. Water-surface elevations were collected every 10 minutes from January 1, 2019 to December 31, 2019 using an Onset U20L-01 HOBO water level data logger. The data were processed and upsampled to \SI{1}{\second} temporal resolution using the oce package in R (3.6.3) \citep{kelleyOceAnalysisOceanographic2020}. The tidal curve was then shifted to place mean water at \SI{\approx1.6}{\meter} below the Sundarban sediment-surface. This results in \SIrange{\approx 50}{60}{\centi\meter} of inundation during most spring high tides and is consistent with survey data \citep{auerbachFloodRiskNatural2015,haleSeasonalVariabilityForces2019,bomerSurfaceElevationSedimentation2020}. We repeated this tidal curve for each subsequent year of the simulation with a superimposed sea level rise rate of \SI{5}{\milli\meter\per\year}.

\subsubsection*{Organic matter, shallow compaction, and subsidence}

\citet{bomerProcessControlsLive2020} found organic matter only accounts for $\sim$\SI{0.9(1)}{\percent} of the $\sim$\SI{2.42(26)}{\centi\meter\per\year} yearly bulk sedimentation. Using this, we set $\sfrac{dS_o(t)}{dt}$ to \SI{0.2}{\milli\meter\per\year}.

Shallow compaction is difficult to constrain for the region and likely varies significantly due to natural variability in stratigraphy and anthropogenic activity (e.g. subsurface fluid extraction and accelerated oxidation of below-ground biomass due to drying of the sediment). \citet{auerbachFloodRiskNatural2015} suggested shallow compaction rates of \SI{0.4}{\centi\meter\per\year} for natural compaction and \SI{0.8}{\centi\meter\per\year} for accelerated compaction (combined natural and anthropogenic compaction). We adopted their values of $\sfrac{dP(t)}{dt}$.

Estimates of subsidence vary for the region and are hard to disentangle from compaction. Many studies \citep{pethickRapidRiseEffective2013,goodbredSignificanceLargeSediment2000,stanleyHoloceneDepositionalPatterns2000} combine compaction and subsidence. \citet{auerbachFloodRiskNatural2015} considered both compaction and subsidence separately by using values in the literature \citep{pethickRapidRiseEffective2013,goodbredSignificanceLargeSediment2000,stanleyHoloceneDepositionalPatterns2000} estimated subsidence to be \SI{0.3}{\centi\meter\per\year}. We set $\sfrac{dM(t)}{dt}$ to this value.

\subsubsection*{Settling velocity, suspend sediment concentration, and bulk density}

We used Stoke's law to determine $w_s$. Stoke's law assumes unhindered settling which likely overestimates actual settling rates and, therefore, mineral sedimentation rates. However, we only considered settling for a singular, median grain size which likely underestimated mineral sedimentation rates from coarser grains. Model calibration further corrected for these errors. Thus, the $w_s$ given by Stoke's law should be considered an imprecise, but reasonable approximation.

For $C_{b}$, we use observed values of SSC from \citet{haleObservationsScalingTidal2019} that are characteristic of the tidal channels in the region.

For $\rho$, we used values derived from conversations with Steven Goodbred and Carol Wilson.


\chapter{Maximum likelihood estimation}
\label{chap:mle}

The technique used for the yield extraction is the method of maximum
likelihood, where an objective function is defined that assumes some particular
model truly generated the data.
The vector of parameters $\vec{\theta}$ of that model are varied given a vector
$\vec{x}$ of $N$ independent, randomly distributed measurements $x_{i}$ until
the objective is maximised.
This objective is the likelihood \likelihood, and is defined as
\begin{equation}
  \likelihood(\vec{\theta}|\vec{x}) = \prod_{i}^{N} f(x_{i}|\vec{\theta}),
\end{equation}
where $f$ is the \ac{PDF} that the data are assumed to have been sampled
from.\footnotemark
Practically, it is useful to work with the logarithm of the likelihood, as sums
are more convenient to work with numerically than products, and to use the
negative of this, in order to be able to exploit the available numerical
algorithms for minimisation problems such as the \migrad\ algorithm in the
\minuit\ package~\cite{James:1975dr,James:1994vla}
\begin{equation}
  -\ln{\likelihood(\vec{\theta}|\vec{x})} =
  -\sum_{i}^{N} \ln{f(x_{i}|\vec{\theta})}.
\end{equation}
This is the \acf{NLL}.
The practice of minimising the \ac{NLL} is also called \emph{fitting}.

\footnotetext{%
  The properties of any given \ac{PDF} $f(x)$ that are important here are:
  $f(x) \geq 0$ for all $x$; and $\int_{-\infty}^{\infty} f(x)\dif{x} = 1$.
}

For the purposes of this analysis, the total \ac{PDF} $f$ is the sum of several
models $f_{s}$, one for each physical source $s$ under consideration, such as
signal and combinatorial background or different \pTy\ bins
\begin{equation}
  \ln{\likelihood(\vec{\theta}|\vec{x})} =
  \sum_{i}^{N} \ln{\sum_{s} f_{s}(x_{i}|\vec{\theta})}.
\end{equation}
The notation here that each model $f_{s}$ receives the full parameter vector
$\vec{\theta}$ implies that each $f_{s}$ may share parameters with other
components.
In order to not only model the shape of the components but also their absolute
size, an \emph{extended} maximum likelihood fit~\cite{Barlow:1990vc} is
performed that relaxes the normalisation requirement on the total \acp{PDF} to
allow for Poisson fluctuations around the observed number of events
$N_{\text{obvs.}}$
\begin{equation}
  \ln{\likelihood(\vec{\theta}, \vec{N}|\vec{x})} =
  \sum_{i}^{N}
    \ln{\sum_{s} N_{s}f_{s}(x_{i}|\vec{\theta})}
    - \sum_{s} N_{s}
  ,
\end{equation}
where $N_{s}$ is the \emph{yield} associated to each component model $f_{s}$
and $\vec{N}$ is the vector of those yields.

After defining the full model, the \acl{NLL} is minimised numerically using
\minuit.
Minimising the \ac{NLL} is equivalent to finding the parameter vector
$\hat{\theta}$ where the first derivatives of the likelihood with respect to
each parameter are all zero
\begin{equation}
  \vec{u}(\vec{\theta}) = \frac{%
    \partial\ln{\likelihood}
  }{%
    \partial\vec{\theta}
  },\quad
  \vec{u}(\hat{\theta}) = \vec{0},
\end{equation}
where for compactness $\vec{\theta}$ includes the $\vec{N}$ parameter vector.
The uncertainties on the parameters can be found by inspecting the diagonal
terms of the covariance matrix, which can be computed numerically by inverting
the \emph{observed} Fisher information matrix $I(\hat{\theta})$, defined via
\begin{equation}
  I(\vec{\theta}) = \frac{%
    \partial^{2}\ln{\likelihood}
  }{%
    \partial\vec{\theta}\partial\vec{\theta}'
  }.
\end{equation}
The second derivative around the likelihood can be thought of as describing the
`peakiness' of the minimum, where a shallower peak corresponds to less
certainty in the measurement of the parameter, and conversely a sharper peak
corresponds to a greater certainty in the value at the minimum.
The computation of the set of second derivatives, and the proceeding matrix
inversion to obtain the covariance matrix, is performed numerically from the
minimised \ac{NLL} by the \hesse\ algorithm, part of \minuit.

To estimate the yields in the data, suitable models must be constructed.
The following Sections shall describe the construction of these models for the
various fits.


\begin{appendix}
\chapter{Formulae}
\begin{align}
\delta\tensor{g}{^\mu^\nu}
&=-\tensor{g}{^\varrho^{(\mu}}\tensor{g}{^{\nu)}^\sigma}\delta\tensor{g}{_\mu_\nu}\label{eq:grels}\\
\delta\det g&=\det g \tensor{g}{^\mu^\nu}\delta
\tensor{g}{_\mu_\nu}
\end{align}
\begin{equation}
\mathrm{div} A=\tensor{\partial}{_i}\tensor{A}{^i}=\cSym{i}{i}{k}\tensor{A}{^k}
\end{equation}
\begin{equation}
\tensor{\partial}{_k}g=2g\cSym{i}{i}{k}
\end{equation}
\begin{equation}
\cSym{i}{i}{k}=\frac{1}{\sqrt{g}}\tensor{\partial}{_k}\sqrt{g}
\end{equation}
\begin{equation}
\mathrm{div}
A=\frac{1}{\sqrt{g}}\tensor{\partial}{_k}\left(\sqrt{g}\tensor{A}{^k}\right)
\end{equation}
If further $A$ is derived from a potential
$\tensor{A}{_i}=\tensor{\partial}{_i}V$
\begin{equation}
\square V
=\mathrm{div}A
=\frac{1}{\sqrt{g}}\tensor{\partial}{_k}\left(\sqrt{g}\tensor{g}{^k^i}\tensor{\partial}{_i}V\right)\label{eq:quabla}
\end{equation}
\end{appendix}


\textbf{Necessary and Sufficient Condition for Stability} \newline

\begin{enumerate}
\item $|a_n| < |a_0|$
\item $P(1) > 0$
\item \begin{align*}
P(-1) & > 0 \ \text{for n even } \\
& < 0 \ \text{for n odd}
\end{align*}
\item $b_{n-1}> |b_0|, |c_{n-2}|>|c_0|, \cdots |q_2| > |q_0|$
\end{enumerate}

\textbf{Special Case n =2} \newline
$P(z) =a_0z^2+a_1z+a_2$ \newline
\begin{tabular}{c c c}
$z^0$ & $z^1$& $z^2$ \\
$a_2$ & $a_1$ & $a_0$
\end{tabular} \newline
$P(z) \neq 0$ for $|z| \geq 1$ if and only if
\begin{enumerate}
\item $|a_2| < |a_0|$
\item $P(1) > 0$
\item $P(-1) > 0 \quad (n=2)$
\end{enumerate}

 \textbf{Root Locus} presents the poles of the closed loop system when the gain K changes from zero to infinity.

 \textbf{Construction of the Root Locus}

 Open loop transfer function
 $ \displaystyle \text{KH}\left( s \right)G\left( s \right) = K\frac{B(s)}{A(s)}$

m: the order of the \textbf{open-loop} numerator polynomial.

 n: the order of the \textbf{open-loop} denominator polynomial. $q=n-m$

 \textbf{Rule 1:} number of branches equals the number of poles of the
 open-loop transfer function

 \textbf{Rule 2:} If the total number of poles and zeros of the open-loop
 system to the right of the s-point on the real axis is odd, then this
 point lies on the locus.

\textbf{Rule 3:} The locus starting point (K=0) are at the open-loop
 poles and the locus ending points (K=$\infty$) are at the open loop zeros and
 n-m branches terminate at infinity.

\textbf{Rule 4 and 5:} Slope of asymptotes of root locus as `s' approaches infinity. \newline Abscissa of the intersection between asymptotes of root locus and real-axis.
\begin{align*}
& \sigma  = {\frac{\sum\limits_{i = 1}^n {{p_i}}  - \sum\limits_{i = 1}^m {{z_i}} }{q}} \quad \theta = \pm r{\frac{180}{q}} \quad \text{where r=1, 3, 5} \\
& f\left( s \right) = A\left( s \right) + KB\left( s \right) = 0\ \ \ \ and\ \ \ \ K = - \frac{A\left( s \right)}{B\left( s \right)} \\
& \frac{\text{dK}}{\text{ds}} = - \frac{A^{'}\left( s \right)B\left( s \right) - A\left( s \right)B^{'}\left( s \right)}{B^{2}\left( s \right)} = 0 \\
 \end{align*}
 \textbf{Rule 5:}

 \textbf{Rule 6:} Break-away and break-in points. From the characteristic
  equation

  \[f\left( s \right) = A\left( s \right) + KB\left( s \right) = 0\ \ \ \ and\ \ \ \ K = - \frac{A\left( s \right)}{B\left( s \right)}\]

  The break-away and break-in points can be found from

  \[\frac{\text{dK}}{\text{ds}} = - \frac{A^{'}\left( s \right)B\left( s \right) - A\left( s \right)B^{'}\left( s \right)}{B^{2}\left( s \right)} = 0 \]

  \textbf{Rule 7:} Angle of departure from complex poles or zeros.
  Subtract from $180^o$ the sum of all angles from all other zeros and poles
  of the open-loop system to the complex pole (or zero) with appropriate signs.

 \begin{align*}
& \text{Z-transform: Definition} \quad F(z)=Z[f(t)]-Z[f(kT)]=\sum_{k=0}^{\infty}f(kT)z^{-k} \\
& e^\ast(\infty)=\lim_{z \rightarrow 1} (1-z^{-1})E(z) \quad K_p=\lim_{z \rightarrow 1} GH(z), \quad e^\ast (\infty) = \frac{1}{1+K_p} \\
& e^\ast(\infty) = \frac{1}{K_v}, \quad K_v =  \lim_{z \rightarrow 1} \frac{(1-z^{-1}) GH(z)}{T}  \\
& e^\ast(\infty) = \frac{1}{K_a}, \quad K_a =  \lim_{z \rightarrow 1}\frac{(1-z^{-1})^2 GH(z)}{T^2}
\end{align*}

{\bf Linear Factor Rule.}
 For each factor of $Q$ of the form $(ax+b)^m$,
 the partial fraction decomposition contains
 the following sum of $m$ partial fractions:
\[
\frac{A_1}{ax+b} + \frac{A_2}{(ax+b)^2} + \cdots + \frac{A_m}{(ax+b)^m},
\]
 where the $A_i$ are constants to be determined.

\medskip
\noindent
{\bf Quadratic Factor Rule.}
 For each factor of $Q$ of the form $(ax^2+bx+c)^m$,
 where $ax^2+bx+c$ is an irreducible quadratic,
% the partial fraction decomposition contains
 the following sum of $m$ partial fractions:
\[
\frac{A_1x+B_1}{ax^2+bx+c} + \frac{A_2x+B_2}{(ax^2+bx+c)^2} + \cdots
  + \frac{A_mx+B_m}{(ax^2+bx+c)^m},
\]
 where the $A_i$ and $B_i$ are constants to be determined.

Geometric Sum $\sum\limits_{k = -N}^{N} {ar^{k - 1} = a\frac{1-r^{N}}{{1 - r}}} \sum_{i=0}^\infty a^i=\frac{1}{1-a}$

$ x(k+2)-\frac{3}{2}x(k+1)+\frac{1}{2}x(k)=u(k), \text(x(0)=1,x(1)=5/2) $

$[z^2X(z)-z^2x(0)-zx(1)]-\frac{3}{2}(zX(z)-zx(0)]+\frac{1}{2}X(z)=\frac{z}{z-1}$

\textbf{Effects of T on Transient Behaviour} \hfill \break
$s= -\zeta \omega_n \pm j \omega_n \sqrt{1-\zeta^2}$,  \hfill \break
$\zeta$: damping ratio  \hfill \break
$\omega_n$: undamped natural frequency,  \hfill \break
$\omega_d$: damped natural frequency \hfill \break
$z=e^{Ts} \rightarrow z= \exp\left[T(-\zeta \omega_n +j\omega_n \sqrt{1-\zeta^2})\right]$, and
$|z|=e^{-T \zeta \omega_n}$, $\angle z = T \omega_n \sqrt{1-\zeta^2}= T \omega_d$. $\uparrow T$ makes system less stable (for the same gain K) than $\downarrow T$.
\textbf{Matrix Inverses for 2x2 and 3x3}
\begin{align*}
& A^{-1} = \begin{bmatrix}
a & b \\
c & d
\end{bmatrix}^{-1}= \frac{1}{|A|}\begin{bmatrix}
d & -b \\
-c & a
\end{bmatrix} \ \begin{bmatrix}
a & b & c \\
d & e & f \\
g & h & i
\end{bmatrix}^{-1} \\
& A^{-1} =
\frac{1}{|A|}\begin{bmatrix}
% Row one determinate
+\begin{vmatrix}
e & f \\
h & i
\end{vmatrix} &
-\begin{vmatrix}
b & c \\
h & i
\end{vmatrix} &
+\begin{vmatrix}
b & c \\
e & f
\end{vmatrix} \\
& & \\
-\begin{vmatrix}
d & f \\
g & i
\end{vmatrix} & +\begin{vmatrix}
a & c \\
g & i
\end{vmatrix} &
-\begin{vmatrix}
a & c \\
d & f
\end{vmatrix} \\
& & \\
+\begin{vmatrix}
d & e \\
g & h
\end{vmatrix} &
-\begin{vmatrix}
a & b \\
g & h
\end{vmatrix} &
+\begin{vmatrix}
a & b \\
d & e
\end{vmatrix}
\end{bmatrix}^{-1}
\end{align*}
\textbf{Bilinear Transform}  \hfill \nopagebreak
$s= \frac{2(1-z^{-1})}{T(1+z^{-1})}$, $z=\cfrac{1+0.5Ts}{1-0.5Ts}$.

\text{1. Stability} $\Re[s] < 0$

$\displaystyle \Re \left(\frac{2}{T} \frac{1-z^{-1}}{1+z^{-1}}\right)= \Re \left(\frac{2}{T}\frac{z-1}{z+1}\right) < 0$, $z= \sigma + j \omega$ \hfill \nopagebreak

$\displaystyle \Re \frac{z-1}{z+1}=\Re \left[\frac{\sigma^2-1+\omega^2+2j\omega}{(\sigma+1)^2+\omega^2}\right] \rightarrow \sigma^2-1+\omega^2 < 0$.

\textbf{Solution of inhomogeneous state equations}
scalar $\dot{x}=ax+bu \quad \dot{x}-ax=bu$
\begin{align*}
& e^{-at}[\dot{x}(t)-ax(t)]=\underbrace{\frac{d}{dt}[e^{-at}x(t)]=e^{-at}bu(t)}_{\text{integrate ~$0 \rightarrow t$}} \\
& e^{-at}x(t)-x(0) = \int^t_0 e^{-a \tau}bu(\tau) d\tau \\
& \rightarrow x(t)=e^{at}x(0)+e^{at}\int_0^te^{-a\tau}bu(\tau)d\tau
\end{align*}
matrix: $\dot(x)=Ax+bu$, but taking $\mathcal{L}^{-1}$ leads to  \hfill \break  $x(t)=e^{At}x(0)+\int_{0}^{t}e^{A(t-\tau)}bu(\tau) d\tau$

\textbf{Controllable Canonical Form} \hfill \nopagebreak

% \hfill \break \nopagebreak
\resizebox{.9\linewidth}{!}{
  \begin{minipage}{\linewidth}
\begin{align*}
& G(z) = \frac{b_0+b_1z^{-1}+ \cdots + b_nz^{-n}}{1+a_1z^{-1}+ \cdots + a_n}= \frac{b_0z^n+b_1z^{n-1}+ \cdots + b_n}{z^n+a_1z^{n-1}+\cdots + a_n} \\
& G(z)= b_0 + \frac{(b_1-a_1b_0)z^{-1}+(b_2-a_2b_0)z^{-2}+ \cdots + (b_n-a_nb_0)z^{-n-1}}{1+a_1z^{-1}+a_2z^{-2}+ \cdots + a_nz^{-n}} \\
& \begin{bmatrix}
x_1(k+1) \\
 \vdots \\
x_n(k+1)
\end{bmatrix}= \begin{bmatrix}
0      & 1         & 0      & \cdots \\
\vdots & \cdots    &        & \vdots \\
\vdots &           &  \cdots      &   1    \\
-a_n   &  \cdots   & \cdots & -a_1
\end{bmatrix}\begin{bmatrix}
x_1(k) \\
 \vdots \\
x_n(k)
\end{bmatrix}+\begin{bmatrix}
0 \\
 \vdots \\
0 \\
1
\end{bmatrix}u(k) \\
& y(k) = \begin{bmatrix}
b_n-a_nb_0, & b_{n-1}a_{n-1}b_0, & b_1-a_1b_0
\end{bmatrix} \begin{bmatrix}
x_1(k) \\
\vdots \\
x_n(k)
\end{bmatrix} + b_0 u(k) \\
& z \rightarrow s \quad  zX(z) = \mathcal{Z}[x(k+1)] \quad  sX(s) = \mathcal{L}[x(t)]
\end{align*}
  \end{minipage}
} \hfill \nopagebreak

\textbf{Observable Canonical Form} \hfill \nopagebreak

\resizebox{.9\linewidth}{!}{
  \begin{minipage}{\linewidth}
\begin{align*}
& \begin{bmatrix}
\dot{x_1} \\
 \vdots \\
\dot{x_n}
\end{bmatrix}= \begin{bmatrix}
0      & 0         & 0      & -a_n     \\
1 & \cdots    &        & -a_{n-1} \\
0 &           & \cdots &   \vdots \\
0   &  0   & 1 & -a_1
\end{bmatrix} \begin{bmatrix}
x_1 \\
 \vdots \\
x_n
\end{bmatrix}+\begin{bmatrix}
b_n-a_nb_0 \\
 \vdots \\
b_1-a_1b_0
\end{bmatrix}u(k) \\
& y(k) = \begin{bmatrix}
0, & \cdots & \cdots, & 0, & 1
\end{bmatrix} \begin{bmatrix}
x_1 \\
\vdots \\
x_n
\end{bmatrix} + b_0 u(k)
\end{align*}
  \end{minipage}
} \hfill \nopagebreak

\textbf{Part-Frac-Expansion Method, Dia Canonical} %\hfill \nopagebreak
\vspace{-0.425cm}
\begin{align*}
& G(z) =  b_0 + \frac{c_1}{z-p_1} + \cdots \ \cdots + \frac{c_n}{z-p_n} \\
& \begin{bmatrix}
x_1(k+1) \\
\vdots \\
\vdots \\
x_n(k+1)
\end{bmatrix} =  \begin{bmatrix}
p_1     & 0       & \cdots  & 0      \\
0       & \vdots  &         & 0      \\
\vdots  &         &  \vdots & \vdots \\
0       & 0       &  \cdots & p_n
\end{bmatrix}\begin{bmatrix}
x_1(k) \\
\vdots \\
\vdots \\
x_n(k)
\end{bmatrix} + \begin{bmatrix}
1 \\
1 \\
\vdots \\
1
\end{bmatrix} u(k) \\
&  y(k) = \begin{bmatrix}
c_1 & \cdots & c_n
\end{bmatrix} \begin{bmatrix}
x_1    \\
\vdots \\
x_n
\end{bmatrix} + b_0 u(k)
\end{align*}

\textbf{Special Case} %hill \nopagebreak
%
\vspace{-0.425cm}
\begin{align*}
& y^{(n)}+a_1y^{(n-1)}+ \cdots + a_{n-1}y+a_{n}=u \quad \dot{x} = Ax + bu  \\
& x = \begin{bmatrix}
x_1 \\
\vdots \\
\vdots \\
x_n
\end{bmatrix} \quad
A = \begin{bmatrix}
0      & 1        &  \vdots & \vdots       & 0        \\
0      & 0        &  1      &              & \vdots   \\
\vdots &          &         & \ddots       & \vdots   \\
0      &          &         &              &  1       \\
-a_n   & -a_{n-1} &  \cdots & \cdots       & -a_1
\end{bmatrix}
\end{align*}

\vspace*{-0.90cm}

\begin{minipage}[h]{0.25\linewidth}
\[
b = \begin{bmatrix}
0 \\
0 \\
\vdots \\
1
\end{bmatrix}
\]
\end{minipage}
\begin{minipage}[h]{0.75\linewidth}
\begin{align*}
& c = [1 \ 0 \ .. \ 0] \ \quad y =cx+du \ \text{and} \ d=0 \\
& Y(s) = [c(sI-A)^{-1}b+d]U(s) \quad \\
& \frac{Y(z)}{U(z)} = c(zI-A)^{-1}b+d
\end{align*}
\end{minipage}
\textbf{Deadbeat Controller and Deadbeat Response}
\vspace*{-0.25cm}
\begin{align*}
& x(k+1)=Gx(k)+Hu(k) \quad u(k)=-Kx(k) \\
& x(k+1)=(G-HK)x(k) \quad x(k)=(G-HK)^kx(0) \\
& x(k) = (G-HK)^kx(0) \quad x(k) =0 \quad \text(for) k \geq \quad q (q \leq n) \\
& \det(zI-G+HK)=z^n \quad N^n =0, \text{N is nilpotent matrix.}
\end{align*}
\vspace*{-0.7cm}

\textbf{Controllability} A system is controllable, if and only if, it is possible to transfer the system state from any arbitrary initial state x(0) to the origin in finite time. initial state x(0) $\rightarrow$ desired state: x(n)=0.%
%
\textbf{Controllability condition for SI continuous systems:} $\det C = \det[b, \ \ Ab, \ \, \cdots, A^{n-1}b] \neq 0$.

\textbf{Observability} A system is observable if any initial state x(0) can be determined from a finite number of output observations. $\det O_c = \det \begin{bmatrix}
c \\ cA \\ \vdots \\ cA^{n-1} \end{bmatrix} \neq 0$.

\textbf{Continuous State Transition Matrix:} $\phi(t)$,
$\phi(t)=e^{At}= \mathcal{L}^{-1}[(sI-A)^{-1}]$, then $\dot{\phi}(t)=A\phi(t) \quad \phi(0)=I$, $\dot(x)=Ax$ %\hfill \linebreak

Verification: $x(t)=\phi(0)x(0)=Ix(0)$
$\dot{x}(t)=\dot{\phi}(t)x(0)=A\phi(t)x(0)=Ax(t)$.

Properties of $\phi(t)$:
\vspace*{-0.4cm}
\begin{align*}
& 1) \ \ \phi(0)=e^{A0}=I \\
& 2) \ \ \phi(t) = e^{At} = (e^{(-At)})^{-1}=[\phi(-t)]^{-1} \\
& 3) \ \ \phi(t_1+t_2)=\phi(t_1)\phi(t_2)=\phi(t_2)\phi(t_1) \\
& 4) \ \ [\phi(t)]^n = \phi(nt) \\
& 5) \phi(t_0-t_1)\phi(t_1-t_2)=\phi(t_0-t_2)=\phi(-t_1+t_0)\phi(-t_2+t_1) \\
& e^{A(t_0-t_1)}e^{A(t_1-t_2)} = e^{A(t_0-t_2)}=e^{-A(t_1-t_0)}e^{-A(t_2-t_1)}
\end{align*}%
%
\textbf{BIBO Stability}
Output is bounded for any bounded input.
CTS systems : Poles in left half plane, Discrete Systems: poles inside unit circle.

\textbf{INTERNAL ( Also asymptotic stability)}
Def: Equilibrium state:
 Continuous systems: Assume u(t) = 0;
 $\dot{x}_e=0=Ax_e+bu \rightarrow x_e=0$ \hfill \break
  Discrete systems: Assume u(k) = 0;
 $x_e(k+1)=0=x_e(k)+Gx_e(k) \rightarrow x_e=0$ \hfill \break
\textbf{Def:} A system is asymptotically stable if any initial condition x(0) converges to
the equilibrium state $x_e=0$.
 (It is assumed $u(t) = 0,t \leq0$  or $u(k)=0, k\geq 0$)

 \textbf{Condition for asymptotic stability}: \hfill \break CTS $\Re[\lambda_i\{A\}]<0$ \hfill \break Discrete $|\lambda_i
 \{G\}|$
, all eigenvalues in unit circle

%\newpage
%\begin{multicols}{3}

$\text{BIBO Stability} \rightarrow \text{Asymptotic Stability (AS)}$ \hfill \break
BIBO Stability \& no pole zero cancellation $\rightarrow $ AS \hfill \break
%
Eigenvalues of A are the solutions of $\det(I\lambda -A) = 0$, \hfill \break
Poles of G(z) are the zeros of denominator poly.
$G(z)=d+c(zI-A)^{-1}b$ where $(zI-A)^{-1}=\frac{\text{adj}(zI-A)}{\text{det}(zI-A)}$
% $A_{ij}=(-1)^{i+j} M_{ij}$, (minor $M_{ij}$, $\det$ with deleted i and j rows/col.
% adj A
C: nonsingular if system controllable. If the system is controllable,
any closed-loop poles can be obtained, %i.e any desired transient response characteristics can be obtained
%\begin{comment}
%Adding a comment here, make sure to add in information about the controlleres and go home and study tommorw
%\end{comment}

\textbf{Feed-forward observers} State Observer: $\tilde{X}(k+1)=G\tilde{x}(k)+Hu(k)$
$\tilde{y}(k)=c \tilde{x}(k)$, Observed state: $\tilde{x}(k)$, Observation error: $e(k)=x(k)-\tilde{x}(k)$, $e(k+1)=Ge(k)$, Dynamics of error depend on G \hfill \break
\textbf{Prediction (full order) observer} where the estimate $\bar{x}(k+1)$ is obtained based on measurements of up to y(k).
\vspace*{-0.2cm}
\begin{align*}
& \bar{x}(k+1)=G\bar{x}(k)+Hu(k)+k_e[y(k)-\bar{y}(k)] \\
& \bar{x}(k+1)=[G-k_e c] \tilde{x}(k)+Hu(k)+k_ecx(k)
\end{align*}
$k_e$ for this observer can be obtained
using $k_e=O^{-1}\bar{A}^{-1}(\alpha-a)^T$, where \hfill \break
$\tilde{A}=\begin{bmatrix}
1   & 0 \cdots & \cdots & 0 \\
a_1 & 1 & & \\
\vdots & a_1 & . &  \\
\vdots & . & . & \\
a_{n-1} & a_{n-2} & \cdots & a_1 & 1
\end{bmatrix}$, \hfill \break  lower triangular Toeplitz matrix, A square matrix that is not singular, i.e., one that has a matrix inverse.
\textbf{Current observer} where the estimate is obtained based on measurements
up to $y(k+1)$.
\vspace*{-0.15cm}
\begin{align*}
& \tilde{x}(k+1)=G\tilde{x}(k)+Hu(k)+K_e[y(k+1)-c\tilde{x}(k+1)] \\
& \bar{z}(k+1)=c\bar{x}(k+1)
\end{align*}
\vspace*{-0.15cm}
\textbf{ASYMPTOTIC OBSERVERS 4 CTS
SYS}
\vspace*{-0.15cm}
\begin{align*}
& \dot{x}(t) = A x(t)+bu(t) \quad x(0-)=x_0 \\
& y(t) = cx(t) \quad t > 0- \\
& O x(0-) = [y(0-), \ \cdots \ y^{n-1}(0-)]
\end{align*}
\textbf{Open-loop Observer}
Use ($\{A,B,c\}$, $\{u(t), t> 0\}$, and $x_0$) $\rightarrow \{x(t),t>0-\}$,

Effects of disturbance $\epsilon$:
$\tilde{x}_0=x_0-\epsilon$, $|\epsilon| \ll |x_0|$, $\tilde{\dot{x}}(t)=A \tilde{x}(t)+bu(t)$, $\tilde{x}(0-)=\tilde{x}_0=x_0-\epsilon$,
$\dot{e}(t)=Ae(t)$, $e(0-)=\epsilon$, A is unstable $e(t) \rightarrow \infty$

\textbf{Closed-loop observer:}
Output Error: $y(t)-\tilde{y}(t)=y(t)-c\tilde{x}(t)=c[x(t)-\tilde{x}(t=ce(t)$, Observer $\tilde{x}(t)=A \tilde{x}(t)+bu(t)+l[y(t)-c\tilde{x}(t)$, $\tilde{x}(t_o)=\tilde{x}_o$ $\tilde{x}_o$ an estimated initial state vector $l$: feedback gain vector.
\textbf{Observer design:}
$l=O^{-1}\tilde{A}^{-1}(\alpha-a)^T$ \hfill \break
%$\det C = \det[H, \ GH, \ G^2H, \ \cdots, \ G^{n-1}H] \neq 0$, \\ \hfill
%$O_d = \begin{bmatrix}
%c & cG & \vdots & cG^{n-1}
%\end{bmatrix}^T$
%$\dot{\hat{x}}=T^{-1}AT\hat{x} + T^{-1}Bu$, $x = T\hat{x}$,$T=MW$, control matrix $M$, W is like $\tilde{A}$,but with upper triangular Toeplitiz matrix. $Q = (WN\ast)^{-1}$, N is observability matrix, and $x = Q\hat{x}$, $\hat{\dot{x}}= Q^{-1}AQ\hat{x} + Q^{-1}	Bu$,
%\vspace*{-0.1cm}
\textbf{1. Pole Placement CTS}
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
%\vspace*{-0.3cm}
\begin{align*}
& \dot{x}(t)=Ax(t)+bu(t) \quad y(t)=cx(t) \\
& a(s) = \det(sI-A)=s^n+a-1s^{n-1}+ \cdots + a_n
\end{align*}
%\vspace*{-0.2cm}
 \noindent Find a feedback gain vector K so that the characteristic polynomial of the resulting closed-loop system is given by the polynomial:
 %\vspace*{-0.2cm}
\begin{align*}
& \alpha(s) =s^n+\alpha_1s^{n-1}+ \cdots + \alpha_n \quad u(t) =hr(t)- Kx(t) \\
& \dot{x}(t) = (A-bK)x(t)+b h r(t) \quad y=cx(t) \\
& \alpha - a = K C \tilde{A}^T \quad K =(\alpha -a)\tilde{A}^{-T} C^{-1}
\end{align*}
 \vspace*{-0.2cm}
\includegraphics[width=\linewidth]{poleplacementPic.png}
 %\vspace*{-0.2cm}
\textbf{2. Tracking a Reference Signal}
 %\vspace*{-0.2cm}
\includegraphics[width=\linewidth]{trackingRefSig.png}
\textbf{Tracking}: y(t) should follow r(t) at steady state(ss)
i.e, y(k) follows r(k) at ss. Find $h$ in $u(k)=hr(k) -Kx(k)$ for tracking. ss $x(k+1)=x(k)$
%\vspace*{-0.2cm}
\begin{align*}
& \dot{x}(t)=Ax+bu=x(t) \downarrow \\
& x(t)=(A-bK)x(t)+bhr(t) \\
& y(t)= c(I-G+HK)^{-1}Hr(t) \quad y(t)=r(t) \\
& h = \frac{-1}{c(A-bK)^{-1}b}
\end{align*}
Estimation of unmeasurable state variables is commonly called observation. $G(s)=C(sI-A)^{-1}B$,
 $\Delta (\lambda)= (\lambda^2+2\zeta \omega_n+ \omega_n^2)(\lambda + \zeta \omega_n)$ \hfill \break
Overdamped $\zeta > 1$, Critically Damped $\zeta=1$, Underdamped(oscillations) $0< \zeta < 1$
$\zeta = \frac{-\ln(\% OS /100)}{\sqrt{\pi^2 + \ln^2(\% OS /100)}}$
$t_{s} = \frac {4}{\sigma } = \frac {4}{\zeta \omega _{n}}\ \left ( 2\%\ band \right )$,
$t_{s} = \frac {3}{\sigma } = \frac {3}{\zeta \omega _{n}}\ \left ( 5\%\ band \right )$,
% break to make column
\columnbreak
\textbf{Discretization of CTS-Time State Equations:}
\includegraphics[width=\linewidth]{dis2CTS.png}
%\vspace*{-1.1cm}
\begin{align*}
&  \dot{x}=Ax+bu \quad G(T)=e^{AT}= \phi(T) \ H(T) = (\int_0^T e^{AT} \ dt)b
\end{align*}
%\vspace*{-0.6cm}
\textbf{3. Integral Error Feedback Discrete}
%\vspace*{-0.05cm}
$
x(k+1)=Gx(k)+Hu(k)+w(k) \quad y(k)=c(k)x(k)
$
w(k) is unknown but constant disturbance.

Problem: Design a state-feedback controller so that
1) The CL eigenvalues are at prescribed locations.

2) The output y(k) follows the reference r(k) for any w(k)
(constant, but unknown) at steady state.

$
 \begin{bmatrix} x(k+1) \\ q(k+1)\end{bmatrix} =
\begin{bmatrix}G & 0 \\ -T_c & 1\end{bmatrix}\begin{bmatrix}x(k) \\ q(k)\end{bmatrix}+
\begin{bmatrix}H \\ 0\end{bmatrix}u(k)+\begin{bmatrix} 0 \\ T\end{bmatrix}r(k)+\begin{bmatrix}w(k) \\ 0\end{bmatrix} \ \
q(k+1)=q(k)+T(r(k)-y(k))
$

Find $K = [K_x, K_q]$,$K=(\alpha-a)\tilde{A}^{-T}C^{-1}$,

$ \begin{bmatrix} x(k+1) \\ q(k+1)\end{bmatrix} =
\begin{bmatrix}G-HK_x & -HK_q \\ -T_c & 1\end{bmatrix}\begin{bmatrix}x(k) \\ q(k)\end{bmatrix}+
\begin{bmatrix}0 \\ T\end{bmatrix}u(k)+\begin{bmatrix} 0 \\ T\end{bmatrix}r(k)+\begin{bmatrix}w(k) \\ 0\end{bmatrix}$ $u(k)=-[K_x, K_q]\begin{bmatrix} x(k) \\ q(k)
\end{bmatrix}$ %\hfill \break %using a(z) as given  given characteristic polynomial, and $\alpha(z)$ as desired ch. eqn. \hfill \break
%\begin{minipage}[h]{1\linewidth}
%\textbf{Discrete} \hfill \break

\includegraphics[width=\linewidth]{DiscreteIntegralTracking.png}
%\end{minipage}
%\begin{minipage}[h]{1\linewidth}
%\textbf{Continuous}
\textbf{3. Integral Error Feedback CTS}

$ \begin{bmatrix} x(k+1) \\ q(k+1)\end{bmatrix} =
\begin{bmatrix}A & 0 \\ -c & 1\end{bmatrix}\begin{bmatrix}x(k) \\ q(k)\end{bmatrix}+
\begin{bmatrix}b \\ 0\end{bmatrix}u(k)+\begin{bmatrix} 0 \\ 1\end{bmatrix}r(k)+\begin{bmatrix}w(k) \\ 0\end{bmatrix} \ \
q(k)=(r(k)-y(k)) $
\includegraphics[width=\linewidth]{CTSIntegralTracking.png}
%\end{minipage}
\textbf{Combined Observer-Controller}

Observer feedback: $l(y(t)-c\tilde{x}(t))$,

Feedback control signal $u(t)=-K\tilde{x}(t)+v(t)$ \hfill \break
Observation error: $\dot{e}(t)=(A-lc)e(t)$
$\det \begin{bmatrix}sI-A & bK \\
-lc & sI-A+lc+bK
\end{bmatrix} \\ =\det(sI-A+bk)\det(sI-A+lc)$
$\begin{bmatrix}
\dot{x}(t) \\
\dot{\tilde{x}}(t)
\end{bmatrix}= \begin{bmatrix}
A  & -bK \\
lc & A-lc-bK
\end{bmatrix}\begin{bmatrix}
x(t) \\
{\tilde{x}}(t)
\end{bmatrix}+
\begin{bmatrix}
b \\ b
\end{bmatrix} v(t) \quad
\begin{bmatrix}
x(t_0) \\ \tilde{x}(t_0)
\end{bmatrix}=
\begin{bmatrix}
x_0 \\ \tilde{x}_0
\end{bmatrix}
$
\vspace{0.1 cm}
Quad Form: $ax^2+bx+c=0 \quad x= \frac{-b \pm \sqrt{b^2-4ac}}{2a}$,
Steady-state error is defined as the difference between the input (command) and the output of a system in the limit as time goes to infinity. $x_1(1)=x_2(0)$.
\includegraphics[width=\linewidth]{fullEstimateobs.png}
\includegraphics[width=\linewidth]{keFeedback.png}
\includegraphics[width=\linewidth]{whyNot.png}
\includegraphics[width=\linewidth]{full-state-obs.png}
\includegraphics[width=\linewidth]{min-order-observer.png}

\subsection{Stability Test for Digital Systems}

\textbf{Jury-Marden Table Uses function P of z} \newline
%\vspace*{-0.25cm}
\begin{align*}
& b_k = \det \begin{bmatrix}
a_n & a_{n-1-k} \\
a_0 & a_{k+1}
\end{bmatrix} \\
& k = 0,1,  \cdots n-1 \\
& c_k = \det \begin{bmatrix}
b_{n-1} & b_{n-2-k} \\
b_0 & b_{k+1}
\end{bmatrix} \\
& k = 0,1,  \cdots n-1 \\
& q_k = \det \begin{bmatrix}
p_{3} & p_{2-k} \\
p_0 & p_{k+1}
\end{bmatrix} \\
& k =0,1,2
\end{align*}

\begin{tabular}{llllllll}
	\cline{1-5}
	Row & $z^0$     & $z^1$     & $z^2$     &          & $z^{n-2}$ & $z^{n-1}$ & $z^n$ \\ %\cline{1-5}
	1   & $a_n$     & $a_{n-1}$ & $a_{n-2}$ & $\cdots$ & $a_2$     & $a_1$     & $a_0$ \\
	2   & $a_0$     & $a_1$     & $a_2$     & $\cdots$ & $a_{n-2}$ & $a_{n-1}$ & $a_n$ \\
	3   & $b_{n-1}$ & $b_{n-2}$ & $b_{n-3}$ & $\cdots$ & $b_1$     & $b_0$     &       \\ %\cline{1-5}
	4   & $b_0$     & $b_1$     & $b_2$     & $\cdots$ & $b_{n-2}$ & $b_{n-1}$ &       \\
	5   & $c_{n-2}$ & $c_{n-3}$ & $c_{n-4}$ & $\cdots$ & $c_0$     &           &       \\
	6   & $c_0$     & $c_1$     & $c_2$     & $\cdots$ & $c_{n-2}$ &           &      \\
	2n-5& $p_3$ & $p_2$ & $p_1$ & $p_0$ & & & \\
	2n-4& $p_0$ & $p_1$ & $p_2$ & $p_3$ & & & \\
	2n-3& $q_2$ & $q_1$ & $q_0$ & & & &
\end{tabular}

\begin{align*}
& P(z) = a_0z^n+a_1z^{n-1} + \cdots + a_{n-1}z+a_n \quad G(z)= \frac{A(z)}{P(z)} \\
& \text{Stability Condition:} \quad P(z) \neq 0 \quad |z| \geq 1 \quad (\text{Draw Unit Circle to test stability})\\
& \text{Routh-Stability in Digital Domain: } s = \frac{z+1}{z-1} \quad z=\frac{s+1}{s-1}
\end{align*}

\begin{align*}
& G(z) = \mathcal{Z} \left\{\left(\frac{1-e^{-s}}{s}\right) \left[ \frac{1}{s+1}\right] \left[\frac{1}{s}\right] \right\} \rightarrow G_1(z) = (1-z^{-1})\mathcal{Z} \left\{ \frac{1}{s^2(s+1)} \right\}
\end{align*}

All first-column elements of the Routh array are to be of the same sign. $a_0s^n + a_1s^{n-1}+ \cdots + a{n-1} s + a_n = 0$, first row is even entries $a_0$, $a_2$, next row is $a_1$, $a_2$, b entries are the same are jury-marden table.

\subsection{Z-transform}

\begin{tabular}{c c}
	$\mathcal{Z} \left\{ f_1(t) \pm f_2(t) \right\}=F_1(z)+F_2(z)$ & Addition\\
	$\mathcal{Z} \left\{ af(t) \right\}= aF(z)$ & Multiplication by a Constant \\
	$\mathcal{Z} \left\{ f(t-nT) \right\}=z^{-n}F(z)$ & Shifting \\
	$\mathcal{Z} \left\{ f(t+kT) \right\}=z^{k}F(z)-z^{k}f(0)- \cdots - z f(kT-T)$ & Shifting (cont'd) \\
	$\mathcal{Z} \left\{ e^{\mp at} f(t) \right\}=F(ze^{\pm at})$ & Complex Translation \\
	$\lim_{k \rightarrow \infty} f(kT)= \lim_{z \rightarrow 0}F(z)$ & Initial Value Theorem \\
	If $(1-z^{-1})F(z)$ has all singularities inside unit disk $|z|=1$, then & Final Value Theorem \\
	$\lim_{k \rightarrow \infty} f(kT) = \lim_{z \rightarrow 1} (1-z^{-1})F(z)$ & \\
	$\mathcal{Z} \left\{ \frac{\partial}{\partial a} f(t,a) \right\} = \frac{\partial}{\partial a} F(z,a)$ & Partial differentiation
\end{tabular}


\section{Review of Polar Coordinates}
\noindent
Polar coordinates represent every point in 2D space as a distance from the origin $r$ and an angle from the horizontal $\theta$. This means that unlike rectangular (Cartesian) $(x,y)$ coordinates, different polar coordinates can represent the same point: $(2, -\pi/4) = (-2, 3\pi/4)=(2, 7\pi/4)$.

[INSERT IMAGE]

\noindent
Polar coordinates can be transformed into rectangular coordinates by $x = r\cos{\theta}$ and $ y =r\sin{\theta}$. This means that $r = \sqrt{x^2+y^2}$ and $\theta = \tan^{-1}{\frac{y}{x}}$.

\input{./curvilinearCoordinates/circles_polar}
\input{./curvilinearCoordinates/lines_polar}
\input{./curvilinearCoordinates/integration_polar}


% !TEX root = ./busty_transcription.tex
\section{Bayesian inference}
\label{sec:bayesian}

\subsection{The problem of parameter inference}

One could argue that the whole goal of formulating theoretical models about
nature is to sharpen our understanding from qualitative statements to precise
quantitative assertions about the relevant features of the natural phenomena in
question \cite{Gunawardena2014}. It is in these models that we intend to distill
the essential parts of the object of study. Writing down such models leads to a
propagation of mathematical variables that parametrize our models. By assigning
numerical values to these parameters we can compute concrete predictions that
can be contrasted with experimental data. For these predictions to match the
data the parameter values have to carefully be chosen from the whole parameter
space. But how do we go about assessing the effectiveness of different regions
of parameter space to speak to the ability of our model to reproduce the
experimental observations? The language of probability, and more specifically of
Bayesian statistics is --we think-- the natural language to tackle this
question.

\subsubsection{Bayes' theorem}

Bayes' theorem is a simple mathematical statement that can apply to \textit{any}
logical conjecture. For two particular events $A$ and $B$ that potentially
depend on each other Bayes' theorem gives us a recipe for how to update our
beliefs about one, let us say $B$, given some state of knowledge, or lack thereof, about
$A$. In its most classic form Bayes' theorem is written as
\begin{equation}
P(B \mid A) = {P(A \mid B) P(B) \over P(A)},
\end{equation}
where the vertical line $\mid$ is read as ``given that''. So $P(B \mid A)$ is
read as probability of $B$ given that $A$ took place. $A$ and $B$ can be any
logical assertion. In particular the problem of Bayesian inference focuses on
the question of finding the probability distribution of a particular parameter
value given the data.

For a given model with a set of parameters $\vec{\theta} = (\theta_1, \theta_2,
\ldots, \theta_n)$, the so-called \textit{posterior distribution}
$P(\vec{\theta} \mid D)$, where $D$ is the experimental data, quantifies the
plausibility of a set of parameter values given our observation of some
particular dataset. In other words, through the application of Bayes' formula we
update our beliefs on the possible values that parameters can take upon learning
the outcome of a particular experiment. We specify the word ``update'' as we
come to every inference problem with prior information about the plausibility of
particular regions of parameter space even before performing any experiment.
Even when we claim as researchers that we are totally ignorant about the values
that the parameters in our models can take, we always come to a problem with
domain expertise that can be exploited. If this was not the case, it is likely
that the formulation of our model is not going to capture the phenomena we claim
to want to understand. This prior information is captured in the \textit{prior
probability} $P(\vec{\theta})$. The relationship between how parameter values
can connect with the data is enconded in the \textit{likelihood function} $P(D
\mid \vec{\theta})$. Our theoretical model, whether deterministic or
probabilistic, is encoded in this term that can be intuitively understood as the
probability of having observed the particular experimental data we have at hand
given that our model is parametrized with the concrete values $\vec{\theta}$.
Implicitly here we are also conditioning on the fact that our theoretical model
is ``true,'' i.e. the model itself if evaluated or simulated in the computer is
capable of generating equivalent datasets to the one we got to observe in an
experiment. In this way Bayesian inference consists of applying Bayes' formula
as
\begin{equation}
P(\vec{\theta} \mid D) \propto P(D \mid \vec{\theta}) P(\vec{\theta}).
\end{equation}
Notice than rather than writing the full form of Bayes' theorem, we limit
ourselves to the terms that depend on our quantity of interest --that is the
parameter values themselves $\vec{\theta}$-- as the denominator $P(D)$ only
serves as a normalization constant.

We also emphasize that the dichotomy we have presented between prior and
likelihood is more subtle. Although it is often stated that our prior
knowledge is entirely encapsulated by the obviously named prior
probability $P(\vec{\theta})$, this is usually too simplistic.
The form(s) we choose for our likelihood function
$P(D \mid \vec{\theta})$ also draw heavily on our prior domain expertise
and the assumptions, implicit and explicit, that these choices encode are
at least as important, and often inseparable from,
the prior probability, as persuasively argued in~\cite{Gelman2017}.

\subsubsection{The likelihood function}

As we alluded in the previous section it is through the likelihood function
$P(D \mid \vec{\theta})$ that we encode the connection between our parameter
values and the experimental observables. Broadly speaking there are two classes
of models that we might need to encode into our likelihood function:
\begin{itemize}
        \item Deterministic models: Models for which a concrete selection of
        parameter values give a single output. Said differently, models
        with a one-to-one mapping between inputs and outputs.
        \item Probabilistic models: As the name suggests, models that, rather than
        having a one-to-one input-output mapping, describe the full
        probability distribution of possible outputs.
\end{itemize}
In this paper we focus on inference done with probabilistic models. After all,
the chemical master equations we wrote down describe the time evolutions of the
mRNA probability distribution. So all our terms $P(\vec{\theta} \mid D)$ will be
given by the steady-state solution of the corresponding chemical master equation
in question. This is rather convenient as we do not have to worry about adding a
statistical model on top of our model to describe deviations from the
predictions. Instead our models themselves focus on predicting such variation
in cell count.

\subsubsection{Prior selection}
The different models explored in this work embraced different levels of
coarse-graining that resulted in a diverse number of parameters for different
models. For each of these model configurations Bayes' theorem demands from us to
represent our preconceptions on the possible parameter values in the form of the
prior $P(\vec{\theta})$. Throughout this work for models with $> 1$ parameter we
assign independent priors to each of the parameters; this is
\begin{equation}
P(\vec{\theta}) = \prod_{i=1}^n P(\theta_i).
\end{equation}
Although it is not uncommon practice to use non-informative, or maximally
uninformative priors, we are of the mindset that this is a disservice to the
philosophical and practical implications of Bayes' theorem. It sounds almost
contradictory to claim that can we represent our thinking about a natural
phenomenon in the form of a mathematical model --in the context of Bayesian
inference this means choosing a form for the likelihoods, and even making
this choice presupposes prior understanding or assumptions as to the
relevant features in the system under study-- but that we have absolutely
no idea what the parameter values could or could not be. We therefore make
use of our own expertise, many times in the form of order-of-magnitude
estimates, to write down weakly-informative prior distributions
for our parameters.

For our particular case all of the datasets from~\cite{Jones2014} used in this
paper have $\mathcal{O}(10^3)$ data points. What this implies is that our
particular choice of priors will not significantly affect our inference as long
as they are broad enough. A way to see why this is the case is to simply look at
Bayes' theorem. For $N ~ 1000-3000$ datum all of the independent of each other
and $n \ll 10^3$ parameters Bayes' theorem reads as
\begin{equation}
P(\vec{\theta} \mid D) \propto \prod_{k=1}^{N} P(d_k \mid \vec{\theta})
\prod_{i=1}^n P(\theta_i),
\end{equation}
where $d_k$ represents the $k$-th datum. That means that if our priors span a
wide range of parameter space, the posterior distribution would be dominated by
the likelihood function.

\subsubsection{Expectations and marginalizations}
For models with more than one or two parameters, it is generally difficult
to visualize or reason about the full joint posterior distribution
$P(\vec{\theta} \mid D)$ directly.
One of the great powers of Bayesian analysis is \textit{marginalization},
allowing us to reduce the dimensionality to only the parameters of
immediate interest by averaging over the other dimensions.
Formally, for a three dimensional model with parameters
$\theta_1$, $\theta_2$, and $\theta_3$, we can for instance
marginalize away $\theta_3$ to produce a 2D posterior as
\begin{equation}
P(\theta_1, \theta_2 \mid D) \propto
        \int_{\theta_3} d\theta_3 \,P(\theta_1, \theta_2, \theta_3 \mid D),
\end{equation}
or we can marginalize away $\theta_1$ and $\theta_3$ to produce the
1D marginal posterior of $\theta_2$ alone, which would be
\begin{equation}
P(\theta_2 \mid D) \propto
        \int_{\theta_1} d\theta_1 \int_{\theta_3} d\theta_3
        \,P(\theta_1, \theta_2, \theta_3 \mid D).
\end{equation}
Conceptually, this is what we did in generating the 2D slices of the
full 9D model in Figure~\ref{fig4:repressed_post_full}(A).
In practice, this marginalization is even easier with Markov Chain Monte Carlo
samples in hand. Since each point is simply a list of parameter values,
we simply ignore the parameters which we want to marginalize
away~\cite{Gelman2013}.

\subsubsection{Markov Chain Monte Carlo}
The theory and practice of Bayesian inference with Markov Chain Monte Carlo
(MCMC) is a rich subject with fascinating and deep analogies to statistical
mechanics, even drawing on classical Hamiltonian mechanics and general
relativity in its modern incarnations. We refer the interested reader
to~\cite{Gelman2013} and~\cite{Betancourt2018} for excellent introductions.
Here we merely give a brief summary of
the MCMC computations carried out in this work.

We used the Python package \texttt{emcee} for most of the MCMC sampling
in this work. For the constitutive promoter inference, we also ran
sampling with the excellent Stan modeling language as a check. We did not
use Stan for the inference of the simple repression model because
implementing the gradients of the hypergeometric function ${_2F_1}$
appearing in Eq.~\ref{eq:p_m_bursty+rep_appdx}, the probability
distribution for our bursty model with repression, would have been
an immensely challenging task. \texttt{emcee} was more than adequate for
our purposes, and we were perhaps lucky that the 9-D posterior model
for the model of simple repression with bursty promoter was quite well
behaved and did not require the extra power of the Hamiltonian Monte
Carlo algorithm provided by Stan~\cite{Carpenter2017}.
Source code for all statistical inference will be made available at
\url{https://github.com/RPGroup-PBoC/bursty_transcription}.

\subsection{Bayesian inference on constitutive promoters}
\label{sec:si_bayes_unreg}

Having introduced the ideas behind Bayesian inference we are ready to apply the
theoretical machinery to our non-equilibrium models. In particular in this
section we will focus on model 1 and model 5 in
Figure~\ref{fig2:constit_cartoons}(A). Model 1, the Poisson promoter, will help
us build practical intuition into the implementation of the Bayesian inference
pipeline. As we noted in Section~\ref{sec:beyond_means} of the main text, this
model cannot be reconciled with experimental data from observables such as the
Fano factor. In other words, we acknowledge that this model is ``wrong,'' but we
still see value in going through the analysis since the simple nature of the
model translates into a neat statistical analysis.

\subsubsection{Model 1 - Poisson promoter}

Model 1 in Figure~\ref{fig2:constit_cartoons}(A) predicts a  mRNA distribution
whose steady-state solution is given by a Poisson distribution with parameter
$\lambda \equiv r / \gamma$, where $r$ is the mRNA production rate, and $\gamma$
is the mRNA degradation rate~\cite{Sanchez2013}. The goal of our inference
problem is then to find the probability distribution for the parameter value
$\lambda$ given the experimental data. By Bayes' theorem this can be written as
\begin{equation}
p(\lambda \mid D) = {p(D \mid \lambda) p(\lambda) \over p(D)},
\end{equation}
where $D = \{m_1, m_2, \ldots, m_N \}$ are the single-cell mRNA experimental
counts. As is standard we will neglect the denominator $p(D)$ on the right
hand side since it is independent of $\lambda$ and serves only as a
normalization factor.

The steady-state solution for the master equation defines the likelihood term
for a single cell $p(m \mid \lambda)$. What this means is that for a given
choice of parameter $\lambda$, under model 1 of
Figure~\ref{fig2:constit_cartoons}(A), we expect to observe $m$ mRNAs in a
single cell with probability
\begin{equation}
p(m\mid\lambda) = \frac{\lambda^m e^{-\lambda}}{m!}.
\label{eq:poisson_inference010}
\end{equation}
Assuming each cell's mRNA count in our dataset is independent of others, the
likelihood of the full inference problem $p(D\mid\lambda)$ is simply a product
of the single cell likelihoods given by Eq.~\ref{eq:poisson_inference010} above, so
\begin{equation}
p(D\mid\lambda) = \prod_{k=1}^N \frac{\lambda^{m_k}e^{-\lambda}}{m_k!}.
\end{equation}

Throughout this Appendix we will appeal to the convenient notation for
probability distributions of the form
\begin{equation}
m \sim \text{Poisson}(\lambda),
\end{equation}
where the symbol ``$\sim$'' can be read as \textit{is distributed according to}.
So the previous equation can be read as: the mRNA copy number $m$ is distributed
according to a Poisson distribution with parameter $\lambda$. Our objective then
is to compute the posterior probability distribution $P(\lambda \mid D)$, where,
as in the main text, $D = \{ m_1, m_2, \ldots, m_N \}$ are the data consisting
of single-cell mRNA counts. Since we can assume that each of the cells mRNA
counts are independent of any other cells, our likelihood function $P(D \mid
\lambda)$ consists of the product of $N$ Poisson distributions.

To proceed with the inference problem we need to specify a prior. In this case
we are extremely data-rich, as the dataset from Jones et.\ al~\cite{Jones2014}
has of order 1000-3000 single-cell measurements for each promoter, so our choice
of prior matters little here, as long as it is sufficiently broad. A convenient
choice for our problem is to use a \textit{conjugate} prior. A conjugate prior
is a special prior that causes the posterior to have the same functional form as
the prior, simply with updated model parameters. This makes calculations
analytically tractable and also offers a nice interpretation of the inference
procedure as updating our knowledge about the model parameters. This makes
conjugate priors very useful when they exist. The caveat is that conjugate
priors only exist for a very limited number of likelihoods, mostly with only one
or two model parameters, so in almost all other Bayesian inference problems, we
must tackle the posterior numerically.

But, for the problem at hand, a conjugate prior does in fact exist. For a
Poisson likelihood of identical and identically distributed data, the conjugate
prior is a gamma distribution, as can be looked up in, e.g.,~\cite{Gelman2013},
Section 2.6. Putting a gamma prior on $\lambda$ introduces two new parameters
$\alpha$ and $\beta$ which parametrize the gamma distribution itself, which we
use to encode the range of $\lambda$ values we view as reasonable. Recall
$\lambda$ is the mean steady-state mRNA count per cell, which \textit{a priori}
could plausibly be anywhere from 0 to a few hundred. $\alpha=1$ and $\beta=1/50$
achieve this, since the gamma distribution is strictly positive with mean
$\alpha/\beta$ and standard deviation $\sqrt{\alpha}/\beta$. To be explicit,
then, our prior is
\begin{equation}
\lambda \sim \text{Gamma}(\alpha, \beta)
\end{equation}

As an aside, note that if we did not know that our prior was a conjugate prior,
we could still write down our posterior distribution from its definition as
\begin{equation}
p(\lambda\mid D,\alpha,\beta)
\propto p(D\mid\lambda) p(\lambda \mid\alpha,\beta)
\propto \left(\prod_{k=1}^N \frac{\lambda^{m_k}e^{-\lambda}}{m_k!}\right)
        \frac{\beta}{\Gamma(\alpha)}(\beta\lambda)^{\alpha-1} e^{-\beta\lambda}
.
\end{equation}
Without foreknowledge that this in fact reduces to a gamma distribution, this
expression might appear rather inscrutable. When conjugate priors are
unavailable for the likelihood of interest - which is almost always the case for
models with $>1$ model parameter - this inscrutability is the norm, and making
sense of posteriors analytically is almost always impossible. Fortunately, MCMC
sampling provides us a powerful method of constructing posteriors numerically
which we will make use of extensively.

Since we did use a conjugate prior, we may simply look up our posterior in any
standard reference such as~\cite{Gelman2013}, Section 2.6,
from which we find that
\begin{equation}
\lambda
\sim \text{Gamma}\left(\alpha + \bar{m}N, \beta + N\right),
\end{equation}
where we defined the sample mean $\bar{m} = \frac{1}{N}\sum_k m_k$ for
notational convenience. A glance at the FISH data from~\cite{Jones2014} reveals
that $N$ is $\mathcal{O}(10^3)$ and $\langle m\rangle \gtrsim 0.1$ for all
constitutive strains in~\cite{Jones2014}, so $\bar{m}N \gtrsim 10^2$. Therefore
as we suspected, our prior parameters are completely overwhelmed by the data.
The prior behaves, in a sense, like $\beta$ extra ``data points''
with a mean value of $(\alpha-1)/\beta$~\cite{Gelman2013}, which
gives us some intuition for how much data is needed to overwhelm
the prior in this case: enough data $N$ such that $\beta\ll N$
and $\alpha/\beta \ll \bar{m}$. In
fact, $\bar{m}N$ and $N$ are so large that we can, to an excellent
approximation, ignore the $\alpha$ and $\beta$ dependence and approximate the
gamma distribution as a Gaussian with mean $\bar{m}$ and standard deviation
$\sqrt{\bar{m}/N}$, giving
\begin{equation}
\lambda
\sim \text{Gamma}\left(\alpha + \bar{m}N, \beta + N\right)
\approx \text{Normal}\left(\bar{m}, \sqrt{\frac{\bar{m}}{N}}\right).
\end{equation}
As an example with real numbers, for the \textit{lacUV5} promoter, Jones et.\
al~\cite{Jones2014} measured 2648 cells with an average mRNA count per cell of
$\bar{m} \approx 18.7$. In this case then, our posterior is
\begin{equation}
\lambda
\sim \text{Normal}\left(18.7, 0.08\right),
\label{eq:gauss_posterior}
\end{equation}
which suggests we have inferred our model's one parameter to a precision of
order 1\%.

This is not wrong, but it is not the full story. The model's posterior
distribution is tightly constrained, but is it a good generative model? In other
words, if we use the model to generate synthetic data in the computer does it
generate data that look similar to our actual data, and is it therefore
plausible that the model captures the important features of the data generating
process? This intuitive notion can be codified with \textit{posterior predictive
checks}, or PPCs, and we will see that this simple Poisson model fails badly.

The intuitive idea of posterior predictive checks is simple:
\begin{enumerate}
\item Make a random draw of the model parameter $\lambda$ from the posterior
distribution.
\item Plug that draw into the likelihood and generate a synthetic dataset
$\{m_k\}$ conditioned on $\lambda$.
\item Repeat many times.
\end{enumerate}
More formally, the posterior predictive distribution can be thought of as the
distribution of future yet-to-be-observed data, conditioned on the data we have
already observed. Clearly if those data appear quite different, the model has a
problem. Put another way, if we suppose the generative model is true, i.e. we
claim that our model explains the process through which our observed
experimental data was generated, then the synthetic datasets we generate should
resemble the actual observed data. If this is not the case, it suggests the
model is missing important features. All the data we consider in this work are
1D (distributions of mRNA counts over a population) so empirical cumulative
distribution functions ECDFs are an excellent visual means of comparing
synthetic and observed datasets. In general for higher dimensional datasets,
much of the challenge is in merely designing good visualizations that can
actually show if synthetic and observed data are similar or not.

For our example Poisson promoter model then, we merely draw many random numbers,
say 1000, from the Gaussian posterior in Eq.~\ref{eq:gauss_posterior}. For each
one of those draws, we generate a dataset from the likelihood, i.e., we draw
2648 (the number of observed cells in the actual dataset) Poisson-distributed
numbers for each of the 1000 posterior draws, for a total of 2648000 samples
from the posterior predictive distribution.

To compare so many samples with the actual observed data, one excellent
visualization for 1D data is ECDFs of the quantiles, as shown for our Poisson
model in~\fig{fig:constit_post_full}(B) in the main text.

\subsubsection{Model 5 - Bursty promoter}

Let us now consider the problem of parameter inference from FISH data for model
five from~\fig{fig1:means_cartoons}(C). As derived in
Appendix~\ref{sec:gen_fcn_appdx}, the steady-state mRNA distribution in this
model is a negative binomial distribution, given by
\begin{equation}
p(m) = \frac{\Gamma(m+k_i)}{\Gamma(m+1)\Gamma(k_i)}
        \left(\frac{1}{1+b}\right)^{k_i}
        \left(\frac{b}{1+b}\right)^m,
\label{eq:si_neg_bionom}
\end{equation}
where $b$ is the mean burst size and $k_i$ is the burst rate nondimensionalized
by the mRNA degradation rate $\gamma$. As sketched earlier, we can intuitively
think about this distribution through a simple story. The story of this
distribution is that the promoter undergoes geometrically-distributed bursts of
mRNA, where the arrival of bursts is a Poisson process with rate $k_i$ and the
mean size of a burst is $b$.

As for the Poisson promoter model, this expression for the steady-state mRNA
distribution is exactly the likelihood we want to use in Bayes' theorem. Again
denoting the single-cell mRNA count data as $D=\{m_1, m_2,\dots, m_N\}$, here
Bayes' theorem takes the form
\begin{equation}
p(k_i, b \mid D) \propto p(D\mid k_i,b)p(k_i, b),
\end{equation}
where the likelihood $p(D\mid k_i,b)$ is given by the product of $N$ negative
binomials as in Eq.~\ref{eq:si_neg_bionom}. We only need to choose priors on
$k_i$ and $b$. For the datasets from~\cite{Jones2014} that we are analyzing, as
for the Poisson promoter model above we are still data-rich so the prior's
influence remains weak, but not nearly as weak because the dimensionality of our
model has increased from one to two.

We follow the guidance of~\cite{Gelman2013}, Section 2.9 in opting for
weakly-informative priors on $k_i$ and $b$ (conjugate priors do not exist for
this problem), and we find ``street-fighting estimates''~\cite{Mahajan2010} to
be an ideal way of constructing such priors. The idea of weakly informative
priors is to allow all remotely plausible values of model parameters while
excluding the completely absurd or unphysical.

Consider $k_i$. Some of the strongest known bacterial promoters control rRNA
genes and initiate transcripts no faster than $\sim 1/\text{sec}$. It would be
exceedingly strange if any of the constitutive promoters from~\cite{Jones2014}
were stronger than that, so we can take that as an upper bound. For a lower
bound, if transcripts are produced too rarely, there would be nothing to see
with FISH. The datasets for each strain contain of order $10^3$ cells, and if
the $\langle m \rangle = k_i b/\gamma \lesssim 10^{-2}$, then the total number
of expected mRNA detections would be single-digits or less and we would have
essentially no data on which to carry out inference. So assuming $b$ is not too
different from 1, justified next, and an mRNA lifetime of $\gamma^{-1}\sim
3-5~\text{min}$, this gives us soft bounds on $k_i/\gamma$ of perhaps $10^{-2}$
and $3\times 10^1$.

Next consider mean burst size $b$. This parametrization of the geometric
distribution allows bursts of size zero (which could representing aborted
transcripts and initiations), but it would be quite strange for the mean burst
size $b$ to be below $\sim10^{-1}$, for which nearly all bursts would be of size
zero or one. For an upper bound, if transcripts are initiating at a rate
somewhat slower than rRNA promoters, then it would probably take a time
comparable to the lifetime of an mRNA to produce a burst larger than 10-20
transcripts, which would invalidate the approximation of the model that the
duration of bursts are instantaneous compared to other timescales in the
problem. So we will take soft bounds of $10^{-1}$ and $10^1$ for $b$.

Note that the natural scale for these ``street-fighting estimates'' was a log
scale. This is commonly the case that our prior sense of reasonable and
unreasonable parameters is set on a log scale. A natural way to enforce these
soft bounds is therefore to use a lognormal prior distribution, with the soft
bounds set $\pm2$ standard deviations from the mean.

With this, we are ready to write our full generative model as
\begin{equation}
\begin{split}
\ln k_i \sim \text{Normal}(-0.5, 2),
\\
\ln b \sim \text{Normal}(0.5, 1),
\\
m \sim \text{NBinom}(k_i, b).
\end{split}
\end{equation}
Section~\ref{section_04_bayesian_inference} in the main text details the
results of applying this inference to the single-cell mRNA counts data. There
we show the posterior distribution for the two parameters for different
promoters. Figure~\ref{figS:ppc_unreg} shows the so-called posterior predictive
checks (see main text for explanation) for all 18 unregulated promoters shown
in the main text.

\begin{figure}[p]
\centering
\includegraphics{../../figures/si/figS0X_ppc.pdf}
\caption{\textbf{Theory-data comparison of inference on unregulated promoters.}
Comparison of the inference (red shaded area) vs the experimental measurements
(black lines) for 18 different unregulated promoters with different mean mRNA
expression levels from Ref.~\cite{Jones2014}. Upper panels show the empirical
cumulative distribution function (ECDF), while the lower panels show the
differences with respect to the median of the posterior samples. White numbers
are the same as in Figure~\ref{fig1:means_cartoons} for cross comparison. The
predicted binding energies $\beta\Delta\varepsilon_p$ were obtained from the
energy matrix model in Ref.~\cite{Brewster2012}}
\label{figS:ppc_unreg}
\end{figure}

\subsection{Bayesian inference on the simple-repression architecture}

As detailed in~\ref{section_04_bayesian_inference} in the main text the
inference on the unregulated promoter served as a stepping stone towards our
ultimate goal of inferring repressor rates from the steady-state mRNA
distributions of simple-repression architectures. For this we expand the
one-state bursty promoter model to a two-state promoter as schematized in
Figure~\ref{fig1:means_cartoons}(C) as model 5. This model adds two new
parameters: the repressor binding rate $k^+$, solely function of the repressor
concentration, and the repressor dissociation rate $k^-$, solely a function of
the repressor-DNA binding affinity.

The structure of the data in~\cite{Jones2014} for regulated promoters tuned
these two parameters independently. In their work the production of the LacI
repressor was under the control of an inducible promoter regulated by the TetR
repressor as schematized in Figure~\ref{figS:aTc_circuit}. When TetR binds to the
small molecule anhydrotetracycline (aTc), it shifts to an inactive conformation
unable to bind to the DNA. This translates into an increase in gene expression
level. In other words, the higher the concentration of aTc added to the media,
the less TetR repressors that can control the expression of the \textit{lacI}
gene, so the higher the concentration of LacI repressors in the cell. So by
tuning the amount of aTc in the media where the experimental strains were grown
they effectively tune $k^+$ in our simple theoretical model. On the other hand
to tune $k^-$ the authors swap three different binding sites for the LacI
repressor, each with different repressor-DNA binding affinities previously
characterized \cite{Garcia2011a}.

\begin{figure}[h!]
\centering
\includegraphics{../../figures/si/figS0X_aTc_circuit.pdf}
\caption{\textbf{aTc controlled expression of LacI repressor.} Schematic of the
circuit used in~\cite{Jones2014} to control the expression of the LacI
repressor. The \textit{lacI} gene is under the control of the TetR repressor. As
the TetR repressor is inactivated upon binding of anhydrotetracycline or aTc,
the more aTc added to the media were cells are growing, the less TetR repressors
available to control the expression of the \textit{lacI} gene, resulting in more
LacI repressors per cell. LacI simultaneously controls the expression of the
mRNA on which single-molecule mRNA FISH was performed for gene expression
quantification.}
\label{figS:aTc_circuit}
\end{figure}

What this means is that we have access to data with different combinations of
$k^-$ and $k^+$. We could naively try to fit the kinetic parameters individually
for each of the datasets, but there is no reason to believe that the binding
site identity for the LacI repressor somehow affects its expression level
controlled from a completely different location in the genome, nor vice versa.
In other words, what makes the most sense it to fit all datasets together to
obtain a single value for each of the association and dissociation rates. What
this means, as described in Section~\ref{section_04_bayesian_inference} of the main text
is that we have a seven dimensional parameter space with four possible
association rates $k^+$ given the four available aTc concentrations, and three
possible dissociation rates $k^-$ given the three different binding sites
available in the dataset.

Formally now, denote the set of seven repressor rates to be inferred as
\begin{equation}
\vect{k} =\{k_{Oid}^-, k_{O1}^-, k_{O2}^-,
k_{0.5}^+, k_{1}^+, k_{2}^+, k_{10}^+\}.
\end{equation}
Note that since the repressor copy numbers are not known directly as explained
before, we label their association rates by the concentration of aTc. Bayes
theorem reads simply
\begin{equation}
p(\vect{k}, k_i, b \mid D)
\propto
p(D \mid\vect{k}, k_i, b) p(\vect{k}, k_i, b),
\end{equation}
where $D$ is the set of all $N$ observed single-cell mRNA counts across the
various conditions. We assume that individual single-cell measurements are
independent so that the likelihood factorizes as
\begin{equation}
p(D \mid\vect{k}, k_i, b)
= \prod_{j=1}^N p(m\mid \vect{k}, k_i, b)
= \prod_{j=1}^N p(m\mid k_j^+, k_j^-, k_i, b)
\end{equation}
where $k_j^\pm$ represent the appropriate binding and unbinding rates for the
$j$-th measured cell. Our likelihood function, previously derived in
Appendix~\ref{sec:gen_fcn_appdx}, is given by the rather complicated result in
Eq.~\ref{eq:p_m_bursty+rep_appdx}, which for completeness we reproduce here as
\begin{equation}
\begin{split}
p(m \mid k_R^+, k_R^-, k_i, b) = & ~\frac{
        \Gamma(\alpha + m)\Gamma(\beta + m)\Gamma(k_R^+ + k_R^-)
        }
        {
        \Gamma(\alpha)\Gamma(\beta)\Gamma(k_R^+ + k_R^- + m)
        }
\frac{b^m}{m!}
\\
&\times {_2F_1}(\alpha+m, \beta+m, k_R^++k_R^-+m; -b).
\end{split}
\label{eq:p_m_bursty+rep_infreprint}
\end{equation}
where $\alpha$ and $\beta$, defined for notational convenience, are
\begin{equation}
\begin{split}
\alpha &= \frac{1}{2}
\left(k_i+k_R^-+k_R^+ + \sqrt{(k_i+k_R^-+k_R^+)^2 - 4k_i k_R^-}\right)
\\
\beta &= \frac{1}{2}
\left(k_i+k_R^-+k_R^+ - \sqrt{(k_i+k_R^-+k_R^+)^2 - 4k_i k_R^-}\right).
\end{split}
\end{equation}

Next we specify priors. As for the constitutive model, weakly informative
lognormal priors are a natural choice for all our rates. We found that if the
priors were too weak, our MCMC sampler would often become stuck in regions of
parameter space with very low probability density, unable to move. We struck a
balance in choosing our prior widths between helping the sampler run while
simultaneously verifying that the marginal posteriors for each parameter were
not artificially constrained or distorted by the presence of the prior. The only
exception to this is the highly informative priors we placed on $k_i$ and $b$,
since we have strong knowledge of them from our inference of constitutive
promoters above.

With priors and likelihood specified we may write down our complete generative model as
\begin{equation}
\begin{split}
\log_{10}k_i &\sim \text{Normal}(0.725, 0.025)\\
\log_{10}b   &\sim \text{Normal}(0.55, 0.025)\\
\log_{10}k_{0.5}^+ &\sim \text{Normal}(-0.45, 0.3)\\
\log_{10}k_{1}^+   &\sim \text{Normal}(0.6, 0.3)\\
\log_{10}k_{2}^+   &\sim \text{Normal}(1.15, 0.3)\\
\log_{10}k_{10}^+  &\sim \text{Normal}(1.5, 0.3)\\
\log_{10}k_{Oid}^- &\sim \text{Normal}(-0.25, 0.3)\\
\log_{10}k_{O1}^-  &\sim \text{Normal}(0.1, 0.3)\\
\log_{10}k_{O2}^-  &\sim \text{Normal}(0.45, 0.3)\\
m &\sim \text{Likelihood}(k_R^+, k_R^-, k_i, b),
\end{split}
\end{equation}
where the likelihood is specified by Eq.~\ref{eq:p_m_bursty+rep_infreprint}.
We ran MCMC sampling on the full nine dimensional posterior specified
by this generative model.

We found that fitting a single operator/aTc concentration at a time with a
single binding and unbinding rate did not yield a stable inference for most of
the possible operator/aTc combinations. In other words, a single dataset could
not independently resolve the binding and unbinding rates, only their ratio as
set by the mean fold-change in Figure~\ref{fig1:means_cartoons} in the main
text. Only by making the assumption of a single unique binding rate for each
repressor copy number and a single unique unbinding rate for each binding site,
as done in Figure~\ref{fig4:repressed_post_full}(A), was it possible to
independently resolve the rates and not merely their ratios.

We also note that we found it necessary to exclude the very weakly and very
strongly repressed datasets from Jones et.\ al.~\cite{Jones2014}. In both cases
there was, in a sense, not enough information in the distributions for our
inference algorithm to extract, and their inclusion simply caused problems for
the MCMC sampler without yielding any new insight. For the strongly repressed
data (Oid, 10~ng/mL aTc), with $>$ 95\% of cells with zero mRNA, there was quite
literally very little data from which to infer rates. And the weakly repressed
data, all with the repressor binding site O3, had an unbinding rate so fast that
the sampler essentially sampled from the prior; the likelihood had negligible
influence, meaning the data was not informing the sampler in any meaningful way,
so no inference was possible.

As suggested by one of our reviewers, in order for readers to judge the
agreement between our predictions and the experimental data for the regulated
case, we include Figure~\ref{figS:reg_histograms} that plot the same data as
Figure~\ref{fig4:repressed_post_full}(C), but rather than showing ECDF, we show
histograms of the individual distributions.

\begin{figure}[p]
\centering
\includegraphics[width=\textwidth]{../../figures/si/figS0X_histograms.pdf}
\caption{\textbf{Theory-experiment comparison of mRNA distributions for
regulated promoters.} Comparison of the inference (color shaded area
encloses the 95\% of all posterior predictive check samples while the color
solid line represents the median of all samples) vs the experimental
measurements (black lines) for different regulated promoters with different
operators (columns) and aTc concentrations (rows) from
Ref.~\cite{Jones2014}.}
\label{figS:reg_histograms}
\end{figure}


\subsection{Method Selection}

Before establishing models for prediction, we have to choose what algorithms to use in analyses.

Besides common considerations, what we especially take into account is the global topology of the attribute space: because of the attributes WDF2 and WDF5, the space is in fact homeomorphic to $\mathbb R^{p-2}\times \mathbb S^1\times\mathbb S^1$ instead of $\mathbb R^p$. In this case, a hyperplane (or, more generally, an \emph{open} hypersurface) may not be able to seperate it into two \emph{disconnected} subspace.

As the result, we exclude LDA, QDA and several other well-developed classification methods because an open hypersurface is always needed for these. Instead, we tend to apply methods that do not heavily depend on global topology (random forest, $k$-NN) or that classify with a \emph{closed} hypersurface (kernel SVM).