estimateDirichDist: Nonlinear Parameter Estimation for Dirichlet Distribution

View source: R/estimateDirichDist.R

estimateDirichDistR Documentation

Nonlinear Parameter Estimation for Dirichlet Distribution

Description

The parameter estimation is accomplished using a count data matrix. The estimation is based on the fact that if a variable x = (x_1, x_2, ...x_n) follows Dirichlet Distribution with parameters α = α_1, ... , α_n (all positive reals), in short, x ~ Dir(α), then x_i ~ Beta(α_i, α_0 - α_i), where Beta(.) stands for the Beta distribution and α_0 = ∑ α_i.

Dirichlet distribution is a family of continuous multivariate probability distributions, a multivariate generalization of the Beta distribution.

Usage

estimateDirichDist(
  x,
  start = NULL,
  num.cores = 1L,
  tasks = 0L,
  seed = 123,
  refit = TRUE,
  verbose = TRUE,
  ...
)

Arguments

x

A matrix or a data.frame object carrying count data.

start

Initial parameter values for \lapha = α_1, ... , α_n (all positive reals). Defaults is NULL.

num.cores, tasks

Parameters for parallel computation using BiocParallel-package: the number of cores to use, i.e. at most how many child processes will be run simultaneously (see bplapply and the number of tasks per job (only for Linux OS).

verbose

if TRUE, prints the function log to stdout and a progress bar

...

Further arguments for betaDistEstimation function.

Details

As any non-linear fitting, results strongly depends on the start parameter values.

Value

A vector of estimated parameter values

Author(s)

Robersy Sanchez <https://genomaths.com>

See Also

betaDistEstimation and betaBinPost

Examples

library(DirichletReg)

## A random generation numerical vectors with
x <- rdirichlet(n = 1000, alpha = c(2.1, 3.1, 1.2))
head(x)

estimateDirichDist(x)


genomaths/usefr documentation built on July 28, 2022, 12:31 p.m.