Learn R Programming

mapfit (version 0.9.6)

phfit.group: PH fitting with grouped data

Description

estimates PH parameters from grouped data.

Usage

phfit.group(ph, counts, breaks, intervals, instant, 
  method = c("all", "increment"), lbound = 1, ubound = NULL,
  control = list(), verbose = list(), ...)

Arguments

Value

returns a list with components, which is an object of S3 class phfit.result;modelan object for estimated PH class (ph, cf1, herlang).llfa value of the maximum log-likelihood.dfa value of degrees of freedom of the model.aica value of Akaike information criterion.iterthe number of iterations.convergencea logical value for the convergence of estimation algorithm.ctimecomputation time (user time).dataan object for MAP data classaerrora value of absolute error for llf at the last step of algorithm.rerrora value of relative error for llf at the last step of algorithm.controla list of the argument of control.verbosea list of the argument of verbose.callthe matched call.

See Also

phfit.point, phfit.density, ph, cf1 and herlang

Examples

Run this code
## make sample
wsample <- rweibull(n=100, shape=2, scale=1)
wgroup <- hist(x=wsample, breaks="fd", plot=FALSE)

## PH fitting for general PH
(result1 <- phfit.group(ph=ph(2), counts=wgroup$counts,
                        breaks=wgroup$breaks))

## PH fitting for CF1
(result2 <- phfit.group(ph=cf1(2), counts=wgroup$counts,
                        breaks=wgroup$breaks))

## PH fitting for hyper Erlang
(result3 <- phfit.group(ph=herlang(3), counts=wgroup$counts,
                        breaks=wgroup$breaks))

## mean
ph.mean(result1$model)
ph.mean(result2$model)
ph.mean(result3$model)

## variance
ph.var(result1$model)
ph.var(result2$model)
ph.var(result3$model)

## up to 5 moments 
ph.moment(5, result1$model)
ph.moment(5, result2$model)
ph.moment(5, result3$model)

Run the code above in your browser using DataLab