Proportion estimation procedure for simulations.
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, ...)
The number of times to repeat the function doall
(on random datasets from proportion
).
Length of vector to be sampled.
The function name of the proportion to be sampled.
The binomial size corresponding to the mean function proportion
.
Thresholding procedure to be used in the smoothing. Possible values are "sureshrink" and "ebayesthresh".
the vanishing moments of the decomposing wavelet basis.
the wavelet family to be used for the decomposing transform.Possible values are "DaubLeAsymm" and "DaubExPhase".
the primary resolution to be used in the wavelet transform.
Prior to be used in ebayesthresh thresholding.
argument to ebayesthresh thresholding procedure (variance calculation: "independent" or "bylevel").
Should all steps be plotted in estimation procedure?
the a
argument for EbayesThresh
.
Should the estimates be truncated to lie in [0,1]?
Any other optional arguments.
regular grid on which the proportion function is evaluated.
vector corresponding to x
of proportion function values.
matrix containing the errors from each of the nsims
doall
runs.
Array containing the nsims
estimates produced by Anscombe and Haar-Fisz.
Matrix of the raw binomial samples for each of the nsims
runs.
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.
# NOT RUN {
a<-simsij(nsims=100)
plot(a$est[1,,1])
##^^ shows 1st binomial Haar-Fisz estimate.
# }
Run the code above in your browser using DataLab