Learn R Programming

mapfit (version 0.9.9)

ph-class: Class of general PH distributions

Description

Parameters for a general PH distribution.

Arguments

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.

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