alpha_1_k1 is associated with the transitions 1 -> 0 and 1 -> 1
alpha_0_k1 <- matrix(0, dias-1, 2)
alpha_1_k1 <- matrix(0, dias-1, 2)
for(i in 1:(dias-1)){
for(j in 1:2){
if(count_0_k1[i,j] == 0){alpha_0_k1[i,j] = 3}
if(count_1_k1[i,j] == 0){alpha_1_k1[i,j] = 3} }
if((count_0_k1[i,1] == count_0_k1[i,2]) & (count_0_k1[i,1] != 0) &
(count_0_k1[i,1] < 5) & (alpha_0_k1[i, 1] == 0)){alpha_0_k1[i,1] = 5
if(alpha_0_k1[i,2] == 0){alpha_0_k1[i,2] = 5} }
if((count_1_k1[i,1] == count_1_k1[i,2]) & (count_1_k1[i,1] != 0) &
(count_1_k1[i,1] < 5) & (alpha_1_k1[i, 1] == 0)){alpha_1_k1[i,1] = 5
if(alpha_1_k1[i,2] == 0){alpha_1_k1[i,2] = 5} }
if((count_0_k1[i,1] == count_0_k1[i,2]) & (count_0_k1[i,1] != 0) &
(count_0_k1[i,1] >= 5) & (alpha_0_k1[i, 1] == 0)){alpha_0_k1[i,1] = 7
if(alpha_0_k1[i,2] == 0){alpha_0_k1[i,2] = 7} }
if((count_1_k1[i,1] == count_1_k1[i,2]) & (count_1_k1[i,1] != 0) &
(count_1_k1[i,1] >= 5) & (alpha_1_k1[i, 1] == 0)){
alpha_1_k1[i,1] = 7
if(alpha_1_k1[i,2] == 0){alpha_1_k1[i,2] = 7} }
if((count_0_k1[i,1] == min(count_0_k1[i,])) & (count_0_k1[i,1] != 0)){
if(alpha_0_k1[i,1] == 0){alpha_0_k1[i,1] = 4}
if(alpha_0_k1[i,2] == 0){alpha_0_k1[i,2] = 8} }
if((count_1_k1[i,1] == min(count_1_k1[i,])) & (count_1_k1[i,1] != 0)){
if(alpha_1_k1[i,1] == 0){alpha_1_k1[i,1] = 4}
if(alpha_1_k1[i,2] == 0){alpha_1_k1[i,2] = 8} }
if((count_0_k1[i,1] == min(count_0_k1[i,])) & (count_0_k1[i,1] == 0)){
if(alpha_0_k1[i,2] == 0){alpha_0_k1[i,2] = 8} }
if((count_1_k1[i,1] == min(count_1_k1[i,])) & (count_1_k1[i,1] == 0)){
if(alpha_1_k1[i,2] == 0){alpha_1_k1[i,2] = 8} }
if((count_0_k1[i,1] == max(count_0_k1[i,])) & (count_0_k1[i,2] != 0)){
if(alpha_0_k1[i,1] == 0){alpha_0_k1[i,1] = 8}
if(alpha_0_k1[i,2] == 0){alpha_0_k1[i,2] = 4} }
if((count_1_k1[i,1] == max(count_1_k1[i,])) & (count_1_k1[i,2] != 0)){
if(alpha_1_k1[i,1] == 0){alpha_1_k1[i,1] = 8}
if(alpha_1_k1[i,2] == 0){alpha_1_k1[i,2] = 4} }
if((count_0_k1[i,1] == max(count_0_k1[i,])) & (count_0_k1[i,2] == 0)){
if(alpha_0_k1[i,1] == 0){alpha_0_k1[i,1] = 8} }
if((count_1_k1[i,1] == max(count_1_k1[i,])) & (count_1_k1[i,2] == 0)){
if(alpha_1_k1[i,1] == 0){alpha_1_k1[i,1] = 8} }
}