View source: R/samplebootmat.R
samplebootmat | R Documentation |
samplebootmat
returns nsim
bootstrap samples of a set of
indicator observations and reference values.
samplebootmat(
ValueID = NULL,
Value = NULL,
RefobsID = NULL,
DistID = NULL,
mu = NULL,
sig = NULL,
ref.value.code = 0,
Type.of.uncertainty = c("Observations"),
nsim = 100
)
ValueID |
integer, |
Value |
double, |
RefobsID |
integer, |
DistID |
character, |
mu |
double, |
sig |
double, |
ref.value.code |
integer, |
Type.of.uncertainty |
character, |
nsim |
double, |
Bootstrap samples consist of either nsim
random draws from a set of
probability distributions given by DistID
and the parameter vectors
mu
and sig
, or nsim
copies of the elements of Value
,
or a combination of draws and copies, depending on the parameter
Type.of.uncertainty
.
samplebootmat
presumes that the set of probability distributions only
includes the truncated normal-, lognormal-, weibull-, gamma-, zero-inflated
exponential, poisson-, negative binomial-, and zero-inflated poisson
distributions. The lower bound in the truncated normal distribution is always
zero, while the upper bound is infinity.
The function does not handle missing values (NAs).
samplebootmat
is a utility function adapted to the mathematical
framework for calculating the nature index.
samplebootmat
calls sampleobs
which does the random draws.
double matrix, dim = c(nvalues, nsim)
, nsim
bootstrap sample
as specified by RefobsID
, Value
, distrib
, mu
,
and sig
.
Bård Pedersen
sampleobs
,
# Example data
aa <- 1:2 # ValueID
bb <- rep(1,2) # Value
cc <- c(0,1) # RefobsID
dd <- rep(c("LogNormal"), 2) # DistID
mu <- rep(0,2) # mu
sig <- rep(1,2) # sig
samplebootmat(aa,bb,cc,dd,mu,sig)
samplebootmat(aa,bb,cc,dd,mu,sig,Type.of.uncertainty = "All")
samplebootmat(aa,bb,RefobsID = c(0,0),dd,mu,sig)
samplebootmat(aa,bb,cc,dd,mu,sig,ref.value.code = 1)
samplebootmat(aa,bb,cc,dd,mu,sig,ref.value.code = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.