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

R语言 treethresh包 coefficients()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 11:53:04 | 显示全部楼层 |阅读模式
coefficients(treethresh)
coefficients()所属R语言包:treethresh

                                        Extracting and updating coefficients stored in wd or imwd objects
                                         提取和更新系数存储在WD或imwd对象

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

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

extract.coefficients extracts wavelet coefficient vectors (in case of wd) and coefficient matrices (in case of imwd), so that these can be thresholded by treethresh or wtthresh. update.coefficients re-inserts these vector or matrices into the wd or imwd objects, such that the inverse transform can be computed using the thresholded coefficients.
extract.coefficients提取的小波系数向量(在情况wd)和系数矩阵(imwd),因此可以将这些阈值的treethresh或wtthresh的情况下,中。 update.coefficients重新插入进入wd或imwd对象,这些向量或矩阵的逆变换,使得可以使用阈值系数计算。


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


extract.coefficients(object, start.level=5)
insert.coefficients(object, update)
extract.coefficients.wd(object, start.level=5)
insert.coefficients.wd(object, update)
extract.coefficients.imwd(object, start.level=5)
insert.coefficients.imwd(object, update)



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

参数:object
For extract.coefficients the wd or imwd object to extract the coefficients from. For insert.coefficients the wd or imwd object to be updated.
对于extract.coefficientsWD或imwd对象的提取系数。“对于insert.coefficients被更新在wd或imwd对象。


参数:start.level
The coarsest level of coefficients to be extracted (extract.coefficients only)
最粗的要提取的系数水平(extract.coefficients只)


参数:update
A list with the matrices that should be copied into the wd or imwd object. (update.coefficients only)
应的的WD或者imwd对象复制到矩阵列表。 (update.coefficients只)


参数:...
additional arguments (see above for supported arguments).
额外的参数(见上面的支持的参数)。


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

extract.coefficients returns the coefficient matrices to be extracted. update.coefficients returns the updated wd or imwd object.
extract.coefficients返回要被提取的系数矩阵。 update.coefficients返回更新的wd或imwd对象。

insert.coefficients returns the updated wd or imwd object into which the coefficients from update have been inserted.
insert.coefficients返回更新的wd或imwd到的系数update的已插入的对象。


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

extract.coefficients.wd and extract.coefficients.imwd should rarely be directly called by the user. The more user-friendly S3 function extract.coefficients will take care of calling the right function (idem for insert.coefficients).
extract.coefficients.wd和extract.coefficients.imwd应该很少由用户直接调用。更加人性化的S3功能extract.coefficients会照顾调用正确的函数(同上,insert.coefficients)。


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

treethresh, wtthresh, wavelet.treethresh
treethresh,wtthresh,wavelet.treethresh


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


## The following examples shows how an example image can be[#以下示例显示了如何可以是一个例子形象]
## thresholded step by step. All the steps are combined in the more[#阈值一步一步来。合并所有的步骤都在更]
## user-friendly function wavelet.treethresh[#用户友好的功能wavelet.treethresh的]

## (01) Load the example image[#(01)负载的例子图像]
data(tiles)

## (02) Display the image[#(02)显示图像]
par(mai=rep(0,4)) ; image(tiles,col=grey(0:255/255))

## (03) Add noise to the image[#(03)添加噪声的图像]
corrupted <- tiles + rnorm(length(tiles))

## (04) Display the corrupted image[#(04)显示损坏的图像]
par(mai=rep(0,4)) ; image(corrupted, col=grey(0:255/255))

## (05) Compute the wavelet transform[#(05)计算的小波变换]
corrupted.wt <- imwd(corrupted)

## (06) Estimate the standard error[#(06)估计的标准误差]
dev <- estimate.sdev(corrupted.wt)

## (07) Extract the coefficient matrices to be thresholded[#(07)中提取的系数矩阵将阈值]
coefs <- extract.coefficients(corrupted.wt)

## (08) Rescale the coefficients using the estimated standard error[#(08)重新调整系数的估计标准误差]
## (should be around 1)[#(应该是约1)]
for (nm in names(coefs))
  coefs[[nm]] <- coefs[[nm]] / dev

## (09) Compute the tree[#(09)计算树]
coefs.tree <- wtthresh(coefs)

## (10) Prune the tree[#(10)修剪树]
coefs.pruned.tree <- prune.wtthresh(coefs.tree)

## (11) Threshold according to the pruned tree[#(11)阈值的修剪树]
coefs.threshed <- thresh(coefs.pruned.tree)

## (12) Undo the rescaling[#(12)撤消重新标度]
for (nm in names(coefs))
  coefs.threshed[[nm]] <- coefs.threshed[[nm]] * dev

## (13) Update coefficients[#(13)更新系数]
denoised.wt <- insert.coefficients(corrupted.wt, coefs.threshed)

## (14) Compute inverse wavelet transform[#(14)计算逆小波变换]
denoised <- imwr(denoised.wt)

## (15) Display denoised image[#(15)显示图像去噪]
par(mai=rep(0,4)) ; image(denoised, col=grey(0:255/255))

## (16) Compute l2 loss[#(16)计算L2损失]
sum((denoised-tiles)^2)

## Equivalently we could have called[#等价的,我们可以直接调用]
## denoised.wt &lt;- wavelet.treethresh(corrupted.wt)[#denoised.wt < -  wavelet.treethresh(corrupted.wt)]
## instead of steps (06) - (13)[#而不是步骤(06) - (13)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-29 23:46 , Processed in 0.021656 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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