MLEbin.simulate | R Documentation |
Simulate multiple data sets from a known individual size distribution (the
PLB distribution), bin them using linear bins of width 1, 5 and 10, and
using bins that progressively double in width, and then fit each data set
using the MLEmid and MLEbin likelihood methods. As in Figures 4, 5, and
S.35-S.38, and Tables S.3-S.5 of MEPS
paper. See MEPS_reproduce_2.Rmd
vignette for code for those figures and tables.
All simulated data sets have the same parameters for PLB and the same sample
size n
. Individual data sets are not saved as they quickly take up a lot
of memory (would be num.reps
\times
n
random numbers, which for the
default values is 10^7).
MLEbin.simulate(
n = 1000,
b.known = -2,
xmin.known = 1,
xmax.known = 1000,
num.reps = 10000,
seed = 42,
binType = list(1, 5, 10, "2k"),
vecDiffVal = 0.5,
cut.off = NA,
full.mult = 1.5
)
n |
sample size of each simulated data set (numeric) |
b.known |
known fixed value of b for all simulations |
xmin.known |
known fixed value of xmin (minimum allowable x value); currently needs to be a power of two (since makes it simpler to define the bin widths that double in size). |
xmax.known |
known fixed value of xmax (maximum allowable x value) |
num.reps |
number of random samples to draw, where each sample is a set
of |
seed |
seed for random number generator (default is the same as for MEE paper) |
binType |
list containing numeric values for linear bin widths and/or "2k" (the only other option for now) for bins that double in size. Values other than the defaults have not yet been tested but should work. |
vecDiffVal |
value to go into |
cut.off |
cut-off value - data are only sampled |
full.mult |
multiplier to generate desired sample size when using a
|
list containing:
MLE.array: three-dimensional array with element [i, j, k]
representing
the estimate of b obtained from random sample i
, bin type j
, and MLE
method k
. Size is num.reps
\times
length(binType)
\times
2.
MLEconf.array: four-dimensional array with vector
MLEconf.array[i, j, k, ]
being the confidence interval
c(confMin, confMax)
for random sample i
, bin type j
, and MLE method
k
.
MLE.array.parameters: list containing values of
n
,
b.known
,
xmin.known
,
xmax.known
,
num.reps
,
binType
,
binTypes
,
binType.name
Andrew Edwards
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.