Description Usage Arguments Value Author(s) References Examples
Performs k-fold cross-validation to choose the EES's tuning parameter, which determines the mixture between a consistent and a Gaussian estimator of the Cumulant Generating Function (CGF).
1 2 3 4 5 6 7 8 9 10 11 12 13 | selectDecay(
decay,
simulator,
K,
nrep = 1,
normalize = FALSE,
draw = TRUE,
multicore = !is.null(cluster),
cluster = NULL,
ncores = detectCores() - 1,
control = list(),
...
)
|
decay |
Numeric vector containing the possible values of the tuning parameter. |
simulator |
Function with prototype |
K |
the number of folds to be used in cross-validation. |
nrep |
Number of times the whole cross-validation procedure will be repeated, by calling
|
normalize |
if TRUE the normalizing constant of EES is normalized at each value of |
draw |
if |
multicore |
if TRUE each fold will run on a different core. |
cluster |
an object of class |
ncores |
number of cores to be used. |
control |
a list of control parameters, with entries:
|
... |
extra arguments to be passed to |
A list with entries:
negLogLik
A matrix length{decay}
by K*nrep
where the i-th row represent the negative loglikelihood
estimated for the i-th value of decay
, while each column represents a different fold and repetition.
summary
A matrix of summary results from the cross-validation procedure.
normConst
A matrix length{decay}
by nrep
where the i-th row contains the estimates of the normalizing constant.
The list is returned invisibly. If control$draw == TRUE
the function will also plot the cross-validation curve.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(esaddle)
# The data is far from normal: saddlepoint is needed and we expect
# cross validation to be minimized at low "decay"
set.seed(4124)
selectDecay(decay = c(0.001, 0.01, 0.05, 0.1, 0.5, 1),
simulator = function(...) rgamma(500, 2, 1),
K = 5)
# The data is far from normal: saddlepoint is not needed and we expect
# the curve to be fairly flat for high "decay"
selectDecay(decay = c(0.001, 0.01, 0.05, 0.1, 0.5, 1),
simulator = function(...) rnorm(500, 0, 1),
K = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.