knitr::opts_knit$set(root.dir = "../")
library(magrittr) library(ggplot2) smar::sourceDir("R/") set.seed(1)
load("../data/genera.RData") physeq <- physeq_genera %>% phyloseq::subset_samples(dataset_name == "MucosalIBD") %>% smar::prune_taxaSamples(flist_taxa = genefilter::kOverA(k = 5, A = 1)) mat_X_count <- smar::otu_table2(physeq) mat_X_p <- apply(mat_X_count, 2, function(x) x / sum(x))
$f_g(g_1, \dots, g_m)$ is multivariate Gaussian
For generating M-H samples, \begin{align} f_{\hat{p}}(\hat{p}j | \hat{p}{-j}/\sum \hat{p}{-j}) &\propto f{\hat{p}}(\hat{p}_1, \dots, \hat{p}_m) \ &= \int f_N(R\hat{p}_1, \dots, R\hat{p}_m) R^{m - 1} dR \end{align}
$R = \sum N$ (total read depth)
Plugging in $f_N$ \begin{align} f_N(R\hat{p}_1, \dots, R\hat{p}_m) &= \left(\prod f_N(R\hat{p}_j) \right) \times \frac{f_g(F_g^{-1}(F_N(R\hat{p}_1)), \dots, F_g^{-1}(F_N(R\hat{p}_m)))} {\prod f_g(F_g^{-1}(F_N(R\hat{p}_1)))} \end{align}
Observations
$R\hat{p}_j$ fixed at $0$ for $\hat{p}_j = 0$
Simple case: assume that $N_1, \dots, N_m = \exp\left(\text{MV Gaussian}\right) \times \prod I_j$, then integration is straightforward
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.