pmle.exp: compute the PMLE or MLE of the parameters under a mixture of...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pmle.exp.R

Description

Compute the PMLE or MLE of the parameters under a mixture of exponentials. When the level of penalty is 0, PMLE reduces to MLE.

Usage

1
2
pmle.exp(x, m0 = 1, lambda = 0, 
	 inival = NULL, len = 10, niter = 50, tol = 1e-06, rformat = FALSE)

Arguments

x

data, can be either a vector or a matrix with the 1st column being the observed values and the 2nd column being the corresponding frequencies.

m0

order of the finite mixture model, default value: m0 = 1.

lambda

level of penalty, default value: lambda = 0.

inival

initial values for the EM-algorithm, a 2m0-dimension vector including m0 mixing proportions and m0 component parameters, or a matrix with 2m0 columns, default value: inival = NULL. (if not provided, random initial values are used.)

len

number of random initial values for the EM-algorithm, default value: len = 10.

niter

number of iterations for all initial values in the EM-algorithm. The algorithm runs EM-iteration niter times from each initial value. The iteration will restart from the parameter value with the highest likelihood value at the point and run until convergence. default value: niter = 50.

tol

tolerance level for the convergence of the EM-algorithm, default value: tol = 1e-6.

rformat

form of the digital output: default of R package is used when rformat = T; If rformat = T, the digital output is rounded to the 3rd dicimal place if it is larger than 0.001, keeps 3 significant digits otherwise. The default value of rformat is F.

Value

Return the PMLE or MLE of the parameters with order = m0 (mixing proportions and component parameters), log-likelihood value at the PMLE or MLE and the penalized log-likelihood value at the PMLE.

Author(s)

Shaoting Li, Jiahua Chen and Pengfei Li

See Also

emtest.exp, plotmix.exp, rmix.exp

Examples

1
2
3
4
5
6
#generate a random sample from a 2 component exponential mixture,
#compute the PMLE of the parameters under 2 component exponential mixture model,
#plot the histgoram of the observations and the fitted density.
x <- rmix.exp(200,c(0.3,0.7),c(2,8))
out <- pmle.exp(x,2,1)
plotmix.exp(x,out)

MixtureInf documentation built on May 30, 2017, 6:56 a.m.

Search within the MixtureInf package
Search all R packages, documentation and source code