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

R语言 wavethresh包 threshold.wd()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 20:13:20 | 显示全部楼层 |阅读模式
threshold.wd(wavethresh)
threshold.wd()所属R语言包:wavethresh

                                        Threshold (DWT) wavelet decomposition object
                                         阈值(DWT)的小波分解对象

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

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

This function provides various ways to threshold a wd class object.
此功能提供了多种阈值一个wd类对象。


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


## S3 method for class 'wd':
threshold(wd, levels = 3nlevels(wd) - 1), type = "soft", policy = "sure",
        by.level = FALSE, value = 0, dev = madmad, boundary = FALSE, verbose = FALSE,
        return.threshold = FALSE, force.sure = FALSE, cvtol = 0.01, Q = 0.05, OP1alpha = 0.05,
        alpha = 0.5, beta = 1, C1 = NA, C2 = NA, C1.start = 100, ...)



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

参数:wd
The DWT wavelet decomposition object that you wish to threshold.
DWT小波分解的对象,你想阈值。


参数:levels
a vector of integers which determines which scale levels are thresholded in the decomposition. Each integer in the vector must refer to a valid level in the wd object supplied. This is usually any integer from 0 to nlevels(wd)-1 inclusive. Only the levels in this vector contribute to the computation of the threshold and its application.
决定哪些规模水平的阈值分解的向量整数。向量中的每个整数必须在wd对象提供一个有效的水平。这通常是从0到nlevels(WD)-1包容性的任一整数。只有在此向量的水平作出贡献的阈值的计算及其应用。


参数:type
determines the type of thresholding this can be "hard" or "soft".
确定的阈值,这可以是“硬”或“软”的类型。


参数:policy
selects the technique by which the threshold value is selected. Each policy corresponds to a method in the literature. At present the different policies are: "universal", "LSuniversal", "sure", "BayesThresh", "cv", "fdr", "op1", "op2", "manual", "mannum" and "probability". The policies are described in detail below.
选择被选择的阈值的技术,通过该技术。每个策略对应的方法在文献中。目前,不同的政策是:“universal”,“LSuniversal”,“sure”,“BayesThresh”,“cv”,“<所述“,”fdr“,”op1“,”op2“,”manual“和”mannum“。在下面详细描述的政策。


参数:by.level
If FALSE then a global threshold is computed on and applied to all scale levels defined in levels. If TRUE a threshold is computed and applied separately to each scale level.
如果为FALSE,那么一个全球性的阈值计算,并适用于所有等级的定义在levels。如果真正的阈值计算,并分别应用到每一个规模水平。


参数:value
This argument conveys the user supplied threshold. If the policy="manual" then value is the actual threshold value; if the policy="mannum" then value conveys the total number of ordered coefficients kept (from the largest); if policy="probability" then value conveys the the user supplied quantile level.
这个参数传递的用户提供的阈值。如果policy="manual"然后value是实际的阈值;如果policy="mannum"然后value传达保持(从最大的)排列的系数的总数;如果<X >policy="probability"传达用户提供的位数水平。


参数:dev
this argument supplies the function to be used to compute the spread of the absolute values coefficients. The function supplied must return a value of spread on the variance scale (i.e. not standard deviation) such as the var() function. A popular, useful and robust alternative is the madmad function.
此参数提供的功能被用于计算的绝对值的系数的传播。提供的函数必须返回一个值传播的方差比例(即不标准差),如var()功能。一个流行的,有用的和强大的另一种方法是madmad功能。


参数:boundary
If this argument is TRUE then the boundary bookeeping values are included for thresholding, otherwise they are not.
如果该参数为TRUE,则的边界bookeeping值阈值,否则他们都没有。


参数:verbose
if TRUE then the function prints out informative messages as it progresses.
如果真,那么该函数打印出的信息性消息,因为它的进展。


参数:return.threshold
If this option is TRUE then the actual value of the threshold is returned. If this option is FALSE then a thresholded version of the input is returned.
如果该选项是TRUE,则该阈值的实际值被返回。如果此选项为FALSE,则返回一个版本的输入阈值。


参数:force.sure
If TRUE then the sure threshold is computed on a vector even when that vector is very sparse. If FALSE then the normal SUREshrink procedure is followed whereby the universal threshold is used for sparse vectors of coefficients.
如果为真,那么sure阈值的向量计算,即使该向量是非常稀少的。如果为FALSE,然后正常SUREshrink程序从而使通用的阈值,其次是用于稀疏系数向量。


参数:cvtol
Parameter for the cross-validation "cv" policy.
参数的交叉验证"cv"政策。


参数:Q
Parameter for the false discovery rate "fdr" policy.
参数的虚假发现率"fdr"政策。


