MME_tune: Fit mixture of Erlangs

Description Usage Arguments Details Value References Examples

Description

Fits univariate and multivariate mixtures of Erlang distributions to possibly censored and/or truncated data. The censoring and/or truncation can be left, right or interval.

Usage

1
2
3
4
MME_tune(lower, upper = lower, trunclower = rep(0, ncol(as.matrix(lower))),
  truncupper = rep(Inf, ncol(as.matrix(lower))), M = 10, s = 100,
  nCores = parallel::detectCores(), criterium = "BIC", eps = 0.001,
  beta_tol = 10^(-5), print = TRUE, file = "log.txt", max_iter = Inf)

Arguments

lower,upper

Matrix specifying the lower and upper censoring points, observations in rows, dimensions in coloms.

trunclower,truncupper

Numeric vector specifying the lower and upper truncation points in each dimension.

M

Numeric vector of values for the tuning parameter M.

s

Numeric vector of values for the tuning parameter s (the spread).

nCores

Number of cores available for parallel computation.

criterium

Character vector specifying information criterium to use, either "AIC" or "BIC".

eps

Numeric: covergence threshold used in the EM algorithm.

beta_tol

Numeric: threshold for the mixing weights below which the corresponding shape parameter vector is considered neglectable.

print

Logical: print intermediate results, either TRUE or FALSE.

file

If print is TRUE, specify file name.

max_iter

Maximum number of iterations in a single EM algorithm.

Details

MME_tune implements the estimation procedure for univariate and multivariate mixtures of Erlangs (MME) by repeatedly using the EM algorithm. More information on the initialization and adjustment strategy for the shape parameter vectors based on an information criterium (AIC and BIC implemented) can be found in Verbelen et al. (2015).

The data can be censored and/or truncated. The censoring status of a particular observation in a certain dimension is determined as follows:

E.g.: lower[1, ] = c(2, NA, 4, 5) and upper[1, ] = c(2, 3, NA, 6); specifies a first four-dimensional observation having an observed event at 2 in dimension 1, left censoring at 3 in dimension 2, right censoring at 4 in dimension 3, and interval censoring at [5,6] in dimension 4.

The truncation status in a certain dimension is determined as follows:

E.g.: trunclower = c(0, 1, 0, 1) and truncupper = c(Inf, Inf, 10, 10); specifies no truncation in dimension 1, left truncation at 1 in dimension 2, right truncation at 10 in dimension 3, and interval truncation at [1, 10] in dimension 4.

The lower and upper truncation points are fixed, i.e. the same for all observations.

For all observations and across all dimensions it must hold that trunclower <= lower <= upper <= truncupper.

Value

MME_tune returns a list with the following objects:

best_model

The final MME, judged to be the best according to the criterium used. Value is a list.

performances

A matrix summarizing the performance of the different fitted MME models (M, s, criterium, R).

all_model

A list containing all fitted MME models.

References

Verbelen, R., Gong, L., Antonio, K., Badescu, A., and Lin, X. S. (2015). Fitting mixtures of Erlangs to censored and truncated data using the EM algorithm. ASTIN Bulletin. Accepted for publication.

Verbelen, R., Antonio, K., and Claeskens, G. (2015). Multivariate mixtures of Erlangs for density estimation under censoring and truncation. Submitted for publication.

Examples

1
2
3
4
5
6
7
8
## Not run: 
       data(geyser, package = "MASS")
       MME_tune(lower = geyser, upper = geyser, trunclower = c(0, 0),
       truncupper = c(Inf, Inf), M = c(5, 10, 20), s = c(seq(10, 100, 10), 200),
       nCores = parallel::detectCores(), criterium = "BIC", eps = 1e-03,
       beta_tol = 10^(-5), print=TRUE, file="log.txt", max_iter = Inf)
   
## End(Not run)

RoelVerbelen/MME documentation built on May 9, 2019, 10:31 a.m.