# cf1: Canonical Form 1 for Phase-Type (PH) Distribution In mapfit: A Tool for PH/MAP Parameter Estimation

## Description

A function to generate an object of `cf1`.

## Usage

 `1` ```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`.

## Details

The PH distribution with parameters α, Q and ξ = - Q 1: Cumulative probability function;

F(q) = 1 - α \exp( Q q ) 1

Probability density function;

f(x) = α \exp( Q x ) ξ,

where Q is a bidiagonal matrix whose entries are sorted.

## Value

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

## Note

`rph` is a generic function and is specified for `cf1`.

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