Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

mapfit (version 0.9.7)

cf1: Canonical Form 1 for Phase-Type (PH) Distribution

Description

A function to generate an object of '>cf1.

Usage

cf1(size, alpha, rate, class = "CsparseMatrix")

Arguments

size

a value for the number of phases.

alpha

a vector for the initial probabilities of PH distribution.

rate

a vector for transition rates to next phase (diagonal elements of Q).

class

name of Matrix class for Q.

Value

cf1 gives an object of canonical form 1 that is a subclass of PH distribution.

Details

The PH distribution with parameters α, Q and ξ=Q1: Cumulative probability function; F(q)=1αexp(Qq)1 Probability density function; f(x)=αexp(Qx)ξ, where Q is a bidiagonal matrix whose entries are sorted.

See Also

ph, herlang

Examples

Run this code
# NOT RUN {
## create a CF1 with 5 phases
(param1 <- cf1(5))

## create a CF1 with 5 phases
(param1 <- cf1(size=5))

## create a CF1 with specific parameters
(param2 <- cf1(alpha=c(1,0,0), rate=c(1.0,2.0,3.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 (this is quiker than rph with general ph)
(rph(n=10, ph=param2))

# }

Run the code above in your browser using DataLab