Combining two matrices. The parametric schem of matrice is defined by nattural numbers; different numbers = different rate parameters

comb2matrices(M1, M2, dependent.state = NULL, name.sep = "",
  diag.as = "")

Arguments

M1

matrix; if dependency true thenM1 controls M2

M2

matrix; if dependency true then: M2 depends on those states of M1 specified in dependent.state

dependent.state

state(s) of M1 that switches on matrix M2

name.sep

separator for state names

diag.as

hpopulate main diagonal with

Value

Matrix

Examples

M1<-matrix(c(-1,1,  2,-2),2,2,byrow=TRUE)
rownames(M1)<-colnames(M1)<-c("0","1")
M2<-matrix(c(-3,3,  4,-4),2,2,byrow=TRUE)
rownames(M2)<-colnames(M2)<-c("0","1")
comb2matrices(M1, M2, dependent.state=NULL)
#>    00 01 10 11
#> 00 -4  3  1  0
#> 01  4 -5  0  1
#> 10  2  0 -5  3
#> 11  0  2  4 -6
comb2matrices(M1, M2, dependent.state=2)
#>    00 01 10 11
#> 00 -1  0  1  0
#> 01  0 -1  0  1
#> 10  2  0 -5  3
#> 11  0  2  4 -6