smoothEnds(stats)
smoothEnds()所属R语言包:stats
End Points Smoothing (for Running Medians)
终点平滑(运行中位数)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Smooth end points of a vector y using subsequently smaller medians and Tukey's end point rule at the very end. (of odd span),
矢量y随后较小的中位数和Tukey的终点规则,在最后顺利结束点。 (奇数跨度)
用法----------Usage----------
smoothEnds(y, k = 3)
参数----------Arguments----------
参数:y
dependent variable to be smoothed (vector).
平滑因变量(向量)。
参数:k
width of largest median window; must be odd.
最大的中位数窗口的宽度;必须是奇数。
Details
详情----------Details----------
smoothEnds is used to only do the "end point smoothing", i.e., change at most the observations closer to the beginning/end than half the window k. The first and last value are computed using Tukey's end point rule, i.e., sm[1] = median(y[1], sm[2], 3*sm[2] - 2*sm[3]).
smoothEnds只做终点平滑“,即改变大多数意见超过一半的窗口k接近的开始/结束。第一个和最后一个值计算使用终点Tukey的规则,即sm[1] = median(y[1], sm[2], 3*sm[2] - 2*sm[3])。
值----------Value----------
vector of smoothed values, the same length as y.
矢量平滑值,为y的长度相同。
作者(S)----------Author(s)----------
Martin Maechler
参考文献----------References----------
Exploratory Data Analysis, Addison.
ABC of EDA (Applications, Basics, and Computing of Exploratory Data Analysis); Duxbury.
参见----------See Also----------
runmed(*, endrule = "median") which calls smoothEnds().
runmed(*, endrule = "median")要求smoothEnds()。
举例----------Examples----------
require(graphics)
y <- ys <- (-20:20)^2
y [c(1,10,21,41)] <- c(100, 30, 400, 470)
s7k <- runmed(y,7, endrule = "keep")
s7. <- runmed(y,7, endrule = "const")
s7m <- runmed(y,7)
col3 <- c("midnightblue","blue","steelblue")
plot(y, main = "Running Medians -- runmed(*, k=7, end.rule = X)")
lines(ys, col = "light gray")
matlines(cbind(s7k,s7.,s7m), lwd= 1.5, lty = 1, col = col3)
legend(1,470, paste("endrule",c("keep","constant","median"),sep=" = "),
col = col3, lwd = 1.5, lty = 1)
stopifnot(identical(s7m, smoothEnds(s7k, 7)))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|