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

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

[复制链接]
发表于 2012-10-1 10:48:25 | 显示全部楼层 |阅读模式
rtmvt(tmvtnorm)
rtmvt()所属R语言包:tmvtnorm

                                        Sampling Random Numbers From The Truncated Multivariate Student t Distribution
                                         取样的随机数被截断的多元学生t分布

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

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

This function generates random numbers from the truncated multivariate Student-t distribution with mean equal to mean and covariance matrix sigma, lower and upper truncation points lower and upper with either rejection sampling or Gibbs sampling.
这个函数生成的随机数截断多元学生t分布,平均等于mean和协方差矩阵sigma,上限和下限截断点lower和upper要么拒绝采样或Gibbs采样。


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


rtmvt(n, mean = rep(0, nrow(sigma)), sigma = diag(length(mean)), df = 1,
  lower = rep(-Inf, length = length(mean)),
  upper = rep(Inf, length = length(mean)),
  algorithm=c("rejection", "gibbs"), ...)



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

参数:n
Number of random points to be sampled. Must be an integer >= 1.
以被采样的随机点数目。必须是一个整数> = 1。


参数:mean
Mean vector, default is rep(0, length = ncol(x)).
均值向量,默认是:rep(0, length = ncol(x))。


参数:sigma
Covariance matrix, default is diag(ncol(x)).
协方差矩阵,默认是diag(ncol(x))。


参数:df
Degrees of freedom parameter
度的自由参数


参数:lower
Vector of lower truncation points,\  default is rep(-Inf, length = length(mean)).
矢量较低的截断点,\默认是rep(-Inf, length = length(mean))。


参数:upper
Vector of upper truncation points,\  default is rep( Inf, length = length(mean)).
向量上的截断点,\默认是rep( Inf, length = length(mean))。


参数:algorithm
Method used, possible methods are rejection sampling ("rejection", default) and  the R Gibbs sampler ("gibbs").      
使用的方法,可能的方法是拒绝抽样(“拒绝”,默认)和R的Gibbs抽样(“吉布斯”)。


参数:...
additional parameters for Gibbs sampling, given to the internal method rtmvt.gibbs(),  such as burn.in.samples, start.value and thinning, see details      
Gibbs抽样的额外的参数,给rtmvt.gibbs(),如burn.in.samples,start.value和thinning,看到的内部方法


Details

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

We sample x ~ T(mean, Sigma, df) subject to the rectangular truncation lower <= x <= upper. Currently, two random number generation methods are implemented: rejection sampling and the Gibbs Sampler.
我们样品x ~ T(mean, Sigma, df)的矩形截断lower <= x <= upper。目前,两个随机数生成方法实现:拒绝抽样和Gibbs采样。

The arguments to be passed along with algorithm="gibbs" are:
的参数一起传递algorithm="gibbs":




burn.in.samples number of samples in Gibbs sampling to be discarded as burn-in phase, must be non-negative.
burn.in.samples数目的样本的吉布斯采样被丢弃的燃烧阶段,必须为非负数。




start.value Start value (vector of length length(mean)) for the MCMC chain. If one is specified, it must lie inside the support region (lower <= start.value <= upper). If none is specified,  the start value is taken componentwise as the finite lower or upper boundaries respectively,
start.value开始值(向量的长度length(mean))MCMC链。如果一个人被指定,它必须位于支撑区域内(lower <= start.value <= upper)。如果没有指定,开始值分别为有限或上,下边界的分支,




thinning Thinning factor for reducing autocorrelation of random points in Gibbs sampling. Must be an integer >= 1.  We create a Markov chain of length (n*thinning) and take only those samples j=1n*thinning) where j %% thinning == 0  
thinning稀化因子减少Gibbs抽样的随机点的自相关。必须是一个整数>= 1。我们创建了一个马尔可夫链的长度(n*thinning),只需要这些样本j=1n*thinning)j %% thinning == 0


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

The same warnings for the Gibbs sampler apply as for the method rtmvnorm.
Gibbs抽样的方法rtmvnorm适用于同样的警告。


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


Stefan Wilhelm &lt;Stefan.Wilhelm@financial.com&gt;, Manjunath B G &lt;bgmanjunath@gmail.com&gt;



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

Subject to Linear Constraints. Computer Science and Statistics. Proceedings of the 23rd Symposium on the Interface. Seattle Washington, April 21-24, 1991, pp. 571&ndash;578 An earlier version of this paper is available at http://www.biz.uiowa.edu/faculty/jgeweke/papers/paper47/paper47.pdf

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


###########################################################[################################################## ########]
#[]
# Example 1[例1]
#[]
###########################################################        [################################################## ########]

# Draw from multi-t distribution without truncation[绘制多t分布不截断]
X1 <- rtmvt(n=10000, mean=rep(0, 2), df=2)
X2 <- rtmvt(n=10000, mean=rep(0, 2), df=2, lower=c(-1,-1), upper=c(1,1))

###########################################################[################################################## ########]
#[]
# Example 2[例2]
#[]
###########################################################        [################################################## ########]

df = 2
mu = c(1,1,1)
sigma = matrix(c(  1, 0.5, 0.5,
                 0.5,   1, 0.5,
                 0.5, 0.5,   1), 3, 3)
lower = c(-2,-2,-2)
upper = c(2, 2, 2)

# Rejection sampling[拒绝抽样]
X1 <- rtmvt(n=10000, mu, sigma, df, lower, upper)

# Gibbs sampling without thinning[Gibbs抽样没有细化]
X2 <- rtmvt(n=10000, mu, sigma, df, lower, upper,
  algorithm="gibbs")

# Gibbs sampling with thinning[Gibbs抽样稀疏]
X3 <- rtmvt(n=10000, mu, sigma, df, lower, upper,
  algorithm="gibbs", thinning=2)       
   
plot(density(X1[,1], from=lower[1], to=upper[1]), col="red", lwd=2,
  main="Gibbs vs. Rejection")
lines(density(X2[,1], from=lower[1], to=upper[1]), col="blue", lwd=2)
legend("topleft",legend=c("Rejection Sampling","Gibbs Sampling"),
  col=c("red","blue"), lwd=2)

acf(X1)  # no autocorrelation in Rejection sampling[没有在拒绝抽样的自相关]
acf(X2)  # strong autocorrelation of Gibbs samples[强自相关的Gibbs样本]
acf(X3)  # reduced autocorrelation of Gibbs samples after thinning        [细化后的自相关性降低吉布斯样品]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-18 19:10 , Processed in 0.024669 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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