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

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

  [复制链接]
发表于 2012-9-16 17:20:03 | 显示全部楼层 |阅读模式
dmm(depmix)
dmm()所属R语言包:depmix

                                        Dependent Mixture Model Specifiction
                                         相关的混合模型Specifiction

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

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

dmm creates an object of class dmm, a dependent mixture model.
dmm创建一个对象类dmm,依赖混合模型。

lca creates an object of class dmm,lca, a latent class model or an independent mixture model.
lca创建类的一个对象dmm,lca,一个潜在的类模型或独立的混合模型。


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


        dmm(nstates, itemtypes, modname = NULL, fixed = NULL,
                 stval = NULL, conrows = NULL, conpat = NULL, tdfix =
                 NULL, tdst = NULL, linmat = NULL, snames = NULL,
                 inames = NULL)
        ## S3 method for class 'dmm'
summary(object, specs=FALSE, precision=3, se=NULL, ...)

        lca(nclasses, itemtypes, modname = NULL, fixed = NULL,
                 stval = NULL, conrows = NULL, conpat = NULL,
                                 linmat = NULL, snames = NULL, inames = NULL)
       



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

参数:nstates
The number of latent states/classes of the model.
潜伏状态/模型类的数量。


参数:nclasses
The number of classes of an lca model, ie the number of states in a dmm model. They are now called classes because they do not change over time.
的生命周期模型中的类的数量,也就是在dmm模型的状态数。他们现在被称为类,因为它们不随时间而改变。


参数:itemtypes
A vector of length nitems providing the type of measurement, 1 for gaussian data, 2 for a binary item, n>3 for categorical items with n answer possibilities. Answer categories are  assumed to be unordered categorical. Ordinal responses can be implemented  using inequality and/or linear constraints.
长度的向量nitems提供测量的类型,1为高斯数据,2为一个二进制的资料,n> 3的具有n个分类项目回答的可能性。答类被认为是无序的分类。不平等和/或线性约束,可以实现有序回应,。


参数:modname
A character string with the name of the model, good when  fitting many models. Components of mixture models keep their own names.  Names are printed in the summary. Boring default names are provided.
一个字符串,该模型的名称,好装修时许多模型。混合模型的组件保持了自己的名字。名称印在摘要中。镗默认名称。


参数:fixed
A vector of length the number of parameters of the model idicating whether parameters are fixed (0) or not (>0).  This may be identical to conpat (see below).
的向量的长度的模型idicating参数是否是固定的(0)或(> 0)的数目的参数。这可能是相同conpat(见下文)。


参数:stval
Start values of the parameters.  These will be random if not specified.  Start values must be specified (for all parameters) if there are fixed parameters.
启动的参数的值。这些将是随机的,如果没有指定。开始值必须被指定的所有参数,如果有固定的参数。


参数:conrows
Argument conrows can be used to specify general constraints between parameters. See details below.
参数conrows可以用来指定常规参数之间的约束。详见下文。


参数:conpat
Argument conpat can be used to specify fixed parameters and equality constraints.  It can not be used in conjuction with fixed.  See details below.
参数conpat可用于指定固定的参数和平等的限制。具有固定的,它不能被用于在conjuction。详见下文。


