run_pcensmix: Generating Progressively Type-II Censored Mixture Data and...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pcensmix.R

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

1
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 p from a binomial distribution at each stage. If p = 0, there will be no censoring.

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

pcgen, pcensmixSim, mixgen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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)

pcensmix documentation built on May 2, 2019, 1:10 p.m.