参数:OP1alpha
Parameter for Ogden and Parzen's first "op1" and "op2" policies.
参数Ogden和Parzen窗的第一个“op1”和"op2"的政策。


参数:alpha
Parameter for BayesThresh "BayesThresh" policy.
参数为BayesThresh"BayesThresh"政策。


参数:beta
Parameter for BayesThresh "BayesThresh" policy.
参数为BayesThresh"BayesThresh"政策。


参数:C1
Parameter for BayesThresh "BayesThresh" policy.
参数为BayesThresh"BayesThresh"政策。


参数:C2
Parameter for BayesThresh "BayesThresh" policy.
参数为BayesThresh"BayesThresh"政策。


参数:C1.start
Parameter for BayesThresh "BayesThresh" policy.
参数为BayesThresh"BayesThresh"政策。


参数:...
any other arguments
任何其他参数


Details

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

This function thresholds or shrinks wavelet coefficients stored in a wd object and returns the coefficients in a modified wd object. See the seminal papers by Donoho and Johnstone for explanations about thresholding. For a gentle introduction to wavelet thresholding (or shrinkage as it is sometimes called) see Nason and Silverman, 1994. For more details on each technique see the descriptions of each method below
此函数的阈值或缩小的小波系数存储在一个wd对象,并返回的改性wd对象中的系数。 Donoho和Johnstone的开创性论文的说明,关于阈值。对于简单的介绍小波阈值(或收缩,因为它有时也被称为),见利晨和Silverman,1994年。对于每个技术的详细信息,请参阅下面的每个方法的描述

The basic idea of thresholding is very simple. In a signal plus noise model the wavelet transform of signal is very sparse, the wavelet transform of noise is not (in particular, if the noise is iid Gaussian then so if the noise contained in the wavelet coefficients). Thus since the signal gets concentrated in the wavelet coefficients and the noise remains "spread" out it is "easy" to separate the signal from noise by keeping large coefficients (which correspond to signal) and delete the small ones (which correspond to noise). However, one has to have some idea of the noise level (computed using the dev option in threshold functions). If the noise level is very large then it is possible, as usual, that no signal "sticks up" above the noise.
阈值的基本思想是非常简单的。在小波变换的信号的信号加噪声模型是很稀疏,小波变换等的噪声是不(特别是,如果噪声是独立同分布的高斯那么,如果包含的噪声在小波系数)。因此,由于得到的信号中的子波系数和浓缩噪声仍然“蔓延”出来,它是“容易”的分离信号从噪声中的保持大系数(对应的信号),和删除的小的(这对应于噪声) 。然而,有一些想法的噪声电平(使用dev选项的阈值函数计算)。如果噪声电平是非常大的,那么它是可能的,像往常一样,没有信号“,坚持”以上的噪音。

There are many components to a successful thresholding procedure. Some components have a larger effect than others but the effect is not the same in all practical data situations. Here we give some rough practical guidance, although you must refer to the papers below when using a particular technique. You cannot expect to get excellent performance on all signals unless you fully understand the rationale and limitations of each method below. I am not in favour of the "black-box" approach. The thresholding functions of WaveThresh3 are not a black box: experience and judgement are required!
一个成功的阈值程序有许多组件。某些组件有一个比别人更大的效果,但效果是不一样的,在所有实际数据的情况下。在这里,我们给出了一些粗糙的实用指导,但你必须参考以下的文件时使用特定的技术。除非你完全理解下面的基本原理和每种方法的局限,你不能指望获得优异的性能对所有信号。我并不赞成“黑盒子”的方法。阈值函数的WaveThresh3是不是黑盒的经验和判断!

Some issues to watch for:
注意的一些问题:

  


levels The default of levels = 3wd$nlevels - 1) for the levels option most certainly does not work globally for all data problems and situations. The level at which thresholding begins (i.e. the given threshold and finer scale wavelets) is called the primary resolution and is unique to a particular problem. In some ways choice of the primary resolution is very similar to choosing the bandwidth in kernel regression albeit on a logarithmic scale. See Hall and Patil, (1995) and Hall and Nason (1997) for more information. For each data problem you need to work out which is the best primary resolution. This can be done by gaining experience at what works best, or using prior knowledge. It is possible to "automatically" choose a "best" primary resolution using cross-validation (but not in WaveThresh).
水平默认的levels = 3wd$nlevels - 1)levels选项当然没有在全球范围的所有数据的问题和情况。在哪一级的阈值开始(即在给定的阈值和更细的刻度小波)称为主分辨率和是唯一的一个特别的问题。在某些方面,主决议选择是非常类似的选择的带宽在内核回归尽管在对数刻度。见厅和Patil(1995)和霍尔和利晨(1997)更多信息。对于每一个数据的问题,你需要的工作,这是最好的小学分辨率。这是可以做到什么效果最好,获得经验或使用先验知识。这是可能的“自动”选择“最佳”的主要决议,采用交叉验证(而不是在WaveThresh)。

