View source: R/Gibbs_Sampler_Cov.R
block_LTNLDA | R Documentation |
This function takes a phyloseq object and the modelled number of subcommunities as inputs. It runs a collapsed blocked Gibbs sampler for LTNLDA, and returns a list containing posterior mean estimates for some parameters, Markov Chains for all meaningful parameters, and the phyloseq object. For a detailed example see the vignette "LTN-LDA".
block_LTNLDA( ps, K, C = 5, iterations = 1000, burnin = 10000, thin = 10, alpha = 1, a_L = 100, b_L = 200, a_U = 10^4, b_U = 10, g_prior = 1/4, Lambda = NULL )
ps |
A phyloseq object containing an otu_table() and a phy_tree() with an edge matrix. That is, otu_table(ps) and phy_tree(ps)$edge both exist. Further, the otu_table(ps) should have taxa corresponding to rows adn samples corresponding to columns. |
K |
An integer specifying the number of modeled subcommunities. |
C |
An integer specifying the threshold controlling cross-sample heterogeneity. The default value is 5. Using the default value may result in unreliable inference. |
iterations |
The number of iterations to record. Default value is 1000. |
burnin |
The number of burnin iterations to run before recording values. The default value is 10000. |
thin |
The amount by which we thin the chain. A value of X means that 1 every X values is recorded after the burnin. The default value is 10. |
alpha |
A double specifying the prior on the subcommunity-sample proportions. The default value is 1. |
a_L |
A double such that the degrees of freedom for the G-Wishart prior for the lower precision matrix is a_L+p_L+2. The default value is 100. |
b_L |
A double such that the scale matrix for the G-Wishart prior for the lower precision matrix is b_L*diag(p_L. The default value is 200. |
a_U |
A double controlling the scale parameter in the inverse-Gamma distribution for the upper covariance values. The default value is 10^4. |
b_U |
A double controlling the rate parameter in the inverse-Gamma distribution for the upper covariance values. The default value is 10 |
g_prior |
A double specifying the prior probability that there is an edge between two nodes in the lower covariance matrix. The default value is 1/4. |
Lambda |
A matrix specifying a covariance prior for the mu_k. The default value is diag(V) where V is the number of leaves. |
A list with 8 entries. Mean_Post_Phi_d contains the posterior mean estimate for the subcommunity-sample distributions phi_d. Mean_Post_Beta_kd contains the posterior mean estimate for the sample and subcommunity specific multinomial distributions beta_k,d. Mean_Post_Beta_k contains the posterior mean estimates for the average subcommunity multinomial distributions beta_k. Mean_Post_G_L contains the posterior mean of the edge matrix denoting the probability edges are conditionally dependent for each subcomunity. Chain_Phi contains the Markov Chains for the phi_d. Chain_Psi contains the Markov Chains for the psi_p,d,k. Chain_Mu contains the Markov Chains for the mu_k. Chain_Sigma contains the Markov Chains for the Sigma_k. phyloseq contains the phyloseq object the Gibbs sampler ran on.
ADD PAPER INFORMATION ONCE WE KNOW IT
data("ps",package = "LTNLDA") K = 2 model = LTNLDA_cov(ps,K)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.