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

dMPH(x, obj)

qMPH(p, obj)

pMPH(q, obj)

rMPH(n, obj)

rFullMPH(obj)

Arguments

x, q

vector of quantiles.

obj

an object of class mult_cont_phase_type.

p

vector of probabilities.

n

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

Value

dMPH gives the density, pMPH gives the distribution function, qMPH gives the quantile function, and rMPH generates random deviates. rFullMPH returns the full path of a random draw from the distribution.

Each row of the result of For dMPH, pMPH, qMPH, and rMPH 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 rMPH, 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

  • dMPH(): Density function for the multivariate continuous phase-type distribution.

  • qMPH(): Quantile function for the multivariate continuous phase-type distribution.

  • pMPH(): Distribution function for the multivariate continuous phase-type distribution.

  • rMPH(): Random number generator for the multivariate continuous phase-type distribution.

  • rFullMPH(): Simulation of the full path for the multivariate continuous phase-type distribution.

See also

Distributions for other standard distributions.

Examples


cont_phase_type <- matrix(c(-3, 0, 1,
                            2, -3, 1,
                            1, 1, -2), ncol = 3)
R <- matrix(c(0, 1, 1,  2,
                 2, 1, 5,  2,
                 0, 1, 10, 2), nrow = 3, ncol=4, byrow=TRUE)
Y <- MPH(cont_phase_type, reward_mat = R)
#> Warning: 
#>  The initial probability vector is automatically generated.

dMPH(3:4, Y)
#>            [,1]       [,2]
#> [1,] 0.04978707 0.01831564
#> [2,] 0.08879596 0.04274991
#> [3,] 0.08694436 0.06568935
#> [4,] 0.13639222 0.09291062
pMPH(1.45, Y)
#>           [,1]
#> [1,] 0.7654297
#> [2,] 0.6202987
#> [3,] 0.2238680
#> [4,] 0.3415354
qMPH(0.5, Y)
#>           [,1]
#> [1,] 0.6931545
#> [2,] 1.0850215
#> [3,] 4.3387820
#> [4,] 2.1700430
set.seed(0)
rMPH(6, Y)
#>           [,1]      [,2]      [,3]     [,4]
#> [1,] 1.4531985 2.1235576 14.028829 4.247115
#> [2,] 0.8250690 1.7917798  7.746472 3.583560
#> [3,] 1.3303570 2.2700540 16.048413 4.540108
#> [4,] 0.6388227 0.5667907  1.844436 1.133581
#> [5,] 0.6818173 1.2148449  6.482502 2.429690
#> [6,] 0.8615078 1.5659480  8.011439 3.131896
rFullMPH(Y)
#>   state       time  reward_1   reward_2   reward_3  reward_4
#> 1     1 0.10042767 0.0000000 0.10042767  0.1004277 0.2008553
#> 2     2 0.33151860 0.6630372 0.33151860  1.6575930 0.6630372
#> 3     3 1.00391620 0.0000000 1.00391620 10.0391620 2.0078324
#> 4     1 0.72625752 0.0000000 0.72625752  0.7262575 1.4525150
#> 5     2 0.09485884 0.1897177 0.09485884  0.4742942 0.1897177
#> 6     3 0.27891468 0.0000000 0.27891468  2.7891468 0.5578294
#> 7     1 0.32579860 0.0000000 0.32579860  0.3257986 0.6515972
#> 8     2 0.10314929 0.2062986 0.10314929  0.5157464 0.2062986