Secondly the levels argument computes and applies the threshold at the levels specified in the levels argument. It does this for all the levels specified. Sometimes, in wavelet shrinkage, the threshold is computed using only the finest scale coefficients (or more precisely the estimate of the overall noise level). If you want your threshold variance estimate only to use the finest scale coefficients (e.g. with universal thresholding) then you will have to apply the threshold.wd function twice. Once (with levels set equal to nlevels(wd)-1 and with return.threshold=TRUE to return the threshold computed on the finest scale and then apply the threshold function with the manual option supplying the value of the previously computed threshold as the value options.  
其次,各级参数的阈值水平levels参数中指定的计算和应用。为此,它规定的水平。有时,在小波阈值,该阈值计算只用最好的比例系数(或更精确的估计的整体噪声水平)。如果您希望您的阈值的方差估计只有使用最好的规模系数(即通用阈值),那么你将不得不申请threshold.wd函数两次。一旦(与水平设置为等于nlevels(WD)-1与return.threshold=TRUE返回规模最好计算的阈值,然后应用与手动选项供给的先前计算的值的阈值函数阈值的价值选择。




by.levelfor a wd object which has come from data with noise that is correlated then you should have a threshold computed for each resolution level. See the paper by Johnstone and Silverman, 1997.   
by.levelfor一个wd对象来自相关的噪音,那么你应该有一个阈值,计算出每个分辨率级别的数据。约翰斯通和Silverman,1997年的文件。


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

An object of class wd. This object contains the thresholded wavelet coefficients. Note that if the return.threshold option is set to TRUE then the threshold values will be returned rather than the thresholded object.
对象的类wd。该对象包含阈值的小波系数。请注意,如果return.threshold选项被设置为TRUE,则阈值将被返回,而比阈值对象。


RELEASE----------RELEASE----------

Version 3.6 Copyright Guy Nason and others 1997
3.6版版权盖利晨和其他1997


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

POLICIES  This section gives a brief description of the different thresholding policies available. For further details see the associated papers. If there is no paper available then a small description is provided here. More than one policy may be good for problem, so experiment! They are arranged here in alphabetical order:     
策略本节给出了不同的阈值策略的简要说明。有关进一步详情,请参阅相关的文件。如果没有纸张可用,则一个小的描述在此提供。超过一个策略可能是很好的问题,所以实验!他们被安排在这里按字母顺序排列:

BayesThreshSee Abramovich, Silverman and Sapatinas, (1998). Contributed by Felix Abramovich and Fanis Sapatinas.
BayesThreshSee阿布拉莫维奇,Silverman和Sapatinas,(1998年)。费利克斯阿布拉莫维奇和Fanis Sapatinas的提供者。

cvSee Nason, 1996.
利晨cvSee。

fdrSee Abramovich and Benjamini, 1996. Contributed by Felix Abramovich.
fdrSee阿布拉莫维奇和Benjamini的,1996年。提供者费利克斯·阿布拉莫维奇。

LSuniversalSee Nason, von Sachs and Kroisandt, 1998. This is used for smoothing of a wavelet periodogram and shouldn't be used generally.
LSuniversalSee利晨,冯高盛和Kroisandt,1998年。这是用于平滑化的小波周期图,一般不应使用。

manualspecify a user supplied threshold using value to pass the value of the threshold. The value argument should be a vector. If it is of length 1 then it is replicated to be the same length as the levels vector, otherwise it is repeated as many times as is necessary to be the levels vector's length. In this way, different thresholds can be supplied for different levels. Note that the by.level option has no effect with this policy.
manualspecify用户提供的阈值,使用value通过的阈值。 value参数应该是一个向量。如果它的长度为1,则它被复制到作为levels矢量是相同的长度,否则它被重复多次,levels向量的长度是必要的。以这种方式,可以提供不同的阈值的不同级别。需要注意的是by.level选项没有这个政策的影响。

mannumYou decided how many of the largest (in absolute value) coefficients that you want to keep and supply this number in value.
mannumYou决定的最大系数(绝对值)要保持,并提供价值多少。

op1See Ogden and Parzen, 1996. Contributed by Todd Ogden.
op1See奥格登和Parzen,1996年。托德·奥格登提供者。

op2See Ogden and Parzen, 1996. Contributed by Todd Ogden.
op2See奥格登和Parzen,1996年。托德·奥格登提供者。

probabilityThe probability policy works as follows. All coefficients that are smaller than the valueth quantile of the coefficients are set to zero. If by.level is false, then the quantile is computed for all coefficients in the levels specified by the "levels" vector; if by.level is true, then each level's quantile is estimated separately. The probability policy is pretty stupid - do not use it.
probabilityThe probability政策的工作原理如下。小于系数valueth位数的所有系数被设置为零。 by.level如果是假的,然后分位数计算的所有系数在规定的水平的“水平”矢量by.level如果是真的,那么每个级别的分位数估计分别。的概率政策是非常愚蠢的 - 不要使用它。

sureSee Donoho and Johnstone, 1994.
sureSee Donoho和Johnstone,1994年。

universalSee Donoho and Johnstone, 1995.   
universalSee Donoho和Johnstone,1995年。


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


G P Nason



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

<h3>See Also</h3>   <code>wd</code>, <code>wd.object</code>, <code>wr</code>, <code>wr.wd</code>, <code>threshold</code>.

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


#[]
# Generate some test data[生成一些测试数据。]
#[]
test.data <- example.1()$y
## Not run: ts.plot(test.data)[#不运行:ts.plot(test.data)]
#[]
# Generate some noisy data[产生一些噪声数据]
#[]
ynoise <- test.data + rnorm(512, sd=0.1)
#[]
# Plot it[画出它]
#[]
## Not run: ts.plot(ynoise)[#不运行:ts.plot(ynoise)]
#[]
# Now take the discrete wavelet transform[现在采取的离散小波变换]
# N.b. I have no idea if the default wavelets here are appropriate for[注意:我不知道,如果默认情况下的小波这里是适合]
# this particular examples. [这个特殊的例子。]
#[]
ynwd <- wd(ynoise)
## Not run: plot(ynwd)[#不运行:图(ynwd)]
#[]
# Now do thresholding. We'll use a universal policy, [现在做的阈值。我们将使用一个通用的政策,]
# and madmad deviance estimate on the finest[madmad偏差估计最好的]
# coefficients and return the threshold. We'll also get it to be verbose[系数和阈值返回。我们也将得到它是详细]
# so we can watch the process.[因此,我们可以看的过程。]
#[]
ynwdT1 <- threshold(ynwd, policy="universal", dev=madmad,
                levels= nlevels(ynwd)-1, return.threshold=TRUE,
        verbose=TRUE)
# threshold.wd:[threshold.wd:]
# Argument checking[参数检查]
# Universal policy...All levels at once[通用政策,各级一次]
# Global threshold is:  0.328410967430135 [全局阈值是:0.328410967430135]
#[]
# Why is this the threshold? Well in this case n=512 so sqrt(2*log(n)),[这是为什么阈值?那么在这种情况下,N = 512,所以SQRT(2 *log(n)),]
# the universal threshold,[通用阈值,]
# is equal to 3.53223. Since the noise is about 0.1 (because that's what[是等于3.53223。由于噪声大约是0.1(因为那是什么]
# we generated it to be) the threshold is about 0.353.[我们产生它是)阈值约为0.353。]
#[]
# Now let's apply this threshold to all levels in the noisy wavelet object[现在,让我们这个阈值在嘈杂的小波对象的各级]
#[]
ynwdT1obj <- threshold(ynwd, policy="manual", value=ynwdT1,
        levels=0nlevels(ynwd)-1))
#[]
# And let's plot it[让我们把它标绘]
#[]
## Not run: plot(ynwdT1obj)[#不运行:图(ynwdT1obj)]
#[]
# You'll see that a lot of coefficients have been set to zero, or shrunk.[你会看到,很多系数已设置为零,或缩小。]
#[]
# Let's try a Bayesian examples this time![让尝试贝叶斯例子!]
#[]
ynwdT2obj <- threshold(ynwd, policy="BayesThresh")
#[]
# And plot the coefficients[和图系数]
#[]
## Not run: plot(ynwdT2obj)[#不运行:图(ynwdT2obj)]
#[]
# Let us now see what the actual estimates look like[现在让我们看看什么实际的估计数字看上去像]
#[]
ywr1 <- wr(ynwdT1obj)
ywr2 <- wr(ynwdT2obj)
#[]
# Here's the estimate using universal thresholding[这里的估计,采用通用阈值]
#[]
## Not run: ts.plot(ywr1)[#不运行:ts.plot(ywr1)]
#[]
# Here's the estimate using BayesThresh [的估计使用BayesThresh的]
#[]
## Not run: ts.plot(ywr2)[#不运行:ts.plot(ywr2)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-25 14:38 , Processed in 0.020527 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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