unuran.verify.hat(Runuran)
unuran.verify.hat()所属R语言包:Runuran
Verify hat and squeezes in a "unuran" generator object
验证的帽子,挤在一个的“unuran”发电机对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Verify hat function and squeezes in a given unuran generator that implements a rejection method.
验证帽子的功能,挤在一个给定的unuran发生器,实现了抑制方法。
[Advanced] – Verify rejection method.
[高级] - 确认抑制方法。
用法----------Usage----------
unuran.verify.hat(unr, n=1e5, show=TRUE)
参数----------Arguments----------
参数:unr
an unuran object.
unuran对象。
参数:n
sample size. (integer)
样本大小。 (整数)
参数:show
whether the result is printed on the console. (boolean)
结果是否在控制台上打印。 (布尔)
Details
详细信息----------Details----------
UNU.RAN is a library of so called black-box algorithms. For algorithms based on the rejection method this means that hat and squeezes are created automatically during the setup. Obviously not all algorithms work for all distribution. Then usually the setup fails (which is good, since then one does not silently obtain a random sample from a distribution other then the requested.)
UNU.RAN是一个所谓的黑盒算法库。对于抑制方法的基础上的算法,这意味着这顶帽子和挤压在安装过程中自动创建的。显然,并不是所有的算法的所有通讯。然后通常安装失败(这是很好的,从那时起一个不默默地获得一个随机的样本从一个分布等,然后要求的。)
Although we have tested these algorithms with a lot of distributions (including those with extreme properties) there is still some (minor) chance that hat and squeezes are computed without any warnings, but are incorrect, i.e., the inequalities
虽然我们对这些算法进行测试,用大量的分布(包括那些与极端性能)仍然是一些没有任何警告的机会,帽子和挤压计算(未成年人),但是不正确的,也就是说,不等式
are not satisfied for all x. This might happen due to serious round-off errors for densities with extreme properties (e.g., sharp and narrow peaks). But it also might be caused by some incorrect additional information about the distribution given by the user which has not been detected by various checks during the setup. If one is unsure about his or her chosen generation method one can check these inequalities.
不感到满意为所有x。这可能会发生由于密度与的极端属性(例如,夏普公司和窄峰)严重的舍入误差。但是,这也可能会引起一些不正确的附加信息有关由用户给定的分布,没有被检测到在安装过程中的各种检查。如果一个不确定他或她所选择的生成方法可以检查这些不平等现象。
Routine unuran.verify.hat allows to run generator unr and check whether the two inequalities are violated. This is done for every point x that is sampled from the hat distribution. This includes also those points that are rejected. The function counts the occurrences of such evaluations and returns the ratio of this number and the sample size n. (It is thus a little bit too high since the total number of generated but rejected points is not known.) Yet, it does not provide any information about the magnitude of violation of the inequality.
常规unuran.verify.hat允许,运行发电机unr和是否被侵犯的两个不等式。这样做是为了每一个点x采样从帽子分布。这也包括那些被拒绝。函数计算出现这样的评价,并返回这个数,样本量的比例n。 (这是有点过高,因为总数的产生,但拒绝点不知道),但它并没有提供任何信息有关违反的不平等的幅度。
If show is TRUE then this routine prints this ratio and some diagnostcs to the console.
如果show是TRUE那么这个常规打印这比一些diagnostcs,到控制台。
Routine unuran.verify.hat does not work for algorithms that do not implement a rejection method.
常规unuran.verify.hat不算法没有实现抑制方法。
值----------Value----------
Ratio of number occurrences where the hat and squeezes violate the inequality and the sample size.
数发生的帽子和挤压违反了不平等和样本量的比率。
注意----------Note----------
Due to round-off errors there might exist a few points where the ratio density(x) / hat(x) is slightly larger than 1. In our experiments we observed a few cases where this ratio was as large as 1+1.e-8 for some points although we could proof (using real numbers instead of floating point numbers) that hat and squeeze are computed correctly.
由于舍入误差,有可能存在的比率density(x) / hat(x)是稍大于1的数点。在我们的实验中,我们观察到一些情况下,这个比例是一样大的1+1.e-8一些点的,虽然我们可以证明(使用真实的数字,而不是浮点数),帽子和挤压正确计算。
On the other hand, there are cases where, due to the limitation of floating point arithmetic, it is not possible to sample from the target distribution at all. The Gamma distribution with extremely small shape parameter, say 0.0001, is such an example. Then the continuous Gamma distribution degenerates to a point distribution with only a few points with significant mass.
另一方面,有在那里,由于浮点运算的限制,这是不可能的从目标分布,在所有采样。具有非常小的形状参数的Gamma分布,说0.0001,就是这样一个例子。然后连续Gamma分布退化为一个点的分布,只有少数点显著质量。
(作者)----------Author(s)----------
Josef Leydold and Wolfgang H\"ormann
<a href="mailto:unuran@statmath.wu.ac.at">unuran@statmath.wu.ac.at</a>.
参见----------See Also----------
unuran.
unuran。
实例----------Examples----------
## Create a generator object that implements a rejection method[#创建一个生成器对象,实现了抑制方法]
unr <- tdrd.new(udnorm())
## Verify hat and squeeze[#验证的帽子和挤压]
unuran.verify.hat(unr)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|