R: Simple estimation for the mixture of two exponential...
ini.mixexp2
R Documentation
Simple estimation for the mixture of two exponential distributions
Description
Compute a simple (preliminary) estimation for the tree parameters of
the mixture of two exponential distributions
Usage
ini.mixexp2(x, plot = FALSE)
Arguments
x
Sample: numerical vector with elements >0.
plot
Should a graphic be displayed?
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 largest
values gives rate1 and prob1. Yet the constraints must
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".
Value
A list
estimate
A vector with named elements "prob1", "rate1" and
"rate2".
method
The method that really produced the estimators.
Note
The method of moments is implemented in mom.mixexp2. Further
investigations are needed to compare the estimators (moments or Hreg)
and select the best strategy.
Note that this function returns the estimate within a list and no
longer as a vector with named elements as was the case before.
Author(s)
Yves Deville
See Also
See MixExp2, mom.mixexp2.
Examples
set.seed(1234)
x <- rmixexp2(n = 100, prob1 = 0.5, rate2 = 4)
res <- ini.mixexp2(x, plot = TRUE)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Renext)
Loading required package: evd
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Renext/ini.mixexp2.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ini.mixexp2
> ### Title: Simple estimation for the mixture of two exponential
> ### distributions
> ### Aliases: ini.mixexp2
>
> ### ** Examples
>
> set.seed(1234)
> x <- rmixexp2(n = 100, prob1 = 0.5, rate2 = 4)
> res <- ini.mixexp2(x, plot = TRUE)
>
>
>
>
>
>
> dev.off()
null device
1
>