交易者替代成本 [英] Traminer substitution cost

查看:92
本文介绍了交易者替代成本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对过渡成本矩阵存在逻辑上的问题.我正在使用R包Traminer处理序列差异.

I have a logical problem with the transition cost matrix. I am working on sequences dissimilarity using the R package Traminer.

我尝试给你一个简单的例子(非常简单,但是希望对我的问题有所帮助):

I try to give you a simple example (very simple, but I hope useful to explain my problem):

有3个序列,我想计算不相似矩阵. 字母是:H(健康),I(在家中),IH(在医院中),D(去世)

There are three sequences and I want to be calculate the dissimilarity matrix. The alphabet is: H (in health), I (ill at home), IH (ill at hospital), D (died)

我观察了3个受试者的5个观察结果.这些是顺序:

I observe the 3 subjects for 5 observations. These are the sequences:

H – H – I – D – D 
H – I – I – I – D 
I – I – H – IH – IH 

替代成本矩阵是一个4x4的表格(状态x状态). 它必须对称吗? 这是我的逻辑问题:尽管有可能从状态H,I或IH过渡"到状态Died,但相反是不合逻辑的.

The substitution cost matrix is a 4x4 table (state x state). It must be symmetric? This is my logical problem: while it is possible to "transit" from states H, I or IH to state Died, the contrary is illogical.

我可以在TraMineR中使用非对称替代成本矩阵吗?

Can I use a non-symmetric substitution cost matrix in TraMineR?

如果在我的数据库中,从状态"I"到"D"的替换成本(例如,用sm = "TRATE"计算)比从状态"I"到"IH"的替换成本低(0.5)( 0.6),则OM算法将"I"替换为"D",而不是"HI".

If, in my database, the substitution cost (calculated with sm = "TRATE", for instance) from state "I" to "D" is lower (0.5) than the substitution cost from state 'I' to 'IH' (0.6) , the OM algorithm substitute the "I" whith "D" instead of "HI".

推荐答案

在我看来,您正在寻找自定义费用矩阵.不必使用TRATECONSTANT方法.

it seems to me that you're looking for a custom cost matrix. It is not mandatory to use either the TRATE or CONSTANT method.

要创建自定义矩阵,您只需执行以下操作即可:

To create a custom matrix you'll just have to do something like this:

myscm <- matrix(c(0,1,2, 
                  1,0,2, 
                  2,2,0), nrow=3, ncol=3) 
dist.om <- seqdist(my.seq, method="OM", sm=myscm)

其中myscm是您的自定义矩阵

此内容取自 http ://lists.r-forge.r-project.org/pipermail/traminer-users/2011-July/000075.html

我相信您有两种选择:

1)为所有过渡创建理由并创建完整的自定义矩阵

1) Create a rationale for all the transitions and a full custom matrix

2)获取已经生成的转换矩阵(使用seqsubm(your.seq, method = "TRATE")),仅更改不一致的值.这就是我在上次分析中所做的.

2) Get the transition matrix you've already generated (using seqsubm(your.seq, method = "TRATE") ) and change just the inconsistent values. That's what I've done in my last analysis.

但请记住,吉尔伯特(Gilbert)在成对距离矩阵

But keep in mind the point made by Gilbert in An "asymmetric" pairwise distance matrix

这篇关于交易者替代成本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