huberM(robustbase)
huberM()所属R语言包:robustbase
Safe (generalized) Huber M-Estimator of Location
安全(广义)的胡贝尔M-估计的位置
译者:生物统计家园网 机器人LoveR
描述----------Description----------
(Generalized) Huber M-estimator of location with MAD scale, being sensible also when the scale is zero where huber() returns an error.
(广义)胡贝尔M-估计的与MAD规模,采取明智的态度也时的规模是零huber()返回一个错误的位置。
用法----------Usage----------
huberM(x, k = 1.5, weights = NULL, tol = 1e-06,
mu = if(is.null(weights)) median(x) else wgt.himedian(x, weights),
s = if(is.null(weights)) mad(x, center=mu)
else wgt.himedian(abs(x - mu), weights),
se = FALSE,
warn0scale = getOption("verbose"))
参数----------Arguments----------
参数:x
numeric vector.
数字矢量。
参数:k
positive factor; the algorithm winsorizes at k standard deviations.
积极因素;的算法winsorizes在k标准偏差。
参数:weights
numeric vector of non-negative weights of same length as x, or NULL.
数字的非负权重向量的长度相同,x或NULL。
参数:tol
convergence tolerance.
收敛公差。
参数:mu
initial location estimator.
初始位置估计。
参数:s
scale estimator held constant through the iterations.
通过迭代的规模估计保持不变。
参数:se
logical indicating if the standard error should be computed and returned (as SE component). Currently only available when weights is NULL.
逻辑的标准误差是否应该被计算并返回(SE组件)。目前只适用weights是NULL。
参数:warn0scale
logical; if true, and s is 0 and length(x) > 1, this will be warned about.
逻辑,如果情况属实,并s是0和length(x) > 1,这将警告。
Details
详细信息----------Details----------
Note that currently, when non-NULL weights are specified, the default for initial location mu and scale s is wgt.himedian, where strictly speaking a weighted “non-hi” median should be used for consistency. Since s is not updated, the results slightly differ, see the examples below.
请注意,目前,在非NULLweights指定,默认的初始位置mu和规模s是wgt.himedian,严格来说,加权“应用于一致性;非喜“位数。因为s不更新,结果略有不同,请参见下面的例子。
When se = TRUE, the standard error is computed using the τ correction factor but no finite sample correction.
当se = TRUE,标准误差计算使用τ校正因素,但没有有限样本校正。
值----------Value----------
list of location and scale parameters, and number of iterations used.
列表位置与刻度参数,和使用的迭代数。
参数:mu
location estimate
位置估计
参数:s
the s argument, typically the mad.
s的说法,通常是mad。
参数:it
the number of “Huber iterations” used.
“胡伯迭代”的数目。
(作者)----------Author(s)----------
Martin Maechler, building on the MASS code mentioned.
参考文献----------References----------
Robust Statistics. Wiley.
参见----------See Also----------
hubers (and huber) in package MASS; mad.
hubers(huber)在包MASSmad。
实例----------Examples----------
huberM(c(1:9, 1000))
mad (c(1:9, 1000))
mad (rep(9, 100))
huberM(rep(9, 100))
## When you have "binned" aka replicated observations:[#当你有“分级”又名复制的观察:]
set.seed(7)
x <- c(round(rnorm(1000),1), round(rnorm(50, m=10, sd = 10)))
t.x <- table(x) # -> unique values and multiplicities[ - >独特的价值和多样性]
x.uniq <- as.numeric(names(t.x)) ## == sort(unique(x))[#==排序(独特的(X))]
x.mult <- unname(t.x)
str(Hx <- huberM(x.uniq, weights = x.mult), digits = 7)
str(Hx. <- huberM(x, s = Hx$s, se=TRUE), digits = 7) ## should be ~= Hx[#~= HX]
stopifnot(all.equal(Hx[-4], Hx.[-4]))
str(Hx2 <- huberM(x, se=TRUE), digits = 7)## somewhat different, since 's' differs[#有些不同的,因为“S”不同]
## Confirm correctness of std.error :[#确认正确性std.error:。]
system.time(
SS <- replicate(10000, vapply(huberM(rnorm(400), se=TRUE), as.double, 1.))
) # ~ 12.2 seconds[~12.2秒]
rbind(mean(SS["SE",]), sd(SS["mu",]))# both ~ 0.0508[既~0.0508]
stopifnot(all.equal(mean(SS["SE",]),
sd ( SS["mu",]), tol= 0.002))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|