The function implements the propagation separation approach to nonparametric smoothing (formerly introduced as Adaptive weights smoothing) for varying coefficient Gaussian models on a 1D or 2D irregulat design. The function allows for a paramertic (polynomial) mean-variance dependence.

aws.irreg(y, x, hmax = NULL, aws=TRUE, memory=FALSE, varmodel = "Constant",
          lkern = "Triangle", aggkern = "Uniform", sigma2 = NULL, nbins = 100,
          hpre = NULL, henv = NULL, ladjust =1, varprop = 0.1, graph = FALSE)

Arguments

y

The observed response vector (length n)

x

Design matrix, dimension n x d, d %in% 1:2

hmax

hmax specifies the maximal bandwidth. Unit is binwidth in the first dimension.

aws

logical: if TRUE structural adaptation (AWS) is used.

memory

logical: if TRUE stagewise aggregation is used as an additional adaptation scheme.

varmodel

determines the model that relates variance to mean. Either "Constant", "Linear" or "Quadratic".

lkern

character: location kernel, either "Triangle", "Plateau", "Quadratic", "Cubic" or "Gaussian"

aggkern

character: kernel used in stagewise aggregation, either "Triangle" or "Uniform"

sigma2

sigma2 allows to specify the variance in case of varmodel="Constant", estimated if not given.

nbins

numer of bins, can be NULL, a positive integer or a vector of positive integers (length d)

hpre

smoothing bandwidth for initial variance estimate

henv

radius of balls around each observed design point where estimates will be calculated

ladjust

factor to increase the default value of lambda

varprop

exclude the largest 100*varprop% squared residuals when estimating the error variance

graph

If graph=TRUE intermediate results are illustrated after each iteration step. Defaults to graph=FALSE.

Details

Data are first binned (1D/2D), then aws is performed on all datapoints within distance <= henv of nonempty bins.

Value

returns anobject of class aws with slots

y = "numeric"

y

dy = "numeric"

dim(y)

x = "numeric"

x

ni = "integer"

number of observations per bin

mask = "logical"

bins where parameters have been estimated

theta = "numeric"

Estimates of regression function, length: length(y)

mae = "numeric"

numeric(0)

var = "numeric"

approx. variance of the estimates of the regression function. Please note that this does not reflect variability due to randomness of weights.

xmin = "numeric"

vector of minimal x-values (bins)

xmax = "numeric"

vector of maximal x-values (bins)

wghts = "numeric"

relative binwidths

degree = "integer"

0

hmax = "numeric"

effective hmax

sigma2 = "numeric"

provided or estimated error variance

scorr = "numeric"

0

family = "character"

"Gaussian"

shape = "numeric"

numeric(0)

lkern = "integer"

integer code for lkern, 1="Plateau", 2="Triangle", 3="Quadratic", 4="Cubic", 5="Gaussian"

lambda = "numeric"

effective value of lambda

ladjust = "numeric"

effective value of ladjust

aws = "logical"

aws

memory = "logical"

memory

homogen = "logical"

FALSE

earlystop = "logical"

FALSE

varmodel = "character"

varmodel

vcoef = "numeric"

estimated coefficients in variance model

call = "function"

the arguments of the call to aws

References

J. Polzehl, V. Spokoiny, in V. Chen, C.; Haerdle, W. and Unwin, A. (ed.) Handbook of Data Visualization Structural adaptive smoothing by propagation-separation methods. Springer-Verlag, 2008, 471-492. DOI:10.1007/978-3-540-33037-0_19.

Author

Joerg Polzehl, polzehl@wias-berlin.de

See also

See also lpaws, link{awsdata}, lpaws

Examples

require(aws)
# 1D local constant smoothing
if (FALSE) demo(irreg_ex1)
# 2D local constant smoothing
if (FALSE) demo(irreg_ex2)