awsh                   package:aws                   R Documentation

_U_n_i_v_a_r_i_a_t_e _l_o_c_a_l _p_o_l_y_n_o_m_i_a_l _A_d_a_p_t_i_v_e _W_e_i_g_h_t_s _S_m_o_o_t_h_i_n_g _f_o_r _r_e_g_r_e_s_s_i_o_n _w_i_t_h
_h_e_t_e_r_o_s_c_e_d_a_s_t_i_c _a_d_d_i_t_i_v_e _e_r_r_o_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function implements a univariate local polynomial Adaptive
     Weights Smoothing procedure for regression problems with
     heteroskedastic additive errors as described in Polzehl & Spokoiny
     (2003).

_U_s_a_g_e:

     awsh(y, x = NULL, p = 0, sigma2 = NULL, qlambda = NULL, eta = 0.5, tau = NULL,
     lkern = "Triangle", hinit = NULL, hincr = NULL, hmax = 100, hmaxs= 2*hmax, u = NULL,
     graph = FALSE, demo = FALSE, symmetric = NULL, conf = FALSE, qconf = 0.95, alpha = 2)

_A_r_g_u_m_e_n_t_s:

       y: 'y' contains the observed values (regression function plus
          errors). In case of 'x=NULL' (second parameter) 'y' is
          assumed to be observed on a one-dimensional grid. 

       x: 'x' is either 'NULL', in this case 'y' is assumed to be
          observed on a grid, or is a vector determining the design. 

       p: 'p' is the degree of the polynomial model to use. For
          univariate regression 'p' can be an nonnegative integer less
          or equal than 5.  

  sigma2: 'sigma2' can be used to provide an estimate for the error
          variance. If 'is.null(sigma2)' a homoskedastic model is
          assumed and a variance estimate is generated from the data.
          If 'length(sigma2)==length(y)' this parameter provides
          variances at the design points.

 qlambda: 'qlambda' determines the scale parameter 'qlambda' for the
          stochastic penalty. The scaling parameter in the stochastic
          penalty 'lambda' is choosen as the 'qlambda'-quantile of a
          Chi-square-distribution with number of parameters in the
          polynomial model as degrees of freedom. If 'is.null(qlambda)'
          a standard value depending on 'p' is choosen.

     eta: 'eta' is a memory parameter used to stabilize the procedure.
          'eta'  has to be between '0' and '1', with 'eta=.5' being the
          default. 

     tau: 'tau' is used in case of a the scale parameter polynomial
          degree 'p!=0' only. It is the scale parameter in the
          extention penalty used to prevent from leverage problems. The
          default value for 'tau' depends on 'p' and on the number of
          parameters in the local model. 

   lkern: 'lkern' determines the location kernel to be used. Options
          are '"Uniform"', '"Triangle"', '"Quadratic"', '"Cubic"' and
          '"Exponential"'. Default is '"Triangle"'. The Kernel operates
          on the squared distance, so '"Triangle"' corresponds to the
          use of an Epanechnikov kernel in kernel smoothing.
          '"Exponential"' requires larger values of 'hmax' and
          therefore more iterations to reach comparable results. 

   hinit: 'hinit' Initial bandwidth for the location penalty.
          Appropriate value is choosen in case of 'hinit=NULL' 

   hincr: 'hincr' 'hincr' is used as a factor to increase the bandwidth
          between iterations. Defauts to 'hincr=1.25' 

    hmax: 'hmax' Maximal bandwidth to be used. Determines the number of
          iterations and is used as the stopping rule. 

   hmaxs: 'hmaxs' Maximal bandwidth to be used when estimating the
          heterogenous variance from consequtive differences of 'y' by
          function 'laws'. Determines the number of iterations of
          'laws'. 

       u: 'u' used to supply values of the true regression function for
          test purposes to calculate  Mean Squared Error (MSE) and Mean
          Absolute Error (MAE) 

   graph: 'graph' if 'TRUE' results are displayed after each iteration
          step. 

    demo: 'demo' if 'TRUE' after each iteration step results are
          displayed and the process waits for user interaction. 

