R: heterovar

heterovar {adlift} | R Documentation

## heterovar

### Description

Estimates individual wavelet coefficient variances using a sliding window approach.

### Usage

    heterovar(y, detail, al)

### Arguments

`y` | a vector of the gridpoints of removelist after executing the forward transform, in the order of the gridpoint vector.
`detail` | the vector of detail coefficients after the forward transform has been performed, in the order of the gridpoint vector.
`al` | The list of indices into removelist divided into artificial levels.

### Details

The function works out the interval endpoints for each gridpoint in removelist, based on an initial window length of one fifth of the range of y, and then adjusts them so that they lie within the range of y. The indices of the removelist points inside these intervals are then compared against the indices of the first artificial level for the data. These new indices are then used to compute the individual coefficient variances, based on the detail values of the new indices. If any of the window indices list entries contains less than four values, then the initial window length is increased by 5% and the process redone, until each window contains at least four coefficients.

### Value

`ep1` | a two-column matrix with the (true) endpoints of the windows from which to calculate the coefficient variances (according to the specified window length).
`ep2` | a two-column matrix with the endpoints of the windows from which to calculate the coefficient variances (adjusted to be of the window length and within the range of y).
`idlist` | a list of indices into y showing the points each interval contains.
`newidlist` | a list of indices into y showing the points each interval contains, which are also in the first artificial level.
`dlist` | a list of detail coefficients which correspond to the indices in newidlist.
`varvec` | a vector of median absolute deviation values (from the median) for the coefficients in dlist.
`varvec1` | a vector of median absolute deviation values (from the median), centered at zero, for the coefficients in dlist.
`varvec2` | a vector of median absolute deviation values (from the median), centered at zero, for the coefficients in dlist.

### Author(s)

Matt Nunes (nunesrpackages@gmail.com), Marina Knight

### See Also

`denoisehetero`

### Examples

    x1<-runif(256)
    #
    y1<-make.signal2("doppler",x=x1)
    #
    fwd<-fwtnp(x1,y1,LocalPred=AdaptNeigh,neighbours=2)
    #
    y<-fwd$lengthsremove
    rem<-fwd$removelist
    al<-artlev(y,rem)
    #
    yrem<-x1[sort(rem)]
    detail<-fwd$coeff[sort(rem)]
    #
    h<-heterovar(yrem,detail,al)
    #
    h$varvec[1:10]
    #
    #the first ten coefficient variances to be used in the normalisation of the detail
    #coefficients

[Package adlift version 1.4-1 Index]