afgen {binhf} | R Documentation |
NN and Anscombe samples
Description
Samples binomial Fisz and Anscombe transformed random variables on a grid of binomial probabilities.
Usage
afgen(xgrid = seq(0, 1, length = 21), ygrid = seq(0, 1, length = 21), samples = 1000,
binsize = 32)
Arguments
xgrid |
vector of x co-ordinate probabilities. |
ygrid |
vector of x co-ordinate probabilities. |
samples |
the number of samples to draw from each random variable. |
binsize |
the binomial size of the binomial random variables. |
Details
The function produces sampled values from the random variable:
,
where are Bin(binsize,
) random variables, for all combinations of values of
in xgrid and
in ygrid.
For Anscombe's transformation,
, the values correspond to the random variable with the larger binomial probability.
Value
a |
an array of dimensions |
b |
an array of dimensions |
Author(s)
Matt Nunes (m.nunes@ucl.ac.uk)
References
Anscombe, F.J. (1948) The transformation of poisson, binomial and negative binomial Data, Biometrika,35, 246–254.
Nunes, M. and Nason, G.P. (2009) A multiscale variance stabilization for binomial sequence proportion estimation. Statistica Sinica, 19
(1491–1510).
See Also
Examples
##
varvalues<-afgen(xgrid=seq(0,1,length=21),ygrid=seq(0,1,length=21),samples=1000,binsize=32)
##creates 1000 samples of the two random variables zeta_B and A for each point
##(x,y) for x and y regularly-spaced probability vectors of length 21.
##