Learn R Programming

Renext (version 1.0-0)

ini.mixexp2: Simple estimation for the mixture of two exponential distributions

Description

Compute a simple (preliminary) estimation for the tree parameters of the mxture of two exponentials

Usage

ini.mixexp2(x, plot = FALSE)

Arguments

x
Sample: numerical vector with elements >0.
plot
Should a graphic be displayed?

Value

  • A list
  • estimateA vector with named elements "prob1", "rate1" and "rate2".
  • methodThe method that really produced the estimators.

Details

This function gives estimators using several methods if necessary. The goal is to find the rates rate1, rate2 and the mixing probability prob1 with the 'feasibility' constraints 0 < rate1 < rate2 and 0 < prob1 < 1.

First the method of moments is used. If the estimates are feasible they are returned with method = "moments". If not, the estimates are derived using two linear regressions. A regression without constant using only the smallest values gives an estimator of the mean rate. A regression using only the largests values gives rate1 and prob1. Yet the constraints muts be fulfilled. If they are, the estimates are returned (together with method = "Hreg" suggesting a cumulative hazard regression). If not, a (poor) default estimate is returned with method = "arbitrary".

See Also

See MixExp2, mom.mixexp2.

Examples

Run this code
library(Renext)
set.seed(1234)
x <- rmixexp2(n = 100, prob1 = 0.5, rate2 = 4)
res <- ini.mixexp2(x, plot = TRUE)

Run the code above in your browser using DataLab