madmad(wavethresh)
madmad()所属R语言包:wavethresh
Compute square of median absolute deviation (mad) function.
计算平均绝对偏差(MAD)函数的平方。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function simply returns the square of the median absolute deviation (mad) function in S-Plus. This is required for supply to the threshold series of functions which require estimates of spread on the variance scale (not the standard deviation scale).
这个函数简单的返回的平均绝对偏差(MAD)的功能在S-PLUS的平方。这是必需的供应threshold一系列需要估计的传播上的方差规模(不标准偏差规模)的函数。
用法----------Usage----------
madmad(x)
参数----------Arguments----------
参数:x
The vector for which you wish to compute the square of mad on.
向量为您要计算正方形的疯狂上。
值----------Value----------
The square of the median absolute deviation of the coefficients supplied by x.
提供x系数的平均绝对偏差的平方。
RELEASE----------RELEASE----------
Version 3.4.1 Copyright Guy Nason 1994
版本3.4.1版权盖利晨1994年
注意----------Note----------
Its a MAD MAD world!
它是一种逼人!
(作者)----------Author(s)----------
G P Nason
参见----------See Also----------
threshold
threshold
实例----------Examples----------
#[]
#[]
# Generate some normal data with mean 0 and sd of 8[产生一些正常的数据均值为0,标准差8]
# and we'll also contaminate it with an outlier of 1000000[我们也将污染离群1000000]
# This is akin to signal wavelet coefficients mixing with the noise.[这是类似于信号与噪声混合的小波系数。]
#[]
ContamNormalData <- c(1000000, rnorm(1000, mean=0, sd=8))
#[]
# What is the variance of the data?[的数据的方差是什么?]
#[]
var(ContamNormalData)
# [1] 999000792[[1] 999000792]
#[]
# Wow, a seriously unrobust answer![哇,认真unrobust的答案!]
#[]
# How about the median absolute deviation?[平均绝对偏差怎么样?]
#[]
mad(ContamNormalData)
# [1] 8.14832[[1] 8.14832]
# []
# A much better answer![一个更好的答案!]
#[]
# Now let's use madmad to get the answer on the variance scale [现在,让我们的使用madmad的得到答案的方差规模]
#[]
madmad(ContamNormalData)
# [1] 66.39512[[1] 66.39512]
#[]
# The true variance was 64, so the 66.39512 was a much better answer[真正的差异是64,所以66.39512是一个更好的答案]
# than that returned by the call to the variance function.[比方差函数调用返回的。]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|