rsaddle {esaddle} | R Documentation |
Simulate random variables from the Extended Empirical Saddlepoint density (ESS), using importance sampling and then resampling according to the importance weights.
rsaddle(
n,
X,
decay,
ml = 2,
multicore = !is.null(cluster),
cluster = NULL,
ncores = detectCores() - 1,
...
)
n |
number of simulated vectors. |
X |
an m by d matrix containing the data. |
decay |
rate at which the ESS falls back on a normal density. Should be a positive number. See Fasiolo et al. (2016) for details. |
ml |
n random variables are generated from a Gaussian importance density with covariance matrix
|
multicore |
if TRUE the ESS densities corresponding the samples will be evaluated in parallel. |
cluster |
an object of class |
ncores |
number of cores to be used. |
... |
additional arguments to be passed to |
Notice that, while importance sampling is used, the output is a matrix of unweighted samples, obtained by resampling with probabilities proportional to the importance weights.
An n by d matrix containing the simulated vectors.
Matteo Fasiolo <matteo.fasiolo@gmail.com>.
Fasiolo, M., Wood, S. N., Hartig, F. and Bravington, M. V. (2016). An Extended Empirical Saddlepoint Approximation for Intractable Likelihoods. ArXiv http://arxiv.org/abs/1601.01849.
# Simulate bivariate data, where each marginal distribution is Exp(2)
X <- matrix(rexp(2 * 1e3), 1e3, 2)
# Simulate bivariate data from a saddlepoint fitted to X
Z <- rsaddle(1000, X, decay = 0.5)
# Look at first marginal distribution
hist( Z[ , 1] )