1
$\begingroup$

I have a little complicated alphabet. I have for example:

1. A1|B1
2. A1|B2
3. A2|B3

So, dissimilarity between A1|B1 and A2|B3 =1, but dissimilarity between A1|B1 and A1|B2 is 1/2. How can i use this cost of matching/dismatching in TraMiner OM algorithm together or separately from substitution-cost matrix?

$\endgroup$
1
  • $\begingroup$ Thank you very much for answer! My sequences look like: 1. "A1|B1,A1|B2" 2. "A1|B1,A2|B3" 3. "A1|B1,A1|B2,A2|B3” If matrix sm will be my substitution cost matrix - I will not use "TRATE" method at all? If my sm dissimilarity matrix 0-absolutly equal to 1- absolutely not equal, so my indel cost must be 1? Also I have another question. I am using agnes(bs.om, diss = TRUE, method = "ward") for hierarchical clustering. What way you use to choose the best clusters? You cut it by height? How do you choose representative for each cluster? Thank you so so much! Alexandra $\endgroup$
    – Alexandra
    May 25, 2015 at 7:14

1 Answer 1

1
$\begingroup$

The costs in optimal matching are specifically there to account for differences in state (dis)similarities as in your example. Here is an example of how you would define the substitution cost matrix sm

lab <- c("A1|B1","A1|B2","A2|B3")
sm <- matrix(
  c(0, .5, 1,
    .5, 0,  1,
    1,  1, 0),
  nrow = 3, ncol = 3, byrow = TRUE,
  dimnames = list(lab, lab))

You then pass the matrix to seqdist with the sm=sm argument.

$\endgroup$
2
  • $\begingroup$ Thank you very much for answer! My sequences look like: 1. "A1|B1,A1|B2" 2. "A1|B1,A2|B3" 3. "A1|B1,A1|B2,A2|B3” If matrix sm will be my substitution cost matrix - I will not use "TRATE" method at all? If my sm dissimilarity matrix 0-absolutly equal to 1- absolutely not equal, so my indel cost must be 1? $\endgroup$
    – Alexandra
    May 21, 2015 at 8:28
  • $\begingroup$ Also I have another question. I am using agnes(bs.om, diss = TRUE, method = "ward") for hierarchical clustering. What way you use to choose the best clusters? You cut it by height? How do you choose representative for each cluster? Thank you so so much! Alexandra $\endgroup$
    – Alexandra
    May 21, 2015 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.