discphasetype: Phase-type distributed objects

Description Usage Arguments Details Value Functions Examples

View source: R/DocumentationConstructors.R

Description

Constructing phase-type representations

Usage

1
2
3
discphasetype(initDist, P_Mat)

contphasetype(initDist, T_Mat)

Arguments

initDist

a vector holding the initial distribution of the phase-type distribution. Hence initDist should satisfy that all entries are non-negative and the sum of the vector must be less than or equal to 1.

P_Mat

A sub-transition probability matrix satisfying that all entries are non-negative. Furthermore, P_Mat should be a square matrix, which determinant is different from zero. All rows in P_Mat should sum to a number less than or equal to one, and the length of the initial distribution has to be equal to the number of rows of P_Mat.

T_Mat

A sub-intensity rate matrix. The matrix must be invertible, all diagonal entries must be negative and all non-diagonal entries must be non-negative. Also for each row the sum of the entries must be non-positive. Furthermore, the length of the initial distribution has to be equal to the number of rows and number of columns of T_Mat.

Details

discphasetype creates an object of class "discphasetype", i.e. the object represents a discrete phase-type distribution. contphasetypecreates an object of class "contphasetype", i.e. the object represents a continuous phase-type distribution.

Value

discphasetype returns a list of class "discphasetype", while contphasetype returns a list of class "contphasetype". Both lists hold

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## For n=4, the time to the most recent common ancestor is
## phase-type distributed with
## initial distribution
initDist <- c(1,0,0)
## and sub-intensity rate matrix
T_Mat <- matrix(c(-6,6,0,
                   0,-3,3,
                   0,0,-1), nrow = 3, ncol = 3, byrow = TRUE)

TMRCA <- contphasetype(initDist, T_Mat)

## For theta=2, the number of segregating sites plus one is
## discrete phase-type distributed with
## initial distribution
initDist <- c(1,0,0,0)
## and sub-transition probability matrix
P_Mat <- matrix(c(0.4, 0.3, 4/30, 2/30,
                   0, 0.5, 2/9, 1/9,
                   0, 0, 2/3, 0,
                   0, 0, 0, 2/3), nrow = 4, ncol = 4, byrow = TRUE)

S_Total <- discphasetype(initDist, P_Mat)

aumath-advancedr2019/PhaseTypeGenetics documentation built on Dec. 3, 2019, 7:16 a.m.