Hierachical Dirichlet Model for mutational signature estimation
![](/post/writing-technical-content/featured_huc72159e0fc0d14b85f60d34436a630f0_266353_1208e240994095bfd642246a1ad2642e.webp)
Let $X$ be the mutation matrix of size $M \times N$. $N$ is the number of observations/samples.
Math
{{< math >}}
$$
\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}
$$
{{< /math >}}
renders as
$$\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}$$Example inline math {{< math >}}$\nabla F(\mathbf{x}_{n})${{< /math >}}
renders as
$\nabla F(\mathbf{x}_{n})$.
Example multi-line math using the math linebreak (\\
):
{{< math >}}
$$f(k;p_{0}^{*}) = \begin{cases}p_{0}^{*} & \text{if }k=1, \\
1-p_{0}^{*} & \text{if }k=0.\end{cases}$$
{{< /math >}}
renders as
$$ f(k;p_{0}^{*}) = \begin{cases}p_{0}^{*} & \text{if }k=1, \\ 1-p_{0}^{*} & \text{if }k=0.\end{cases} $$Callouts
Academic supports a shortcode for callouts, also referred to as asides, hints, or alerts. By wrapping a paragraph in {{% callout note %}} ... {{% /callout %}}
, it will render as an aside.
{{% callout note %}}
A Markdown aside is useful for displaying notices, hints, or definitions to your readers.
{{% /callout %}}
renders as
A Markdown aside is useful for displaying notices, hints, or definitions to your readers.
Spoilers
Add a spoiler to a page to reveal text, such as an answer to a question, after a button is clicked.
{{< spoiler text="Click to view the spoiler" >}}
You found me!
{{< /spoiler >}}
renders as
Click to view the spoiler
You found me!
Code
There is an implementation in .
devtools::install_github("nicolaroberts/hdp", build_vignettes = TRUE)
set.seed(10)
quick_hdp <- hdp_quick_init(example_data_hdp)
quick_hdp
quick_chain <- hdp_posterior(quick_hdp, burnin=500, n=100, space=40, seed=1234)
quick_chain