0

So I have this simple code

\documentclass[12pt]{report}
\usepackage{blkarray}
\usepackage{amsmath}
\usepackage[version=4]{mhchem}
\usepackage{amsmath}


\begin{document}

Given perfect data we can use Bayesian inference to infer our rate constants. This allows us to know the state of the system at given times, this is called our sample path denoted as;
\begin{gather*}
 $\mathbf x = \{ x(t) : t \in [0,T]\}$
\end{gather*}
Complete information on the sample path means that we what time of reaction occurs at different times\\
The form of the Gillespie algorithm means the likelihood function is constructed as
\begin{gather*}
$L(c;\mathbf x)$ = $\{\prod\limits_{i=1}^n h_{v_i}(x(t_{i_1},c_{v_i}\}$exp$$\{-\int_0^Th_0(x(t),c)dt\}$$
\end{gather*}
\\
A critical observation is that our rate laws can be written in the form, 
\begin{align*}
$h_j(x,c_j) = c_jg_j(x)$
\intertext{which leads to;}
$L_j(c_j;\mathbf{x}) = c_j^{r_j}exp\{-c_j\int_0^T g_j(x(t))dt\}$, $j=1,...,v$
\end{align*}\\
We assume we have independent gamma priors for our rate constants
\begin{gather*}
$c_j ~ Ga(a_j,b_j)$, $j=1,..,v$
\end{gather*}\\
Using Bayes Theorem we are able to produce a posterior for our rate constants,
\begin{gather*}
$c_j|\mathbf {x}$ ~ $Ga(a_j+r_j,b_j+\int_0^Tg_j(x(t))dt)$, $j=1,...,v$
\end{gather*}\\
Applying this to our Michaelis-Menten model produces graphs of the prior and posterior seen below



\end{document}

but I keep getting the error

Missing { inserted. <to be read again>}

But I dont understand what this means

1
1

You have a lot of $ and $$ within gather and align environments, but you don't have to use them because you are already in math mode within those environments.

Moreover, don't use \\ in normal text only to go to a new line, just leave an empty line to create a new paragraph or use \newline.

There is a command for "exp": \exp and for ":": \colon, and with \quad you can leave some space. Little things like those excluded, I haven't corrected your formulas, but there are other errors, I'm sure some mathematicians here will be happy to improve them.

Moreover, as David pointed out in his comment, it's better to use \[...\] than gather for one line equations.

Eventually, as egreg said, there is no need to use \intertext inside gather, and use \dots instead of ....

\documentclass[12pt]{report}
\usepackage{blkarray}
\usepackage{amsmath}
\usepackage[version=4]{mhchem}
\usepackage{amsmath}

\begin{document}
Given perfect data we can use Bayesian inference to infer our rate constants. This allows us to know the state of the system at given times, this is called our sample path denoted as:
\[
 \mathbf{x} = \{ x(t)\colon t \in [0,T]\}
\]
Complete information on the sample path means that we what time of reaction occurs at different times\newline
The form of the Gillespie algorithm means the likelihood function is constructed as
\[
L(c;\mathbf{x}) = \bigl\{\prod\limits_{i=1}^n h_{v_i}(x(t_{i_1},c_{v_i}\}\exp\{-\int_0^Th_0(x(t),c)dt\bigr\}
\]
A critical observation is that our rate laws can be written in the form, 
\[
h_j(x,c_j) = c_jg_j(x)
\]
which leads to:
\[
L_j(c_j;\mathbf{x}) = c_j^{r_j}\exp\{-c_j\int_0^T g_j(x(t))dt\}, \quad j=1,\dots,v
\]
We assume we have independent gamma priors for our rate constants
\[
c_j ~ Ga(a_j,b_j), \quad j=1, \dots ,v
\]
Using Bayes Theorem we are able to produce a posterior for our rate constants,
\[
c_j|\mathbf {x} ~ Ga(a_j+r_j,b_j+\int_0^Tg_j(x(t))dt), \quad j=1,\dots,v
\]
Applying this to our Michaelis-Menten model produces graphs of the prior and posterior seen below
\end{document}

enter image description here

4
  • it's better to use \[ than gather for one line equations (see the last one where \[ would use \shortdisplayskip) Feb 1 '18 at 16:39
  • Also, there's no reason for \intertext inside gather.
    – egreg
    Feb 1 '18 at 17:30
  • @CarLaTeX And \dots instead of ... ;-)
    – egreg
    Feb 1 '18 at 17:43
  • j=1,\dots,v is the right code
    – egreg
    Feb 1 '18 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.