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

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

[复制链接]
发表于 2012-10-1 15:44:32 | 显示全部楼层 |阅读模式
mix2normal1(VGAM)
mix2normal1()所属R语言包:VGAM

                                         Mixture of Two Univariate Normal Distributions
                                         混合两个单变量的正态分布

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

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

Estimates the five parameters of a mixture of two univariate  normal distributions by maximum likelihood estimation.
估计参数的混合物的两个单变量的正态分布的最大似然估计。


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


mix2normal1(lphi = "logit", lmu = "identity", lsd = "loge",
            ephi = list(), emu1 = list(), emu2 = list(),
            esd1 = list(), esd2 = list(),
            iphi = 0.5, imu1 = NULL, imu2 = NULL, isd1 = NULL, isd2 = NULL,
            qmu = c(0.2, 0.8), equalsd = TRUE, nsimEIM = 100, zero = 1)



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

参数:lphi,lmu,lsd
Link functions for the parameters phi, mu, and sd. See Links for more choices.  
链接功能的参数phi,mu和sd。见Links更多的选择。


参数:ephi, emu1, emu2, esd1, esd2
List. Extra argument for each of the links. See earg in Links for general information. If equalsd = TRUE then esd1 must equal esd2.  
列表。每个环节的额外参数。见earg中Links的一般信息。如果equalsd = TRUE然后esd1等于esd2。


参数:iphi
Initial value for phi, whose value must lie between 0 and 1.  
的phi,其值必须介于0和1的初始值。


参数:imu1, imu2
Optional initial value for mu1 and mu2. The default is to compute initial values internally using the argument qmu.  
可选初始值mu1和mu2。默认值是计算的初始值内部使用参数qmu的。


参数:isd1, isd2
Optional initial value for sd1 and sd2. The default is to compute initial values internally based on the argument qmu. Currently these are not great, therefore using these arguments  where practical is a good idea.  
可选初始值sd1和sd2。默认值是内部基于参数qmu来计算的初始值。目前,这些都不是很大,因此,在可行的情况下使用这些参数是一个好主意。


参数:qmu
Vector with two values giving the probabilities relating to the sample quantiles for obtaining initial values for mu1 and mu2. The two values are fed in as the probs argument into quantile.  
向量的两个值,给出了有关的样本位数的概率获得的初始值mu1和mu2。这两个值被送入作为probs到quantile参数。


参数:equalsd
Logical indicating whether the two standard deviations should be  constrained to be equal. If TRUE then the appropriate constraint matrices will be used.  
逻辑表示的两个标准偏差是否应约束为相等。如果TRUE然后,将被使用的适当的约束矩阵。


参数:nsimEIM
See CommonVGAMffArguments.  
见CommonVGAMffArguments。


参数:zero
An integer specifying which linear/additive predictor is modelled as intercepts only.  If given, the value or values must be from the set 1,2,...,5.  The default is the first one only, meaning phi is a single parameter even when there are explanatory variables. Set zero = NULL to model all linear/additive predictors as functions of the explanatory variables. See CommonVGAMffArguments for more information.  
一个整数,指定,其中线性/添加剂的预测中拦截只为蓝本。如果给定的值或值必须是从集合1,2,...,5。默认是第一位的,这意味着phi是一个单独的参数,即使有解释变量。设置zero = NULL所有线性/添加剂的预测解释变量的函数模型。见CommonVGAMffArguments更多信息。


Details

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

The probability density function can be loosely written as
的概率密度函数可以松散地写为

where phi is the probability an observation belongs to the first group. The parameters mu1 and mu2 are the means, and  sd1 and sd2 are the standard deviations. The parameter phi satisfies 0 < phi < 1. The mean of Y is phi*mu1 + (1-phi)*mu2 and this is returned as the fitted values. By default, the five linear/additive predictors are         (logit(phi),   mu1,   log(sd1), mu2, log(sd2))^T. If equalsd = TRUE then sd1=sd2 is enforced.
其中phi是观察属于第一组的概率。的参数mu1和mu2是手段,和sd1和sd2是标准差。参数phi满足0 < phi < 1。平均Y是phi*mu1 + (1-phi)*mu2,这是返回的拟合值。默认情况下,线性/添加剂的预测是        (logit(phi),   mu1,   log(sd1), mu2, log(sd2))^T。如果equalsd = TRUE然后sd1=sd2强制执行。


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

An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.
类的一个对象"vglmff"(见vglmff-class)。该对象被用于建模功能,如vglm,vgam。


警告----------Warning ----------

Numerical problems can occur and half-stepping is not uncommon. If failure to converge occurs, try inputting better initial values, e.g., by using iphi, qmu, imu1, imu2, isd1, isd2, etc.
数值可能会发生问题,并半步的情况并不少见。如果收敛失败时,尝试更好的初始值,例如,输入使用iphi,qmu,imu1,imu2,isd1,isd2, ,等。

This VGAM family function should be used with care.
这VGAM家庭功能应小心使用。


注意----------Note----------

Fitting this model successfully to data can be difficult due to numerical problems and ill-conditioned data.  It pays to fit the model several times with different initial values and check that the best fit looks reasonable. Plotting the results is recommended. This function works better as mu1 and mu2 become more different.
这个模型成功的拟合数据可以是困难的,因为数值计算问题和病态的数据。它支付的模式,以适应不同的初始值和多次检查最合适看起来合理。建议绘制的结果。此功能更好地为mu1和mu2变得更加不同。

Convergence can be slow, especially when the two component distributions are not well separated. The default control argument trace = TRUE is to encourage monitoring convergence. Having equalsd = TRUE often makes the overall optimization problem easier.
收敛可以是缓慢的,尤其是当两个组件分布没有得到很好的分离。默认的控制参数trace = TRUE是鼓励开展监督收敛。在equalsd = TRUE,往往使整体优化的问题更容易。


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


T. W. Yee



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

Finite Mixture Models. New York: Wiley.
Finite Mixture Distributions. London: Chapman &amp; Hall.

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

normal1, Normal, mix2poisson.
normal1,Normal,mix2poisson。


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


mu1 =  99; mu2 = 150; nn = 1000
sd1 = sd2 = exp(3)
(phi = logit(-1, inverse = TRUE))
mdata = data.frame(y = ifelse(runif(nn) < phi, rnorm(nn, mu1, sd1),
                                               rnorm(nn, mu2, sd2)))
fit = vglm(y ~ 1, mix2normal1(equalsd = TRUE), mdata)

# Compare the results[比较结果]
cfit = coef(fit)
round(rbind('Estimated' = c(logit(cfit[1], inverse = TRUE),
    cfit[2], exp(cfit[3]), cfit[4]), 'Truth' = c(phi, mu1, sd1, mu2)), dig = 2)

## Not run: # Plot the results[#不运行:#图的结果]
xx = with(mdata, seq(min(y), max(y), len = 200))
plot(xx, (1-phi)*dnorm(xx, mu2, sd2), type = "l", xlab = "y",
     main = "Orange=estimate, blue=truth", col = "blue", ylab = "Density")
phi.est = logit(coef(fit)[1], inverse = TRUE)
sd.est = exp(coef(fit)[3])
lines(xx, phi*dnorm(xx, mu1, sd1), col = "blue")
lines(xx, phi.est * dnorm(xx, Coef(fit)[2], sd.est), col = "orange")
lines(xx, (1-phi.est) * dnorm(xx, Coef(fit)[4], sd.est), col = "orange")
abline(v = Coef(fit)[c(2,4)], lty = 2, col = "orange")
abline(v = c(mu1, mu2), lty = 2, col = "blue")
## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 16:45 , Processed in 0.043714 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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