symmetric: If 'symmetric==TRUE' the stochastic penalty is symmetrized,
          i.e. '(sij + sji)/lambda' is used instead of 'sij/lambda'.
          See references for details. 'symmetric==FALSE' is forced if
          'p!=0'

    conf: 'conf' if 'TRUE' conditional (on weights) confidence
          intervals are provided at each design point.

   qconf: 'qconf' determines the level of the conditional (on weights)
          confidence intervals 

   alpha: 'alpha' Parameter used for a penalized MSE estimate for
          'p=0'. This is experimental to try to select 'hmax'. 

_D_e_t_a_i_l_s:

     This function implements an local polynomial adaptive weights
     smoothing (AWS) procedure for a univariate heteroskedastic
     regression model. The approach generalizes the original AWS
     procedure from Polzehl and Spokoiny (2000).

     Adaptive weights smoothing is an iterative data adaptive smoothing
     technique that is designed  for smoothing in regression problems
     with discontinuous regression function. The basic assumption is
     that the regression function can be approximated by a simple
     local,  e.g. local constant or local polynomial, model. The
     estimate of the regression function, i.e. the conditional
     expectation of 'y' given 'x' is computed as a weighted maximum
     likelihood estimate, with weights choosen in a completely data
     adaptive way. The procedure is edge preserving. If the assumed
     local model is globally valid, almost all weights used will be 1,
     i.e. the resulting estimate almost is the global estimate.

     Currently implemented are the following models (specified by
     parameter 'p' and attributes of 'x' and 'y') are implemented:

     _p=_0, _x=_N_U_L_L local constant univariate AWS on a grid. Measurement
          unit for 'hinit' and 'hmax' is 1 (number grid points within
          distance 'h')

     _p=_0, !_i_s._n_u_l_l(_x) local constant AWS for arbitrary design given in
          'x'. 

     '_p>_2' univariate local polynomial AWS for arbitrary univariate
          design given in 'x'. 'y' has to be a vector. If 'x' is
          provided it has to be a vector of the same length as 'y'. If
          'is.null(x)' an equidistant design (grid) with grid-step 1 is
          assumed.

     The essential parameter in the procedure is 'qlambda'. This
     parameter has an interpretation as a significance level of a test
     for equivalence of two local parameter estimates. Optimal values
     mainly depend on the choosen 'p' and the value of 'symmetric'
     (determines the use of an asymmetric or a symmetrized test). The
     optimal values only slightly depend on the model parameters, i.e.
     the default parameters should work in most situations. Larger
     values of 'qlambda' may lead to oversmoothing, small values of
     'qlambda' lead to a random segmentation of homogeneous regions. A
     good value of 'qlambda' can be obtained by the propagation
     condition, requiring that in case of global validity of the local
     model the  estimate for large 'hmax' should be equal to the global
     estimate.

     The numerical complexity of the procedure is mainly determined by
     'hmax'. The number of iterations is 'd*log(hmax/hinit)/log(hincr)'
     with 'd' being the dimension of 'y'. Comlexity in each iteration
     step is 'Const*hakt*n' with 'hakt' being the actual bandwith in
     the iteration step and 'n' the number of design points. 'hmax'
     determines the maximal possible variance reduction.

_V_a_l_u_e:

  theta : Parameter estimates, first dimension corresponds to parameter
          components

  theta : Standard deviations (conditional on weights) of parameter
          estimates, first dimension corresponds to parameter
          components

       y: values provided in 'y'

       x: values provided in 'x'

    call: actual function call

_A_u_t_h_o_r(_s):

     Joerg Polzehl, polzehl@wias-berlin.de, <URL:
     http://www.wias-berlin.de/project-areas/stat/projects/adaptive-ima
     ge-processing.html>

_R_e_f_e_r_e_n_c_e_s:

  Polzehl, J. and Spokoiny, V. (2003). _Varying coefficient regression
     modeling by adaptive weights smoothing_, WIAS-Preprint 818. 

  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 

_S_e_e _A_l_s_o:

     'aws'

_E_x_a_m_p_l_e_s:

     ##---- Should be DIRECTLY executable !! ----
     ##-- ==>  Define data, use random,
     ##--    or do  help(data=index)  for the standard data sets.

