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

R语言 rvgtest包 rvgt.ftable()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-29 00:01:53 | 显示全部楼层 |阅读模式
rvgt.ftable(rvgtest)
rvgt.ftable()所属R语言包:rvgtest

                                        Create RVG Frequency Table for Random Variate Generator
                                         创建RVG随机变量发生器的频率表

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

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

Function for creating frequency tables for random variate generators. Thus a histogram is computed and the bin counts are stored in an array which can be used to visualize possible defects of the pseudo-random variate generator and run goodness-of-fit tests.
函数创建随机变量发生器的频率表。因此,一个直方图计算的bin计数被存储在一个阵列,它可以用于可视化的伪随机变量发生器的可能存在的缺陷,并运行善良的配合测试。

Currently the function only works for generators for continuous univariate distribution.
目前该功能只适用于连续单变量分布的发电机。


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


rvgt.ftable(n, rep=1, rdist, qdist, pdist, ...,
            breaks = 101, trunc=NULL, exactu=FALSE, plot=FALSE)



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

参数:n
sample size for one repetition.
一个重复的样本量。


参数:rep
number of repetitions.
重复的次数。


参数:rdist
random variate generator for a continuous univariate distribution.
的连续单变量分布的随机变量发生器。


参数:qdist
quantile function for the distribution.
位数的函数的分布。


参数:pdist
cumulative distribution function for distribution.
累积分布函数的分布。


参数:...
parameters to be passed to rdist, qdist and pdist.
来传递参数rdist,qdist和pdist。


参数:breaks
one of:  
之一:

a single number giving the number of cells of histogram; or
一个单一的数字给直方图的单元的数目;

a vector giving the breakpoints between histogram cells (in uniform scale). Notice that in the latter case the break points are automatically sorted and the first and last entry is set to 0 and 1, resp. Moreover, they must be different from each other.
一个向量给直方图单元之间的断点,在统一的尺度。请注意,在后者的情况下,在中断点自动排序的第一个和最后一个条目被设置为0和1,分别。此外,它们必须是彼此不同的。


参数:trunc
boundaries of truncated domain. (optional)
截断域的边界。 (可选)


参数:exactu
logical. If TRUE then the exact locations of the given break points are used. Otherwise, these points are slightly shifted in order to accelerate exection time, see details below.
逻辑。如果TRUE然后被用来破发点的确切位置。否则,这些点轻微移动,以加快exection时间,详情如下。


参数:plot
logical. If TRUE, a histogram is plotted.
逻辑。如果TRUE,绘制的直方图。


Details

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

rvgt.ftable returns tables of bin counts similar to the hist function. Bins can be either specified my the number of break points between the cells of the histogram, or by a list of break points in the u-scale. In the former case the break points are constructed such that all bins of the histogram have equal probability for the distribution under the null hypothesis, i.e., the break points are equidistributed in the u-scale using the formula u_i=i/(breaks-1) where i=0,…,breaks-1.
rvgt.ftable返回表的bin计数类似hist功能。回收箱既可以指定我的断线点的数量的直方图之间的单元,或由一个在u规模的断线点列表。在前者的情况下,在中断点被构造,使得所有的直方图箱的零假设下的分布,即具有相等的概率,的中断点equidistributed在u规模使用式u_i=i/(breaks-1) i=0,…,breaks-1。

When the quantile function qdist is given, then these points are transformed into breaking points in the x-scale using qdist(u_i). Thus the histogram can be computed directly for random points X that are generated by means of rdist.
当位数功能qdist,然后将这些点转换成突破点在使用的x“qdist(u_i)规模。因此直方图可以直接用于计算随机点X生成通过rdist。

Otherwise the cumulative distribution function pdist must be given. If exactu is TRUE, then all non-uniform random points X are first transformed into uniformly distributed random numbers U=pdist(X) for which the histogram is created. This is slower than directly using X but it is numerically more robust as round-off error in qdist have much more influence than those in pdist.
否则的累积分布函数pdist必须提供。如果exactu是TRUE,然后所有非均匀分布的随机点X首先转化为均匀分布的随机数U=“pdist”(X)这创建直方图。这是比直接使用X慢,但它在数值上更强大的舍入误差在qdist有更大的影响力比在pdist。

If trunc is given, then functions qdist and pdist are rescaled to this given domain. It is recommended to provide pdist even when qdist is given.
trunc如果,然后功能qdist和pdist重新调整到这个特定的域。建议提供pdist,甚至当qdist。

If exactu is FALSE and the quantile function qdist is missing, then the first sample of size n is used to estimate the quantiles for the given break points using function quantile. The break points in u-scale are then recomputed using these quantiles by means of the given probability function pdist. This is usually (much) faster than calling pdist on each generated point. However, the break points are slightly perturbated (but this does not effect the correctness of the frequency table).
exactu如果是FALSE和分位数函数qdist丢失,那么第一个样本的大小n使用给定的破发点估计位数的功能 X>。在quantile规模的中断点,然后重新计算使用这些分位数,通过给定的概率函数u。这通常是(多)的速度比调用pdist生成的每个点上。然而,断裂点稍微在Δt(但是这并不影响的频数分布表的正确性)。

