hcnm: Hierarchical Constrained Newton method

View source: R/cnm.R

hcnmR Documentation

Hierarchical Constrained Newton method

Description

Function hcnm can be used to compute the MLE of a finite discrete mixing distribution, given the component density values of each observation. It implements the hierarchical CNM algorithm of Wang and Taylor (2013).

Usage

hcnm(
  D,
  p0 = NULL,
  w = 1,
  maxit = 1000,
  tol = 1e-06,
  blockpar = NULL,
  recurs.maxit = 2,
  compact = TRUE,
  depth = 1,
  verbose = 0
)

Arguments

D

A numeric matrix, each row of which stores the component density values of an observation.

p0

Initial mixture component proportions.

w

Duplicity of each row in matrix D (i.e., that of a corresponding observation).

maxit

Maximum number of iterations.

tol

A tolerance value to terminate the algorithm. Specifically, the algorithm is terminated, if the increase of the log-likelihood value after an iteration is less than tol.

blockpar

Block partitioning parameter. If > 1, the number of blocks is roughly nrol(D)/blockpar. If < 1, the number of blocks is roughly nrol(D)^blockpar.

recurs.maxit

Maximum number of iterations in recursions.

compact

Whether iteratively select and use a compact subset (which guarantees convergence), or not (if already done so before calling the function).

depth

Depth of recursion/hierarchy.

verbose

Verbosity level for printing intermediate results.

Value

p

Computed probability vector.

convergence

convergence code. =0 means a success, and =1 reaching the maximum number of iterations

ll

log-likelihood value at convergence

maxgrad

Maximum gradient value.

numiter

number of iterations required by the algorithm

Author(s)

Yong Wang <yongwang@auckland.ac.nz>

References

Wang, Y. (2007). On fast computation of the non-parametric maximum likelihood estimate of a mixing distribution. Journal of the Royal Statistical Society, Ser. B, 69, 185-198.

Wang, Y. and Taylor, S. M. (2013). Efficient computation of nonparametric survival functions via a hierarchical mixture formulation. Statistics and Computing, 23, 713-725.

See Also

cnm, nppois, disc.

Examples


x = rnppois(1000, disc(0:50))    # Poisson mixture
D = outer(x$v, 0:1000/10, dpois)
(r = hcnm(D, w=x$w))
disc(0:1000/10, r$p, collapse=TRUE)

cnm(x, init=list(mix=disc(0:1000/10)), model="p")


nspmix documentation built on June 8, 2025, 12:29 p.m.

Related to hcnm in nspmix...