找回密码
 注册
查看: 482|回复: 0

R语言 TraMineR包 seqlogp()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 11:39:51 | 显示全部楼层 |阅读模式
seqlogp(TraMineR)
seqlogp()所属R语言包:TraMineR

                                         Compute the logarithm of sequences probabilities
                                         计算的序列的概率的对数

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Compute the logarithm of probability of each sequence using a state transition model. The probability of a sequence is equal to the product of each state probability of the sequence. There are several method to compute a state probability.
计算使用状态转换模型的每个序列的概率的对数。在序列的概率是相等的产品的每个状态序列的概率。有几种方法来计算状态概率。


用法----------Usage----------


seqlogp(seqdata, prob="trate", time.varying=TRUE, begin="freq",
    weighted=TRUE)



参数----------Arguments----------

参数:seqdata
The sequence to compute the probabilities.
的序列来计算概率。


参数:prob
The name of the probability model used. The probability can be either based on transition rates ("trate") or on state frequencies ("freq"). This can also be an array specifying the transition probabilities at each t (see details).
的名称所用的概率模型。的概率可以根据过渡税率(“硝酸盐”)或状态的频率(“频率”)。这也可以是一个array指定的过渡概率在每个t(见详情)。


参数:time.varying
Logical. If TRUE, the probabilities are (either transition or frequencies) are computed separately for each time t
逻辑。如果TRUE“的概率是(任何变化或频率)分别计算,为每次t


参数:begin
Model used to compute the probability of the first state. Either "freq" to use the observed frequencies on the first period or a vector specifying the probability of each states appearing in seqdata.
模型,用于计算所述第一状态的概率。无论是“频率”使用指定每个状态的概率出现在seqdata第一个时期或一个矢量观测到的频率上。


参数:weighted
Logical. If TRUE, uses the weights specified in seqdata when computing the observed transition rates.
逻辑。如果TRUE,使用指定的seqdata计算时所观察到的过渡率的权重。


Details

详细信息----------Details----------

The sequence likelihood P(s) is defined as the product of the probability with which each of its observed successive state is supposed to occur at its position. Let s=s_1s_2 ... s_l be a sequence of length l. Then
被定义为与每个其观察到的连续状态的概率应该是发生在其位置的产品的序列似然P(s)。让我们s=s_1s_2 ... s_l是一个序列的长度l。然后

with P(s_t,t) the probability to observe state s_t at position t.
P(s_t,t)的概率遵守国家s_t的位置t。

The question is how to determinate the state probabilities P(s_t,t). Several methods are available and can be set using the prob argument.
现在的问题是如何确定的状态的概率P(s_t,t)。有几种方法可prob使用参数可以设置。

One commonly used method for computing them is to postulate a Markov model, which can be of various order. We can consider probabilities derived from the first order Markov model, that is each P(s_t,t), t>1 is set to the transition rate p(s_t|s_(t-1)). This is available in seqlogp by setting prob="trate". <br> The transition rates may be considered constant over time/positions (time.varying=FALSE), that is estimated across sequences from the observations at positions t and t-1 for all t together. Time varying transition rates may also be considered (time.varying=TRUE), in which case they are computed separately for each position, that is estimated across sequences from the observations at positions t and t-1 for each t, yielding an array of transition matrices. The user may also specify his own transition rates array or matrix.
一个常用的计算方法是假设,它可以是各阶马尔可夫模型。我们可以考虑来自一阶Markov模型的概率,这是每一个P(s_t,t),t>1设置的转换率p(s_t|s_(t-1))。这是在seqlogp,通过设置prob="trate"。参考转换费率可能会被认为是恒定的时间/位置(time.varying=FALSE),估计在从观测序列的位置t和t-1t在一起。随时间变化的升学率,也可以考虑(time.varying=TRUE),在这种情况下,他们分别计算每一个位置,即估计从观测序列之间的位置t和t-1每个t,产生一个过渡矩阵数组。用户还可以指定自己的转移速率的阵列或矩阵。

Another method is to use the frequency of a state at each position to set P(s_t,t) (prob="freq"). In the latter case, the probability of a sequence is independant of the probability of its transition. Here again, the frequencies can be computed all together (time.varying=FALSE) or separately for each position t (time.varying=TRUE).  For t=1, we set P(s_1,1) to the observed frequency of the state s_1 at position 1. Alternatively, the begin argument allows to specify the probability of the first state.
另一种方法是使用在每个位置的状态下的频率设置P(s_t,t)(prob="freq")。在后者的情况下,在序列的概率是独立的,其过渡的概率。在这里,频率可以一起计算(time.varying=FALSE)或单独为每个位置t(time.varying=TRUE)。对于t=1,我们将P(s_1,1)国家s_1观测到的频率在位置1。可替代地,begin参数允许指定的第一状态的概率。

The likelihood P(s) being generally very small, seqlogp return -log(P(s)). The latter quantity is minimal when P(s) is equal to 1.
的可能性P(s)一般都非常小,seqlogp返回-log(P(s))。后者的数量是很少的,当P(s)等于1。


值----------Value----------

A vector containing the logarithm of each sequence probability.
一种向量,包含的每个序列的概率的对数。


实例----------Examples----------


## Creating the sequence objects using weigths[#创建序列对象使用weigths]
data(biofam)
biofam.seq <-  seqdef(biofam, 10:25, weights=biofam$wp00tbgs)

## Computing sequence probabilities[#计算序列的概率]
biofam.prob <- seqlogp(biofam.seq)
## Comparing the probability of each cohort[#每个队列的概率比较]
cohort <- biofam$birthyr>1940
boxplot(biofam.prob~cohort)


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-30 03:23 , Processed in 0.024644 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表