extract_point_estimate: Extract point estimates of multinomial and Dirichlet...

Description Usage Arguments Value Examples

View source: R/convrg_func.R

Description

Provides the mean value of posterior probability distributions for parameters.

Usage

1
extract_point_estimate(model_out, countData, params = c("pi", "p"))

Arguments

model_out

Output of CNVRG modeling functions, including cnvrg_HMC and cnvrg_VI

countData

The count data modeled.

params

Parameters to be extracted, either pi (Dirichlet) or p (multinomial).

Value

A list of of point estimates for model parameters. If both multinomial and Dirichlet parameters are requested then they will be named elements of a list.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#simulate an OTU table
com_demo <-matrix(0, nrow = 10, ncol = 10)
com_demo[1:5,] <- c(rep(3,5), rep(7,5)) #Alternates 3 and 7
com_demo[6:10,] <- c(rep(7,5), rep(3,5)) #Reverses alternation
fornames <- NA
for(i in 1:length(com_demo[1,])){
fornames[i] <- paste("otu_", i, sep = "")
}
sample_vec <- NA
for(i in 1:length(com_demo[,1])){
sample_vec[i] <- paste("sample", i, sep = "_")
}
com_demo <- data.frame(sample_vec, com_demo)
names(com_demo) <- c("sample", fornames)

out <- cnvrg_VI(com_demo,starts = c(1,6), ends=c(5,10))
extract_point_estimate(model_out = out, countData = com_demo)

JHarrisonEcoEvo/CNVRG documentation built on Dec. 30, 2021, 1:21 a.m.