tune.h {robustBLME} | R Documentation |
Tune ABC distance bandwidth
Description
Tunes the bandwidth h
of the ABC distance to get the desired level of acceptance rate specified via acc.rate
. Besides tuning h
, the function also builds the relevant quantities needed for running rblme
. For generating such quantities an internal call to lmer
is performed.
Usage
tune.h(formula, data, ..., n.samp = 1e+5, n.sim.HJ = 500, acc.rate, grid.h, prior,
cHub = 1.345, cHub2 = 2.07,
init, n.cores = 1, use.h)
Arguments
formula |
two-sided linear formula object describing the
fixed-effects part of the model, with the response on the left of
a |
data |
optional data frame containing the variables named
in |
... |
other arguments to be passed to |
n.samp |
number of pilot posterior samples to be drawn with ABC for each value of |
n.sim.HJ |
number of simulations to be used for computing the sensitivity and variability matrices. |
acc.rate |
desired acceptance rate of the ABC-MCMC algorithm. |
grid.h |
grid of |
prior |
named list of user-defined prior hyper-parameters. See "Details" below. |
cHub |
tuning constant of the Huber function for the location parameter. |
cHub2 |
tuning constant of the Huber proposal 2 function for the scale parameter. |
init |
optional object to use for starting values. Currently ignored as initial values are taken from |
n.cores |
number of cores for parallel computation on non Windows machines. |
use.h |
bandwidth to be used for the ABC distance. If provided, no tuning for |
Details
Given a specification of the formula
and data
the function calls internally rlmer
and extracts from the resulting object all the necessary quantities. Then proceeds by finding the solution of the REML II robust estimating equations (Richardson & Welsh 1995), with the REML estimate used as starting point. The sensitivity and the variability matrices are computed by simulation at the solution of the robust REML II estimating equation. Depending on whether use.h
or acc.rate
and grid.h
are specified, the function has a different behaviour. If acc.rate
and grid.h
are provided, then an adaptive step is performed in order to get an "optimal" h
which gives the desired acceptance rate acc.rate
. IN particular, for each value of grid.h
, the function draws n.samp
posterior samples with the ABC-MCMC algorithm and saves the resulting acceptance rate. Lastly, a function is built via a smoothing spline with acceptance rates being the x
s and grid.h
being the y
s. The "optimal" value of h
is found, within grid.h
, as the prediction the spline function at acc.rate
. If you already have an h
value in mind then specify it via use.h
and leave grid.h
and acc.rate
unspecified. Note that, in this case the acceptance rate of the ABC-MCMC algorithm may not be the one you wish to obtain since it depends in some complicated way also from use.h
. Currently, the prior for the q
fixed effects is the product of q
scalar normals with mean zero and user-specified variance beta.sd
(see Examples) equal for all the parameters. For the variance components the prior is a halfCauchy with user-specified scale s2.scale
. Both variance parameters are assumed to have equal prior scale.
Value
list.
References
Ruli E., Sartori N. & Ventura L. (2017) Robust approximate Bayesian inference with an application to linear mixed models. https://arxiv.org/abs/1706.01752
Richardson A. M. & Welsh A. H. (1995) Robust restricted maximum likelihood in mixed linear models. Biometrics 51, 1429-1439.