The argument rep allows to create multiple such arrays of bin counts and store these in one table. Thus has two advantages:  
参数rep允许创建多个这样的bin计数阵列和存储在一个表中。这样有两个好处:

It allows for huge total sample sizes that would otherwise exceed the available memory, and
它允许庞大的总样本量,否则将超过可用的记忆体,

it can be used to visualize test results for increasing sample sizes, or
它可以用于可视化增加样本大小的测试结果,或

allows for a two-level test. </ul>
允许两个级别的测试。 </ ul>


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

An object of class "rvgt.ftable" which is a list with components:
类的一个对象"rvgt.ftable"这是一个组件列表:

<table summary="R valueblock"> <tr valign="top"><td>n</td> <td> sample size.</td></tr> <tr valign="top"><td>rep</td> <td> number of repetitions.</td></tr> <tr valign="top"><td>ubreaks</td> <td> an array of break points in u-scale.</td></tr> <tr valign="top"><td>xbreaks</td> <td> an array of break points in x-scale.</td></tr> <tr valign="top"><td>count</td> <td> a matrix of rep rows and (breaks-1) columns that contains the bin counts. The results for each repetition are stored row wise.</td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD> n</ TD> <TD>样本量。</ TD> </ TR> <TR VALIGN =“顶” > <TD> rep </ TD> <TD>的重复次数。</ TD> </ TR> <tr valign="top"> <TD>ubreaks </ TD> <TD一个破发点,u规模。</ TD> </ TR> <tr valign="top"> <TD>xbreaks </ TD> <TD>数组的截断阵列点x规模。</ TD> </ TR> <tr valign="top"> <TD>count</ TD> <td>一个矩阵rep行(breaks“-1)列包含bin计数。结果每次重复存储行明智的。</ TD> </ TR> </表>


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

It is important that all given functions &ndash; rdist, qdist, and pdist &ndash; accept the same arguments passed to rvgt.ftable via ....
重要的是所有给定函数 - rdist,qdist和pdist  - 接受相同的参数传递给rvgt.ftable通过...。


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



Sougata Chaudhuri <a href="mailto:sgtchaudhuri@gmail.com">sgtchaudhuri@gmail.com</a>,
Josef Leydold <a href="mailto:josef.leydold@wu.ac.at">josef.leydold@wu.ac.at</a>




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

W. H\"ormann, J. Leydold, and G. Derflinger (2004): Automatic Nonuniform Random Variate Generation. Springer-Verlag, Berlin Heidelberg

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

See plot.rvgt.ftable for the syntax of the plotting method.
见plot.rvgt.ftable的语法作图法。


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


## Create a frequency table for normal distribution with mean 1 and[#创建一个频率表正态分布,均值为1,]
## standard deviation 2. Number of bins should be 50.[#标准差为2。箱数应为50。]
## Use a sample of size of 5 times 10^5 random variates.[#使用的样本尺寸的5倍,10 ^ 5个随机变数。]
ft <- rvgt.ftable(n=1e5,rep=5, rdist=rnorm,qdist=qnorm, breaks=51, mean=1,sd=2)

## Show histogram[#显示直方图]
plot(ft)

## Run a chi-square test[#执行卡方检验]
rvgt.chisq(ft)

## The following allows to plot a histgram in a single call.[#下面的允许,到绘制一个histgram,在一个单一的通话。]
rvgt.ftable(n=1e5,rep=5, rdist=rnorm,qdist=qnorm, plot=TRUE)

## Use the cumulative distribution function when the quantile function[#使用时的累积分布函数的分位数函数]
## is not available or if its round-off errors have serious impact.[#不可用,或者如果它的舍入误差造成严重的影响。]
ft <- rvgt.ftable(n=1e5,rep=5, rdist=rnorm,pdist=pnorm )
plot(ft)

## Create a frequency table for the normal distribution with[#创建一个频率的正态分布表]
## non-equidistributed break points[#的非equidistributed截断点]
ft <- rvgt.ftable(n=1e5,rep=5, rdist=rnorm,qdist=qnorm, breaks=1/(1:100))
plot(ft)

## A (naive) generator for a truncated normal distribution[#A(天真的)发电机的截断正态分布]
rdist <- function(n) {
  x <- numeric(n)
  for (i in 1:n){ while(TRUE){ x[i] <- rnorm(1); if (x[i]>1) break} }
  return(x)
}
ft <- rvgt.ftable(n=1e3,rep=5, rdist=rdist,
                  pdist=pnorm, qdist=qnorm, trunc=c(1,Inf))
plot(ft)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-28 13:53 , Processed in 0.023005 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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