Computes the minima and maxima of two independent discrete or continuous
phase-type distributed variables with initial distributions
initDist1
and initDist2
as well as sub-transition/sub-intensity
matrices equal to P_Mat1
/T_Mat1
and P_Mat2
/T_Mat2
.
minima(object1, object2) maxima(object1, object2)
object1, object2 | two objects of class |
---|
Mogens Bladt and Bo Friis Nielsen (2017): Matrix-Exponential Distributions in Applied Probability. Probability Theory and Stochastic Modelling (Springer), Volume 81.
The function minima
returns an object of type discphasetype
or contphasetype
(depending on the input) holding the phase-type representation
of the minimum of the input objects, while maxima
returns an object of type discphasetype
or contphasetype
that holds the phase-type representation
of the maximum of the input objects.
In the discrete case, the minimum and maximum of two phase-type distributed
variables \(tau1 ~ DPH_p(\alpha,S)\) and \(tau2 ~ DPH_q(\beta,T)\) are defined
as follows
$$min(tau1, tau2) ~ DPH_{pq}( kronecker(\alpha,\beta), kronecker(S,T) ),$$
and
$$max(tau1, tau2) ~ DPH_{pq + p + q}( c(kronecker(\alpha,\beta),0_vec), K ),$$
where
0_vec
is a vector of length \(p+q\) with zero in each entry and
$$K= rbind( cbind(kronecker(S,T), kronecker(S,t),kronecker(s,T) ),
cbind(matrix(0, ncol = p*q, nrow = p), S , matrix(0, ncol = q, nrow = p)),
cbind(matrix(0, ncol = p*q, nrow = q), matrix(0, ncol = p, nrow = q), T)).$$
In the continuous case, the minima and maxima of two phase-type distributed
variables \(X ~ PH_p(\alpha,S)\) and \(Y ~ PH_q(\beta,T)\) is
given in the following way
$$min(X, Y) ~ PH( kronecker(\alpha,\beta), kronecker(S,T) ),$$
and
$$max(X, Y) ~ PH( c(kronecker(alpha,beta),0_vec), K ),$$
where
0_vec
is a vector of length \(p+q\) with zero in each entry and
$$K= rbind( cbind(kronecker(S,T), kronecker(I,t),kronecker(s,I) ),
cbind(matrix(0, ncol = p*q, nrow = p), S , matrix(0, ncol = q, nrow = p)),
cbind(matrix(0, ncol = p*q, nrow = q), matrix(0, ncol = p, nrow = q), T)).$$
## Two representations of the total branch length ## are given by T_Total1 <- matrix(c(-1.5, 1.5, 0, 0, -1, 1, 0, 0, -0.5), nrow = 3, byrow = TRUE) T_Total2 <- matrix(c(-1.5, 1.5, 0, 0, 0, -1, 2/3, 1/3, 0, 0, -0.5, 0, 0, 0, 0, -0.5), nrow = 4, byrow = TRUE) ## Defining two objects of type "contphasetype". T_Total1 <- contphasetype(initDist = c(1,0,0), T_Total1) T_Total2 <- contphasetype(initDist = c(1,0,0,0), T_Total2) ## Computing the minimum and maximum minima(T_Total1, T_Total2)#> $initDist #> [1] 1 0 0 0 0 0 0 0 0 0 0 0 #> #> $T_Mat #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] #> [1,] -3 1.5 0.0000000 0.0000000 1.5 0.0 0.0000000 0.0000000 0 #> [2,] 0 -2.5 0.6666667 0.3333333 0.0 1.5 0.0000000 0.0000000 0 #> [3,] 0 0.0 -2.0000000 0.0000000 0.0 0.0 1.5000000 0.0000000 0 #> [4,] 0 0.0 0.0000000 -2.0000000 0.0 0.0 0.0000000 1.5000000 0 #> [5,] 0 0.0 0.0000000 0.0000000 -2.5 1.5 0.0000000 0.0000000 1 #> [6,] 0 0.0 0.0000000 0.0000000 0.0 -2.0 0.6666667 0.3333333 0 #> [7,] 0 0.0 0.0000000 0.0000000 0.0 0.0 -1.5000000 0.0000000 0 #> [8,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 -1.5000000 0 #> [9,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 -2 #> [10,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [11,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [12,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [,10] [,11] [,12] #> [1,] 0.0 0.0000000 0.0000000 #> [2,] 0.0 0.0000000 0.0000000 #> [3,] 0.0 0.0000000 0.0000000 #> [4,] 0.0 0.0000000 0.0000000 #> [5,] 0.0 0.0000000 0.0000000 #> [6,] 1.0 0.0000000 0.0000000 #> [7,] 0.0 1.0000000 0.0000000 #> [8,] 0.0 0.0000000 1.0000000 #> [9,] 1.5 0.0000000 0.0000000 #> [10,] -1.5 0.6666667 0.3333333 #> [11,] 0.0 -1.0000000 0.0000000 #> [12,] 0.0 0.0000000 -1.0000000 #> #> attr(,"class") #> [1] "contphasetype"maxima(T_Total1, T_Total2)#> $initDist #> [1] 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> #> $T_Mat #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] #> [1,] -3 1.5 0.0000000 0.0000000 1.5 0.0 0.0000000 0.0000000 0 #> [2,] 0 -2.5 0.6666667 0.3333333 0.0 1.5 0.0000000 0.0000000 0 #> [3,] 0 0.0 -2.0000000 0.0000000 0.0 0.0 1.5000000 0.0000000 0 #> [4,] 0 0.0 0.0000000 -2.0000000 0.0 0.0 0.0000000 1.5000000 0 #> [5,] 0 0.0 0.0000000 0.0000000 -2.5 1.5 0.0000000 0.0000000 1 #> [6,] 0 0.0 0.0000000 0.0000000 0.0 -2.0 0.6666667 0.3333333 0 #> [7,] 0 0.0 0.0000000 0.0000000 0.0 0.0 -1.5000000 0.0000000 0 #> [8,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 -1.5000000 0 #> [9,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 -2 #> [10,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [11,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [12,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [13,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [14,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [15,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [16,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [17,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [18,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [19,] 0 0.0 0.0000000 0.0000000 0.0 0.0 0.0000000 0.0000000 0 #> [,10] [,11] [,12] [,13] [,14] [,15] #> [1,] 0.0 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 #> [2,] 0.0 0.0000000 0.0000000 5.551115e-17 0.000000e+00 0.000000e+00 #> [3,] 0.0 0.0000000 0.0000000 5.000000e-01 0.000000e+00 0.000000e+00 #> [4,] 0.0 0.0000000 0.0000000 5.000000e-01 0.000000e+00 0.000000e+00 #> [5,] 0.0 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 #> [6,] 1.0 0.0000000 0.0000000 0.000000e+00 5.551115e-17 0.000000e+00 #> [7,] 0.0 1.0000000 0.0000000 0.000000e+00 5.000000e-01 0.000000e+00 #> [8,] 0.0 0.0000000 1.0000000 0.000000e+00 5.000000e-01 0.000000e+00 #> [9,] 1.5 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 #> [10,] -1.5 0.6666667 0.3333333 0.000000e+00 0.000000e+00 5.551115e-17 #> [11,] 0.0 -1.0000000 0.0000000 0.000000e+00 0.000000e+00 5.000000e-01 #> [12,] 0.0 0.0000000 -1.0000000 0.000000e+00 0.000000e+00 5.000000e-01 #> [13,] 0.0 0.0000000 0.0000000 -1.500000e+00 1.500000e+00 0.000000e+00 #> [14,] 0.0 0.0000000 0.0000000 0.000000e+00 -1.000000e+00 1.000000e+00 #> [15,] 0.0 0.0000000 0.0000000 0.000000e+00 0.000000e+00 -5.000000e-01 #> [16,] 0.0 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 #> [17,] 0.0 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 #> [18,] 0.0 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 #> [19,] 0.0 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 #> [,16] [,17] [,18] [,19] #> [1,] 0.0 0.0 0.0000000 0.0000000 #> [2,] 0.0 0.0 0.0000000 0.0000000 #> [3,] 0.0 0.0 0.0000000 0.0000000 #> [4,] 0.0 0.0 0.0000000 0.0000000 #> [5,] 0.0 0.0 0.0000000 0.0000000 #> [6,] 0.0 0.0 0.0000000 0.0000000 #> [7,] 0.0 0.0 0.0000000 0.0000000 #> [8,] 0.0 0.0 0.0000000 0.0000000 #> [9,] 0.5 0.0 0.0000000 0.0000000 #> [10,] 0.0 0.5 0.0000000 0.0000000 #> [11,] 0.0 0.0 0.5000000 0.0000000 #> [12,] 0.0 0.0 0.0000000 0.5000000 #> [13,] 0.0 0.0 0.0000000 0.0000000 #> [14,] 0.0 0.0 0.0000000 0.0000000 #> [15,] 0.0 0.0 0.0000000 0.0000000 #> [16,] -1.5 1.5 0.0000000 0.0000000 #> [17,] 0.0 -1.0 0.6666667 0.3333333 #> [18,] 0.0 0.0 -0.5000000 0.0000000 #> [19,] 0.0 0.0 0.0000000 -0.5000000 #> #> attr(,"class") #> [1] "contphasetype"