(for testing) A non-Copula sampling function as fallback
sampleWithNoise.Rd
If the sample is not suited to infer a Copula (fitCopula fails), this fuction uses much simpler rules to re-draw a new sample from an older sample with some added noise.
Arguments
- X
an N×M matrix (N is the sample size), M is the number of variables (MCMC or ABC vars)
- sdf
factor to increase or decrease the standard deviation of the added noise
- ...
passed to
base::sample.int()
- size
size of returned sample (passed to
sample.int()
)
Details
This can be used during testing, in cases where the acceptance was
very low and we have to deal with a very low quality sample This
function should work like base::sample
, but adds small
noise. Missing values are always removed.