参数:tdfix,tdst
The first is a logical vector indicating (with 1's)  which parameters are dependent on covariates (it should have length npars).  tdst provides the starting values for the regression parameters.  Using tdcov=TRUE in fitdmm will actually fit the regression parameters.  The covariate itself has to be specified in the data as  "covariate" (see help on markovdata) and should be scaled to 0-1.
第一个是逻辑向量,表示(1)的参数依赖于协变量(它应该有长度nPar)的。 tdst才是提供回归参数的起始值。真正适合使用tdcov = TRUE在fitdmm的回归参数。协本身具有指定的数据为“协”(见帮助markovdata)的,应扩展到0-1。


参数:linmat
A complete matrix of linear constraints.  This argument is intended for internal use only, it is used by the fit routine to re-create the model with the fitted parameter values.  Warning: use of this argument results in complete replacement of the otherwise created matrix A, which contains e.g. sum contraints for transition matrix parameters.  If linmat is provided, make sure it is correct, otherwise strange results may occur in fitting models.
一个完整的矩阵的线性约束。这种说法是唯一的,它是适合日常使用的重新创建模型的拟合参数值供内部使用。警告:这种说法完全更换,否则创建的矩阵A,其中包括,例如使用总结过渡矩阵参数的约束上。如果linmat提供,请确保它是正确的,,怪不然结果可能会发生在拟合模型。


参数:snames
Names for the states may be provided in snames.  Defaults are State1, State2 etc. These are printed in the summary.
的状态的名称可以设置在snames的。默认值是状态1,状态2等,这些都印在摘要中。


参数:inames
Names for items may be provided in inames.  Defaults are Item1, Item2 etc. They are printed in the summary.
的项目的名称可以设置在inames的。默认值是项目1,项目2“等,他们都印在总结。


参数:dmm
Object of class dmm.
对象类dmm。


参数:precision
Precision sets the number of digits to be printed in the summary functions.
精度设置在汇总函数要打印的数字位数。


参数:se
Vector with standard errors, these are passed on from the  summary.fit function if and when ses are available.
向量的标准误差,这些都是通过从的summary.fit功能,如果和社企时。


参数:specs,...
Internal use.
内部使用。


参数:object
An object of class dmm.
对象的类dmm。


Details

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

The function dmm creates an object of class dmm and sets random initial parameter values if these are not provided.  Even though dmm is not a mixture of Markov models, the mixture parameter is is included in the parameter vector.  This is important when specifying constraints.  Parameters are ordered as follows: the first parameter(s) are the mixing proportions of the mixture of Markov and/or latent class models.  I.e., when a single latent class model or a single Markov chain is fitted, this mixture proportion has value 1.0 and is it is fixed in estimation.  After the mixing proportions, the next parameters in the parameter vector are the transition matrix parameters, the square of nstates in row-major order.  That is, first the transition probabilities from state 1 to all the other states are given, then the probabilities from state 2 to all the other states etc.  Next are the observation matrix parameters.  These are provided consecutively for each state/class.  Ie a trichtomous item model with two states has 6 observation parameters; the first three are the probabilities of observing category 1, 2 and 3 respectively in state 1 (which sum to one), and then similarly for state 2.  As another example: suppose we have model for one binary item and one gaussian item, in that order, we would have 4 observation parameters for each state, first the probabilities of observing a symbol from category 1 or 2 in state 1, the two parameters, the mean and standard deviation for state 1, and then the same state 2 (see the example in fitdmm with data from rudy). Finally the initial state probabilities are provided, in the order of the states.  In the case of a latent class model or a finite mixture model, these parameters are usually denote as the mixture proportions.
函数dmm创建一个对象的类dmm,并设置随机的初始参数值,如果这些都没有提供。即使dmm是不是马尔可夫模型的混合物,该混合物参数被包含在参数矢量。指定的限制时,这是非常重要的。的参数顺序如下:第一个参数(S)的混合比例的混合物,的马氏和/或潜在类别模型。即,当一个单一的潜类模型或一个单一的马尔可夫链嵌合时,该混合物的比例具有值1.0,它被固定在估计。的比例混合后,下一个参数的参数向量的过渡矩阵参数,方行主要为了nstates。也就是说,首先从状态1到所有其他国家的转移概率,然后从状态2到所有其他国家的概率等。接下来是观察矩阵参数。这些连续为每个国家/类。 IE浏览器的一个trichtomous项目模型有两个国家有6个观测参数,前三个是观察1类,2和3分别在状态1(和一个),然后同样状态2的概率。另外一个例子:假设我们有一个二进制项目的模型和一个高斯项目,按照这个顺序,我们会为每个状态的参数有4个观察,观察1或2类中的一个符号状态1的概率,这两个参数,为状态1的平均值和标准偏差,然后在相同的状态2(见例如在fitdmm数据从鲁迪)。最后,初始状态概率,状态的顺序。在潜类模型或有限混合模型的情况下,这些参数通常是表示作为混合比例。

Linear constraints can be set using arguments conrows and conpat.  conrows must be contain nc by npars values, in row major order, with nc the number of contraints to be specified. conrows is used to define general linear constraints.  A row of conrows must contain the partial derivatives of a general linear constraint with respect to each of the parameters.  Suppose we want the constraint x1 -2*x2=0, one row of conrows should contain a 1 in position one and -2 in position and zeroes in the remaining positions. In the function mixdmm conrows is understood to specify linear constraints on the mixing proportions only.  As a consequence, it is not possible to easily constrain parameters between components of a mixture model.
线性约束条件可以设置使用参数conrows和conpat。 conrows必须包含NC硬件分区值,行大订单,与NC指定的约束上。 conrows是用来定义一般线性约束。一排conrows必须包含相对于每一个参数的偏导数的一般线性约束。假设我们想的约束-2 X1 * X2 = 0,一排conrows应该包含1位置1和-2的位置和零在其余的位置。在功能mixdmmconrows了解指定线性约束的混合比例。作为结果,它是不能够容易地限制组件之间的混合物模型参数。

conpat can be used as a shortcut for both fixed and conrows.  It must be a single vector of length npars contaning 0's (zeroes) for fixed parameters, 1's (ones) for free parameters and higher numbers for possibly equality constrained parameters.  E.g. conpat=c(1,1,0,2,2,3,3,3) would indicate that pars 1 and 2 are freely estimated, par 3 is fixed at its startvalue (which must be provided in this case), par 4 and 5 are to estimated equal and pars 6, 7 and 8 are also to be estimated equal.
conpat可以使用的快捷方式都固定和conrows的。它必须是一个向量的长度硬件分区浸渗0(零)为固定参数,参数和较高的数字可能等式约束参数(个)。例如conpat=c(1,1,0,2,2,3,3,3)将表明标准杆1和2的自由估计,标准杆3被固定在其起始值(在这种情况下,必须提供),4和5是面值估计均等且平坦部6,7和8是也要估计相等。


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

dmm returns an object of class dmm which has its own summary method.  This will print the parameter values, itemtypes, number of (free) parameters, and the number of states.  There is no print method.  Using print will print all fields of the model which is a list of the following:
dmm返回一个对象类dmm有其自己总结的方法。这将打印参数值,itemtypes,数量的参数(免费),和的状态的数量。有没有打印方法。使用打印,打印所有领域的模型,这是下面的列表:

<table summary="R valueblock"> <tr valign="top"><td>modname</td> <td> See above.</td></tr>
<table summary="R valueblock"> <tr valign="top"> <TD> modname</ TD> <TD>以上。</ TD> </ TR>

<tr valign="top"><td>nstates</td> <td> See above</td></tr>
<tr valign="top"> <TD> nstates </ TD> <TD>见上文</ TD> </ TR>

<tr valign="top"><td>snames</td> <td> See above.</td></tr>
<tr valign="top"> <TD> snames </ TD> <TD>以上。</ TD> </ TR>

<tr valign="top"><td>nitems</td> <td> The number of items(=length(itemtypes)).</td></tr>
<tr valign="top"> <TD> nitems</ TD> <TD>的项目数(=的长度(itemtypes))。</ TD> </ TR>

<tr valign="top"><td>itemtypes</td> <td> See above.</td></tr>
<tr valign="top"> <TD> itemtypes </ TD> <TD>以上。</ TD> </ TR>

<tr valign="top"><td>inames</td> <td> See above.</td></tr>
<tr valign="top"> <TD> inames </ TD> <TD>以上。</ TD> </ TR>

<tr valign="top"><td>npars</td> <td> The total parameter count of the model.</td></tr>
<tr valign="top"> <TD>npars </ TD> <TD>总参数计数的模式。</ TD> </ TR>

<tr valign="top"><td>nparstotal</td> <td> The total number of parameters of when the covariate  parameters are included.</td></tr>
<tr valign="top"> <TD> nparstotal </ TD> <TD>当协变量的参数,参数的总数。</ TD> </ TR>

<tr valign="top"><td>freepars</td> <td> The number of freely estimated parameters (it is computed as sum(as.logical(fixed))-rank(qr(A)).</td></tr>
<tr valign="top"> <TD> freepars </ TD> <TD>自由估计参数的数量(金额的计算方法为(as.logical(固定))排名(QR(A) )</ TD> </ TR>

<tr valign="top"><td>freeparsnotd</td> <td> The number of freely estimated parameters (it is computed as sum(as.logical(fixed))-rank(qr(A)); this version without the covariate parameters.</td></tr>
<tr valign="top"> <TD> freeparsnotd </ TD> <TD>自由估计参数的数量(金额的计算方法为(as.logical(固定))排名(QR(A)没有协变量参数),这个版本。</ TD> </ TR>

<tr valign="top"><td>pars</td> <td> A vector of length npars containing parameter values.</td></tr>
<tr valign="top"> <TD> pars </ TD> <td>一个矢量的长度硬件分区的参数值。</ TD> </ TR>

<tr valign="top"><td>fixed</td> <td> fixed is a (logical) vector of length npars specifying which parameters are fixed and which are not.</td></tr>
<tr valign="top"> <TD> fixed </ TD> <TD>fixed是一个向量的长度硬件分区(逻辑)指定的参数是固定的,哪些不是。</ TD > </ TR>

<tr valign="top"><td>A</td> <td> The matrix A contains the general linear constraints of the model.  nrow(A) is the number of linear constraints.  A starts with a number of rows for the sum constraints for the transition, observation and initial state parameters, after which the user provided constraints are added.</td></tr>
<tr valign="top"> <TD> A </ TD> <TD>矩阵A包含了一般线性模型约束的。 NROW(A)是线性约束。 A开始与数量的行的总和过渡,观察和初始状态下的参数,在这之后的用户提供的约束添加约束。</ TD> </ TR>

<tr valign="top"><td>bu,bl</td> <td> bu and bl represent the upper and lower bounds of the parameters and the constraints.  These vectors are each of length npars + nrow(A).</td></tr>
<tr valign="top"> <TD> bu,bl </ TD> <TD>不和BL的上限和下限的参数和约束。这些矢量是每个长度硬件分区+ NROW(A)。</ TD> </ TR>

<tr valign="top"><td>bllin,bulin</td> <td> The lower and upper bounds of the linear constraints.</td></tr>
<tr valign="top"> <TD>bllin,bulin</ TD> <TD>的线性约束的上限和下限。</ TD> </ TR>

<tr valign="top"><td>td,tdin,tdtr,tdob,tdfit</td> <td> Logicals indicating whehter there covariates, in which parameters they are, and whether they are estimated or not (the latter is used to decide whether to print those values or not).</td></tr>
<tr valign="top"> <TD> td,tdin,tdtr,tdob,tdfit </ TD> <TD>逻辑值表示whehter,其中有协变量参数,无论他们是估计或没有(后者来决定是否打印这些值或没有)。</ TD> </ TR>

<tr valign="top"><td>st</td> <td> Logical indicating whether the model has user specified starting values.</td></tr>
<tr valign="top"> <TD>st </ TD> <TD>逻辑模型是否具有用户指定的初始值。</ TD> </ TR>

</table> lca returns an object of class dmm, lca, and is otherwise identical to a dmm object. The only difference is that the transition matrix parameters are irrelevant, and consequently they are not printed in the summary function.
</ TABLE> lca返回一个类的对象dmm, lca,是否则一个dmm对象。唯一的区别是,过渡矩阵参数无关的,因此它们不能打印的汇总函数。


(作者)----------Author(s)----------


Ingmar Visser <a href="mailto:i.visser@uva.nl">i.visser@uva.nl</a>



参考文献----------References----------


On hidden Markov models: Lawrence R. Rabiner (1989).  A tutorial on hidden Markov models and selected applications in speech recognition. Proceedings of IEEE, 77-2, p.  267-295.
On latent class models: A. L. McCutcheon (1987).  Latent class analysis.  Sage Publications.


参见----------See Also----------

mixdmm on defining mixtures of dmm's, mgdmm for defining multi group models, and generate for generating data from models.
mixdmm上定义混合物的dmm的,mgdmm定义多组模型,generate从模型生成数据。


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



# create a 2 state model with one continuous and one binary response[创建一个状态模型与一个连续的和一个二元响应]
# with start values provided in st[在ST提供的值开始]
st <- c(1,0.9,0.1,0.2,0.8,2,1,0.7,0.3,5,2,0.2,0.8,0.5,0.5)
mod <- dmm(nsta=2,itemt=c(1,2), stval=st)
summary(mod)

# 2 class latent class model with equal conditional probabilities in each class[2级潜类模型与平等的条件概率在每个类中]
stv=c(1,rep(c(0.9,0.1),5),rep(c(0.1,0.9),5),0.5,0.5)
# here the conditional probs of the first item are set equal to those in[这里的条件probs的第一项中的那些被设置为等于]
# the subsequent items[随后的项目]
conpat=c(1,rep(c(2,3),5),rep(c(4,5),5),1,1)
lc=lca(ncl=2,itemtypes=rep(2,5),conpat=conpat,stv=stv)
summary(lc)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-13 15:46 , Processed in 0.021703 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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