refine {Infusion} | R Documentation |
Refine estimates iteratively.
Description
This is a generic function with currently methods for SLik
, SLik_j
and SLikp
objects (as produced by MSL
). Depending on the value of its newsimuls
argument, and on whether the function used to generate empirical distributions can be called by R, it (1) defines new parameters points and/or (2) infers their summary likelihood or tail probabilities for each parameter point independently, adds the inferred values results as input for refined inference of likelihood or P-value response surface, and provides new point estimates and confidence intervals.
Usage
## S3 method for class 'SLik'
refine(object, method=NULL, ...)
## Default S3 method:
refine(object, surfaceData, Simulate =
attr(surfaceData,"Simulate"), maxit = 1, n = NULL,
useEI = list(max=TRUE,profileCI=TRUE,rawCI=FALSE),
newsimuls = NULL, trypoints=NULL, CIs = useCI, useCI = TRUE, level = 0.95,
verbose = list(most=interactive(),final=NULL,movie=FALSE,proj=FALSE),
precision = Infusion.getOption("precision"),
nb_cores = NULL, packages=attr(object$logLs,"packages"),
env=attr(object$logLs,"env"), method, using = object$using,
eval_RMSEs=TRUE, update_projectors = FALSE,
cluster_args=list(),
cl_seed=.update_seed(object),
nbCluster=quote(refine_nbCluster(nr=nrow(data))),
...)
Arguments
object |
an |
surfaceData |
A data.frame with attributes, usually taken from the |
Simulate |
Character string: name of the function used to simulate samples. The only meaningful non-default value is |
maxit |
Maximum number of iterative refinements (see also |
n |
NULL or numeric, for a number of parameter points (excluding replicates and confidence interval points in the primitive workflow), whose likelihood should be computed
(see |
useEI |
Cf this argument in |
newsimuls |
For the For other methods, a |
trypoints |
A data frame of parameters on which the simulation function |
CIs |
Boolean: whether to infer bounds of (one-dimensional, profile) confidence intervals. Their computation is not quite reliable in parameter spaces of large dimensions, so they should not be trusted per se, yet they may be useful for the definition of new parameter points. |
useCI |
whether to include parameter points near the inferred confidence interval points in the set of points whose likelihood should be computed. Effective only if |
level |
Intended coverage of confidence intervals |
verbose |
A list as shown by the default, or simply a vector of booleans. |
precision |
Requested local precision of surface estimation, in terms of prediction standard errors (RMSEs) of both the maximum summary log-likelihood and the likelihood ratio at any CI bound available. Iterations will stop when either |
nb_cores |
Shortcut for |
cluster_args |
A list of arguments for |
packages |
NULL or a list with possible elements |
env |
An environment, passed as the |
using |
Passed to |
method |
(A vector of) suggested method(s) for estimation of smoothing parameters (see |
eval_RMSEs |
passed to |
update_projectors |
Boolean; whether to update the projectors at each iteration. |
cl_seed |
NULL or integer, passed to |
nbCluster |
Passed to |
... |
further arguments passed to or from other methods. |
Details
New parameter points are sampled as follows: the algorithm aims to sample uniformly the space of parameters contained in the confidence regions defined by the level
argument, and to surround it by a region sampled proportionally to likelihood. In each iteration the algorithm aims to add as many points (say n) as computed in the first iteration, so that after k iterations of refine
, there are n * (k+1)
points in the simulation table. However, when not enough points satisfy certain criteria, only n/5 points may be added in an iteration, this being compensated in further iterations. For example, if n=600
, the table may include only 720 points after the first refine, but 1800 after the second.
Independent control of parallelisation may be needed in the different steps, e.g. if the simulations are not easily parallelised whereas the projection method natively handles parallelisation. In the up-to-date workflow with default ranger
projection method, prarallelisation controls may be passed to add_reftable
for sample simulations, to project
methods when projections are updated, and to MSL
for RMSE computations (alternatively for the primitive workflow, add_simulation
, infer_logLs
and MSL
are called). nb_cores
, if given and not overcome by other options, will control simulation and projection steps (but not RMSE computation): nb_cores
gives the number of parallel processes for sample simulation, with additional makeCluster
arguments taken from cluster_args
, but RMSE computations are performed serially. Further independent control is possible as follows:
cluster_args=list(project=list(num.threads=<.>))
allows control of the num.threads
argument of ranger functions;
cluster_args=list(RMSE=list(spec=<number of 'children'>))
can be used to force parallel computation of RMSEs;
cluster_args=list(spec=<.>, <other makeCluster arguments>))
would instead apply the same arguments to both reference table and RMSE computation, overcoming the default effect of nb_cores
in both of them; finally
cluster_args=list(reftable=list(<makeCluster arguments>),RMSEs=list(<makeCluster arguments>))
allows full independent control of parallelisation for the two computations.
Value
refine
returns an updated SLik
or SLik_j
object.
Note
See workflow examples in (by order of decreasing relevance) example_reftable
, example_raw_proj
and example_raw
.
Examples
## see Note for links to examples.