powered by
C++ implementation of the fixed-point iteration algorithm by Minka (2000).
fit_dirichlet(x, const, maxit = 1e+05, abstol = 0.1)
a matrix of Dirichlet samples, one row per observation.
constant that is added to avoid problems with zeros in log(x). The default is const = min(x[x>0])*.01.
log(x)
const = min(x[x>0])*.01
maximum number of iterations.
The absolute convergence tolerance: maximum of absolute differences of Dirichlet parameters.
The algorithm is used to estimate the effective sample size based on samples of posterior model probabilities (see stationary and summary.stationary).
stationary
summary.stationary
Minka, T. (2000). Estimating a Dirichlet distribution. Technical Report.
rdirichlet
x <- rdirichlet(100, c(8,1,3,9)) fit_dirichlet(x)
Run the code above in your browser using DataLab