Learn R Programming

aws (version 1.3-3.1)

awstri: Three-dimensional Adaptive Weights Smoothing

Description

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

Usage

awstri(y, lambda=3, gamma=1.3, eta =4, s2hat = NULL, kstar = length(radii),
       rmax=max(radii), weight = c(1,1,1), radii = c((1:4)/2,2.3,(5:12)/2,7:9,10.5,12,13.5), control="dyadic")

Arguments

y
array of observed values
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 matrix of same dimension 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 and rmax
weight
weights used for distances, determining elliptical neighborhoods
radii
radii of circular neighbourhoods used
rmax
maximal radius of neighborhood to be used, may change kstar
control
the control step is performed in either a dyadic sceme ("dyadic") or using all previous estimates (otherwise)

Value

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

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,awsuni

Examples

Run this code
xy <- rbind(rep(0:30,31),rep(0:30,rep(31,31)))
w3 <- array(0,c(31,31,31))
w3[4:28,4:28,4:28] <- 1
dim(w3) <- c(961,31)
w3[((xy[1,]-15)^2+(xy[2,]-15)^2)<=144,16] <- 0
for(i in 1:12) {
   r2 <- 144-i*i
   w3[((xy[1,]-15)^2+(xy[2,]-15)^2)<=r2,16+c(-i,i)] <- 0
}
dim(w3) <- c(31,31,31)
w3[10:22,10:22,10:22] <- 1
dim(w3) <- c(961,31)
w3[((xy[1,]-15)^2+(xy[2,]-15)^2)<=36,16] <- 0
for(i in 1:6) {
   r2 <- 36-i*i
   w3[((xy[1,]-15)^2+(xy[2,]-15)^2)<=r2,16+c(-i,i)] <- 0
}
dim(w3) <- c(31,31,31)
sigma <- .4
y <- w3+rnorm(w3,0,sigma)
#  increase rmax for better results
yhat <- awstri(y,rmax=2)
rm(y,yhat,w3,xy)

Run the code above in your browser using DataLab