I use the function seqdist from package TraMineR.
First I calculate on 2 trajectories in seq.all :
seqdist(seq.all[1:2,], method="OM", indel=1.1, sm=couts)
[,1] [,2]
[1,] 0.00000 46.91843
[2,] 46.91843 0.00000
So the distance between this trajectories seems to be 46.91843.
But when I use the argument refseq :
seqdist(seq.all[1,], method="OM", indel=1.1, sm=couts,refseq = seq.all[2,])
[1] 60.32636
Now the distance between this trajectories seems to be 60.32636.
What is the trick ?
You get the distances from all sequences to one of the sequence of the considered sequence object by passing the index of the sequence as
refseq
argument. So, you could get the distance between your two sequences withNevertheless, your code should work too and should provide the same value.
This is a bug that may occur when the refseq sequence is passed as a sequence object. We will fix it and make the new version available in the next days on R-Forge.