MDPH_functions {PhaseTypeR} | R Documentation |
The Multivariate Discrete Phase-Type Distribution
Description
Density, distribution function, quantile function and random generation for the multivariate discrete phase-type distribution.
Usage
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 |
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)
dMDPH(3:4, Y)
pMDPH(1.45, Y)
qMDPH(0.5, Y)
set.seed(0)
rMDPH(6, Y)
rFullMDPH(Y)