R: Simulation function

hfdenoise {binhf} | R Documentation

## Simulation function

### Description

Proportion estimation procedure for simulations.

### Usage

    hfdenoise(n = 256, proportion = P2, binsize = 1, thrule = "ebayesthresh",
        van = 8, fam = "DaubLeAsymm", pl = 3, prior = "laplace", vscale = "independent",
    plotstep = FALSE, truncate = FALSE, ...)

### Arguments

`n` | Length of vector to be sampled.
`proportion` | The function name of the proportion to be sampled.
`binsize` | The binomial size corresponding to the mean function proportion.
`thrule` | Thresholding procedure to be used in the smoothing. Possible values are "sureshrink" and "ebayesthresh".
`van` | the vanishing moments of the decomposing wavelet basis.
`fam` | the wavelet family to be used for the decomposing transform.Possible values are "DaubLeAsymm" and "DaubExPhase".
`pl` | the primary resolution to be used in the wavelet transform.
`prior` | Prior to be used in ebayesthresh thresholding.
`vscale` | argument to ebayesthresh thresholding procedure (variance calculation: "independent" or "bylevel").
`plotstep` | Should all steps be plotted in estimation procedure?
`truncate` | Should the estimates be truncated to lie in [0,1]?
`...` | Any other optional arguments.

### Details

This function creates a regularly-spaced vector on the unit interval of length length, and uses these values to create corresponding values using the proportion function. These values are then used as binomial probabilities to sample "observed" binomial random variables. The observation vector is then denoised using a wavelet transform defined by the arguments pl, van, fam with thresholding method thrule. This denoising is done for both Anscombe and the Haar-Fisz method for binomial random variables. The procedure is repeated times times, and the resulting proportion estimates averaged.

### Value

`x` | regular grid on which the proportion function is evaluated.
`truep` | vector corresponding to x of proportion function values.
`fhat` | Binomial Haar-Fisz estimate.
`fhata` | Anscombe inverse sine estimate.
`fhatf` | Freeman-Tukey average inverse sine estimate.
`fl1` | lokern estimate using binhf.wd as a preprocessor.
`fl2` | lokern estimate using Anscombe as a preprocessor.
`bbwd` | wd object of binomial Haar-Fisz before thresholding.
`awd` | wd object of Anscombe before thresholding.
`b` | data from which estimates were computed (sampled from truep.
`bb` | data after being preprocessed with binomial Haar-Fisz.
`thr` | Thresholded wd object of bbwd.
`tmp` | Thresholded (binomial Haar-Fisz) data before postprocessing.

### Author(s)

Matt Nunes (m.nunes@ucl.ac.uk)

### See Also

`simsij`

### Examples

    sim<-hfdenoise()

    plot(sim$x,sim$truep,type="l", xlab="",ylab="Binomial Proportion")

    ##^^ shows original proportion to estimate.

    lines(sim$x,sim$fhat,col=2)
    lines(sim$x,sim$fhata,col=3)

    ##^^shows the estimates of the proportion from the two transforms.

[Package binhf version 1.0-1 Index]