Learn R Programming

aws (version 1.3-3.1)

awsuni: One-dimensional Adaptive Weights Smoothing

Description

Performes one-dimensional Adaptive Weigths Smoothing (depreciated version, use aws instead)

Usage

awsuni(y, lambda=3, gamma=1.3, eta =4, s2hat = NULL, kstar = length(radii),
              radii = c(1:8,(5:12)*2,(7:12)*4,(7:12)*8,(7:10)*16,(6:8)*32,
                      (5:8)*64,(5:8)*128,(5:8)*256),
          rmax=max(radii),graph = FALSE,z0 = NULL, eps = 1e-08, 
          control="dyadic", demomode=FALSE)

Arguments

y
observed values (ordered by value of independent variable)
lambda
main smoothing parameter (should be approximately 3)
gamma
allow for increase of variances during iteration by factor gamma (!! gamma >=1)
eta
main control parameter (should be approximately 4)
s2hat
initial variance estimate (if available, can be either a number (homogeneous case), a vector of same length as y (inhomogeneous variance) or NULL (a homogeneous variance estimate will be generated in this case)
kstar
maximal number of iterations to perform, actual number may be smaller depending on parameters radii, rmax and eps
radii
radii of neighbourhoods used
rmax
maximal radius of neighborhood to be used, may change kstar
graph
logical, if TRUE progress (for each iteration) is illustrated grahically, if FALSE the program runs until the final estimate is obtained (much faster !!!)
z0
allows for submission of "true" values for illustration and test purposes; only if graph=TRUE, MSE and MAE are reported for each iteration step
eps
stop iteration if $||(yhatnew - yhat)||^2 < eps * sum(s2hat)$
control
the control step is performed in either a dyadic sceme ("dyadic") or using all previous estimates (otherwise)
demomode
if TRUE the function will wait for user input after each iteration; only if graph=TRUE

Value

  • A list with components
  • yhatestimates of the regression function (corresponding to the y's)
  • shatestimated standard deviations of yhat (conditional on the chosen weights)
  • argsMain arguments supplied to awsuni

References

Polzehl, J. and Spokoiny, V. (2000). Adaptive Weights Smoothing with applications to image restoration, J.R.Statist.Soc. B, 62, Part 2, pp. 335-354

See Also

aws, awsbi, awstri

Examples

Run this code
#  Blocks data (from Donoho, Johnstone, Kerkyacharian and Picard (1995))
mofx6 <- function(x){
xj <- c(10,13,15,23,25,40,44,65,76,78,81)/100
hj <- c(40,-50,30,-40,50,-42,21,43,-31,21,-42)*.37
Kern <- function(x) (1-sign(x))/2
apply(Kern(outer(xj,x,"-"))*hj,2,sum)
}
x <- seq(0,1,1/2047)
fx6 <- mofx6(x)
#    sigma==3
y <- rnorm(fx6,fx6,3)
tmp <- awsuni(y)
par(mfrow=c(1,1))
plot(x,y)
lines(x,tmp$yhat,col=2)
lines(x,fx6,col=3)
title(expression(paste("AWS Reconstruction of blocks data  ",sigma==3)))
rm(x,y,fx6,mofx6,tmp)

Run the code above in your browser using DataLab