R: Simulation function

simsij {binhf} | R Documentation

## Simulation function

### Description

Proportion estimation procedure for simulations.

### Usage

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

### Arguments

`nsims` | The number of times to repeat the function doall (on random datasets from proportion).
`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?
`a` | the a argument for `EbayesThresh`.
`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 van, fam, min.level with thresholding method meth. 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.
`ans` | matrix containing the errors from each of the nsims doall runs.
`est` | Array containing the nsims estimates produced by Anscombe and Haar-Fisz.
`bin` | Matrix of the raw binomial samples for each of the nsims runs.

### Author(s)

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

### See Also

`hfdenoise`

### Examples

    ## Not run:
    a<-simsij(nsims=100)

    plot(a$est[1,,1])

    ##^^ shows 1st binomial Haar-Fisz estimate.

    ## End(Not run)

[Package binhf version 1.0-1 Index]