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

dMDPH(x, obj)

qMDPH(p, obj)

pMDPH(q, obj)

rMDPH(n, obj)

rFullMDPH(obj)

Arguments

x, q

vector of quantiles.

obj

an object of class mult_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

dMDPH gives the density, pMDPH gives the distribution function, qMDPH gives the quantile function, and rMDPH generates random deviates. rFullMDPH returns the full path of a random draw from the distribution.

Each row of the result of For dMDPH, pMDPH, qMDPH, and rMDPH corresponds to each univariate reward transformation. For dMDPH, qMDPH and pMDPH, the inputs x, p and q can be matrices where in row i the i_th reward transformation and in col j the j_th value of x, p or q

tested.

The length of the result is determined by n for rMDPH, 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

  • dMDPH(): Density function for the multivariate discrete phase-type distribution.

  • qMDPH(): Quantile function for the multivariate discrete phase-type distribution.

  • pMDPH(): Distribution function for the multivariate discrete phase-type distribution.

  • rMDPH(): Random number generator for the multivariate discrete phase-type distribution.

  • rFullMDPH(): Simulation of the full path for the multivariate 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)
R <- matrix(c(0, 1, 1,
              2, 1, 5,
              0, 1, 10,
              1, 2, 3), nrow = 3)
Y <- MDPH(disc_phase_type, reward_mat = R)
#> Warning: 
#>  The initial probability vector is automatically generated.

dMDPH(3:4, Y)
#>           [,1]      [,2]
#> [1,] 0.1263889 0.1129074
#> [2,] 0.0000000 0.0400000
#> [3,] 0.0000000 0.0000000
#> [4,] 0.0160000 0.0064000
pMDPH(1.45, Y)
#>           [,1]
#> [1,] 0.1666667
#> [2,] 0.0000000
#> [3,] 0.1666667
#> [4,] 0.1000000
qMDPH(0.5, Y)
#>      [,1]
#> [1,]    3
#> [2,]   13
#> [3,]   13
#> [4,]   10
set.seed(0)
rMDPH(6, Y)
#>      [,1] [,2] [,3] [,4]
#> [1,]    9   29   45   24
#> [2,]   11   31   47   28
#> [3,]    6   26   42   18
#> [4,]   10   50   55   35
#> [5,]    6   22   33   17
#> [6,]    7   23   34   19
rFullMDPH(Y)
#>   state time reward_1 reward_2 reward_3 reward_4
#> 1     1    3        0        6        0        3
#> 2     2    3        3        3        3        6
#> 3     3    1        1        5       10        3
#> 4     2    1        1        1        1        2
#> 5     3    1        1        5       10        3