parEstimate: Parameter estimation for Dirichlet-multinomial distribution

View source: R/parEstimate.R

parEstimateR Documentation

Parameter estimation for Dirichlet-multinomial distribution

Description

parEstimate is a wrapper of the function dirmult with default settings for init, initscalar, epsilon, trace and mode. It allows the input obj to be either a matrix or a TreeSummarizedExperiment and outputs the estimated values of pi and theta.

Usage

parEstimate(obj, assay = NULL)

Arguments

obj

A matrix or TreeSummarizedExperiment, with samples in the columns and entities in the rows.

assay

If obj is a TreeSummarizedExperiment, the name or index of the assay to use to estimate Dirichlet multinomial parameters. If NULL, the first assay will be used.

Value

A list including the estimates of pi (a vector with one element per row in obj) and theta (a scalar).

Author(s)

Ruizhu Huang, Charlotte Soneson

Examples

suppressPackageStartupMessages({
    library(TreeSummarizedExperiment)
})

set.seed(1L)
y <- matrix(rnbinom(200, size = 1, mu = 10), nrow = 10)
colnames(y) <- paste("S", seq_len(20), sep = "")
rownames(y) <- tinyTree$tip.label
toy_tse <- TreeSummarizedExperiment(rowTree = tinyTree,
                                    assays = list(y))
res <- parEstimate(obj = toy_tse)
metadata(res)$assays.par


fionarhuang/treeclimbR documentation built on May 19, 2024, 1:18 p.m.