run_pcensmix {pcensmix} | R Documentation |
Generating Progressively Type-II Censored Mixture Data and Fitting a Model
Description
This function implements an algorithm using the
mixgen
, pcgen
and
pcensmixSim
functions to generate data and fit a model
using EM algorithm with a specified number of iterations.
Usage
run_pcensmix(N, r, p, param, repetition = 100)
Arguments
N |
population size. |
r |
required number of failures to observe. |
p |
a parameter controlling the amount of censoring. The action of
censoring individuals after each failure occurs with probabilty |
param |
a numeric vector; used as starting values for the EM and simulating a new data to replace in case of happening singularity in the likelihood. |
repetition |
the required number of repetition of the algorithm– default is 100. |
Value
It returns the parameter estimates given by
pcensmixSim
with the desired number of repetitions.
In each repetition it generates a new normal mixture progressive Type-II
censored dataset from the same true parameter values and fits a model.
Author(s)
Lida Fallah, John Hinde
Maintainer: Lida Fallah <l.fallah22@gmail.com>
See Also
Examples
## Not run:
## Example 1: with very well separated mixture components
set.seed(3)
f1 <- run_pcensmix(N = 160, r = 120, p = 0.3, param = c(10, 2, 25, 4, 0.3), repetition = 100)
colMeans(f1)
## Example 2.
set.seed(150)
f2 <- run_pcensmix(N = 160, r = 130, p = 0.35, param = c(10, 2, 17, 4, 0.3), repetition = 100)
colMeans(f2)
## Example 3.
set.seed(20)
f3 <- run_pcensmix(N = 160, r = 130, p = 0.3, param = c(20, 6, 22, 12, 0.6), repetition = 100)
colMeans(f3)
## End(Not run)