加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

R语言-jitter函数说明

(2014-08-03 16:23:06)
分类: 【R语言】
jitter(base)
jitter()所属R语言包:base

                                        ‘Jitter’ (Add Noise) to Numbers
                                         “抖动”(添加杂色)数

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

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

Add a small amount of noise to a numeric vector.
添加少量的噪音数字向量。


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


jitter(x, factor=1, amount = NULL)



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

参数:x
numeric vector to which jitter should be added. 
数字矢量抖动应增加。


参数:factor
numeric  
数字


参数:amount
numeric; if positive, used as amount (see below), otherwise, if = 0 the default is factor * z/50.  Default (NULL): factor * d/5 where d is about the smallest difference between x values. 
数字如为正数,用来作为量(见下文),否则,如果= 0默认factor * z/50。默认(NULL)factor * d/5其中dx值之间的差异最小。


Details

详情----------Details----------

The result, say r, is r <- x + runif(n, -a, a) where n <- length(x) and a is the amount argument (if specified).
结果,说r,r <- x + runif(n, -a, a)其中n <- length(x)和aamount参数(如果指定)。

Let z <- max(x) - min(x) (assuming the usual case). The amount a to be added is either provided as positive argument amount or otherwise computed from z, as follows:
让z <- max(x) - min(x)(假设通常情况下)。 金额a要添加可以提供积极的说法amount或z另有计算,具体如下:

If amount == 0, we set a <- factor * z/50 (same as S).
如果amount == 0,我们设置a <- factor * z/50(同为S)。

If amount is NULL (default), we set a <- factor * d/5 where d is the smallest difference between adjacent unique (apart from fuzz) x values.
如果amount是NULL(默认),我们将a <- factor * d/5,其中d是相邻独特的(除了从模糊)x值之间的差异最小。


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

jitter(x,...) returns a numeric of the same length as x, but with an amount of noise added in order to break ties. 
jitter(x,...)返回一个相同的长度的x,但是有一个补充,以打破关系的噪声amount的数字。


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


Werner Stahel and Martin Maechler, ETH Zurich



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

Graphical Methods for Data Analysis. Wadsworth; figures 2.8, 4.22, 5.4.
Statistical Models in S. Wadsworth & Brooks/Cole.

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

rug which you may want to combine with jitter.
rug你可能想用jitter结合。


举例----------Examples----------


round(jitter(c(rep(1,3),  rep(1.2, 4), rep(3,3))), 3)
## These two 'fail' with S-plus 3.x:[#这两个失败,S-PLUS 3.x的:]
jitter(rep(0, 7))
jitter(rep(10000,5))

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

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有