default_control {aghq} | R Documentation |
Default control arguments for aghq::aghq()
.
Description
Run default_control()
to print the list of valid control parameters
and their defaults, and run with named arguments to change the defaults.
Usage
default_control(...)
Arguments
... |
You can provide a named value for any control parameter and its
value will be set accordingly. See |
Details
Valid options are:
method
: optimization method to use:'BFGS' (default):
optim(...,method = "BFGS")
'sparse_trust':
trustOptim::trust.optim
'SR1':
trustOptim::trust.optim
withmethod = 'SR1'
'sparse':
trust::trust
Default is 'sparse_trust'.
-
negate
: defaultFALSE
. Multiply the functions inff
by-1
? The reason for having this option is for full compatibility withTMB
: while of courseTMB
allows you to code up your log-posterior any way you like, all of its excellent features including its automatic Laplace approximation and MCMC sampling withtmbstan
assume you have coded your template to return the negated log-posterior. However, by default,aghq
assumes you have provided the log-posterior without negation. Setnegate = TRUE
if you have provided a template which computes the negated log-posterior and its derivatives. -
ndConstruction
: construct a multivariate quadrature rule using a"product"
rule or a"sparse"
grid? Default"product"
. See?mvQuad::createNIGrid()
. -
interpolation
: how to interpolate the marginal posteriors. The'auto'
option (default) chooses for you and should always work well. The'polynomial'
option usespolynom::poly.calc()
to construct a global polynomial interpolant and has been observed to be unstable as the number of quadrature points gets larger, which is obviously a bad thing. Try'spline'
instead, which uses a cubic B-Spline interpolant fromsplines::interpSpline()
. numhessian: logical, default
FALSE
. Replace theff$he
with a numerically-differentiated version, by callingnumDeriv::jacobian
onff$gr
. Used mainly forTMB
with the automatic Laplace approximation, which does not have an automatic Hessian.onlynormconst: logical, default
FALSE
. Skip everything after the calculation of the log integral, and just return the numeric value of the log integral. Saves computation time, and most useful in cases whereaghq
is being used as a step in a more complicated procedure.method_summaries: default
'reuse'
, method to use to compute moments and marginals. Choosing'correct'
corresponds to the approximations suggested in the Stochastic Convergence... paper, which attain the same rate of convergence as the approximation to the marginal likelihood. See?compute_moment
.
Value
A list of argument values.
Examples
default_control()
default_control(method = "trust")
default_control(negate = TRUE)