Learn R Programming

mapfit (version 0.9.7)

ph-class: Class of general PH distributions

Description

Parameters for a general PH distribution.

Arguments

Objects from the Class

Objects are usually created by a ph.

Slots

size:

the number of phases (transient states).

alpha:

a probability (row) vector to decide an initial phase.

Q:

a square matrix that means transition rates between phases.

xi:

a column vector for exiting rates from phases to an absorbing state.

df:

the number of free parameters.

Methods

ph.moment

signature(ph = "ph"): ...

% \item{emfit.init}{\code{signature(model = "ph")}: ... } % \item{emfit.estep}{\code{signature(model = "ph", data = "phdata.wtime")}: ... } % \item{emfit.estep}{\code{signature(model = "ph", data = "phdata.group")}: ... } % \item{emfit.mstep}{\code{signature(model = "ph")}: ... }

See Also

Classes '>cf1 and '>herlang.

Examples

Run this code
# NOT RUN {
## create a PH (full matrix) with 5 phases
(param1 <- ph(5))

## create a PH (full matrix) with 5 phases
(param1 <- ph(size=5))

## create a PH with specific parameters
(param2 <- ph(alpha=c(1,0,0),
              Q=rbind(c(-4,2,0),c(2,-5,1),c(1,0,-1)),
              xi=c(2,2,0)))

## p.d.f. for 0, 0.1, ..., 1
(dph(x=seq(0, 1, 0.1), ph=param2))

## c.d.f. for 0, 0.1, ..., 1
(pph(q=seq(0, 1, 0.1), ph=param2))

## generate 10 samples
(rph(n=10, ph=param2))

# }

Run the code above in your browser using DataLab