Density, distribution function, quantile function and random generation for the univariate discrete phase-type distribution.

dDPH(x, obj)

qDPH(p, obj)

pDPH(q, obj)

rDPH(n, obj)

rFullDPH(obj)

Arguments

x, q

vector of quantiles.

obj

an object of class disc_phase_type.

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Value

dDPH gives the density, pDPH gives the distribution function, qDPH gives the quantile function, and rDPH generates random deviates. rFullDPH returns the full path of a random draw from the distribution.

The length of the result is determined by n for rDPH, and is the maximum of the lengths of the numerical arguments for the other functions.

The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Functions

  • dDPH(): Density function for the univariate continuous phase-type distribution.

  • qDPH(): Quantile function for the univariate discrete phase-type distribution.

  • pDPH(): Distribution function for the univariate discrete phase-type distribution.

  • rDPH(): Random number generator for the univariate discrete phase-type distribution.

  • rFullDPH(): Simulation of the full path for the univariate discrete phase-type distribution.

See also

Distributions for other standard distributions.

Examples



disc_phase_type <- matrix(c(0.4, 0, 0.2,
                            0.5, 0.3, 0.2,
                            0, 0.7, 0.2), ncol = 3)
Y <- DPH(disc_phase_type)
#> Warning: 
#>  The initial probability vector is automatically generated.

dDPH(3:4, Y)
#> [1] 0.1560 0.1394
pDPH(5, Y)
#> [1] 0.54366
qDPH(0.5, Y)
#> [1] 5
set.seed(0)
rDPH(6, Y)
#> [1] 11 13  8 20  8  9
rFullDPH(Y)
#>   state time
#> 1     1    3
#> 2     2    3
#> 3     3    1
#> 4     2    1
#> 5     3    1