get_set_param {nvmix} | R Documentation |
Algorithm-specific Parameters
Description
Algorithm specific parameters for functionalities in the nvmix
package, notably for fitnvmix()
, dnvmix()
,
pnvmix()
, qnvmix()
, pgammamix()
,
dgammamix()
and ES_nvmix()
as well as the
corresponding functions for grouped mixtures.
Usage
get_set_param(control = list())
Arguments
control |
|
Details
For most functions in the nvmix
package, internally, an
iterative randomized Quasi-Monte Carlo (RQMC) approach is used to
estimate probabilities, weights and (log-)densities. There are various
parameters of underlying methods than can be changed.
Algorithm specific parameters can be passed as a list via
control
. It can contain any of the following:
- For all algorithms:
-
method
character
string indicating the method to be used to compute the integral. Available are:"sobol"
:Sobol' sequence (default),
"ghalton"
:generalized Halton sequence,
"PRNG"
:plain Monte Carlo based on a pseudo-random number generator.
increment
character
string indicating how the sample size should be increased in each iteration. Available are:"doubling"
:next iteration has as many sample points as all the previous iterations combined,
"num.init"
:all iterations use an additional
fun.eval[1]
-many points (default for most functions).
CI.factor
multiplier of the Monte Carlo confidence interval bounds. The algorithm runs until
CI.factor
times the estimated standard error is less thanabstol
orreltol
(whichever is provided). IfCI.factor = 3.5
(the default), one can expect the actual absolute error to be less thanabstol
in 99.9% of the cases.fun.eval
numeric(2)
providing the size of the first point set to be used to estimate integrals (typically a power of 2) and the maximal number of function evaluations.fun.eval
defaults toc(2^7, 1e12)
.max.iter.rqmc
numeric
, providing the maximum number of iterations allowed in the RQMC approach; the default is15
ifincrement = "doubling"
and1250
otherwise.B
number of randomizations for obtaining an error estimate in the RQMC approach; the default is
15
.
- For
pnvmix()
andpgnvmix()
: -
pnvmix.abstol
,pnvmix.reltol
non-negative
numeric
providing the relative/absolute precision required for the distribution function. Relative precision viapnvmix.reltol
is only used whenpnvmix.abstol = NA
; in all other cases, absolute precision will be used.pnvmix.abstol
defaults to1e-3
. Ifpnvmix.abstol = 0
andpnvmix.reltol = 0
, the algorithm will typically run until the total number of function evaluations exceedsfun.eval[2]
or until the total number of iterations exeedsmax.iter.rqmc
, whichever happens first. Ifn > 1
(soupper
has more than one row), the algorithm runs until the precision requirement is reached for alln
probability estimates.mean.sqrt.mix
expectation of the square root
\sqrt(W)
of the mixing variableW
. IfNULL
, it will be estimated via QMC; this is only needed for determining the reordering of the integration bounds, so a rather crude approximation is fine.precond
logical
indicating whether preconditioning is applied, that is, reordering of the integration variables. IfTRUE
, integration limitslower
,upper
as well asscale
are internally re-ordered in a way such that the overall variance of the integrand is usually smaller than with the original ordering; this usually leads smaller run-times.cholesky.tol
non-negative numeric providing lower threshold for non-zero elements in the computation of the cholesky factor: If calculated
C(i,i)^2 < | cholesky.tol * Scale(i,i)|
, the diagonal element (and all other elements in columni
) of the cholesky factorC
are set to zero, yielding a singular matrix.cholesky.tol
defaults to1e-9
.
- For
dnvmix()
anddgnvmix()
: -
dnvmix.reltol
,dnvmix.abstol
non-negative
numeric
providing the relative/absolute precision for the *log-* density required. Absolute precision viadnvmix.abstol
is only used whendnvmix.reltol = NA
; in all other cases, relative precision will be used.dnvmix.reltol
defaults to1e-2
. Ifdnvmix.reltol=0
anddnvmix.abstol=0
, the algorithm will typically run until the total number of function evaluations exceedsfun.eval[2]
or until the total number of iterations exeedsmax.iter.rqmc
, whichever happens first. Ifn > 1
(sox
has more than one row), the algorithm runs until the precision requirement is reached for alln
log-density estimates.dnvmix.doAdapt
logical
indicating if an adaptive integration procedure shall be used that only samples in relevant subdomains of the mixing variable; defaults toTRUE
.dnvmix.max.iter.rqmc.pilot
numeric
, providing the maximum number of unstratified, non-adaptive pilot runs the internal integration procedure performs. Defaults to6
.dnvmix.tol.int.lower
,dnvmix.order.lower
-
both
numeric
and nonnegative. RQMC integration is only performed where the integrand is > than the maximum ofdnvmix.tol.int.lower
and10^{-c} g_{max}
, whereg_{max}
is the theoretical maximum of the integrand andc
is the specifieddnvmix.order.lower
. Default to1e-100
and5
, respectively. dnvmix.tol.bisec
numeric
vector
of length 3 specifying bisection tolerances in the adaptive RQMC algorithm. First/second/third element specify the tolerance onu
,W
and the log-integrand and default to1e-6
,1e-1
and1e-1
, respectively.dnvmix.max.iter.bisec
numeric
, maximum number of iterations in the internal bisection procedure to find good cutting points allowed, defaults to15
.dnvmix.tol.stratlength
numeric
, nonnegative. If the stratum found by the adaptive integration method has length >dnvmix.tol.stratlength
RQMC integration is used there; otherwise a crude approximation. Defaults to1e-50
.
- For
fitnvmix()
: -
ECMEstep
logical
, ifTRUE
(default), ECME iteration is performed; ifFALSE
, no ECME step is performed so thatfitnvmix()
performs between zero and two optimizations overnu
, depending onlaststep.do.nu
and whethernu.init
was provided.ECMEstep.do.nu
logical
, ifTRUE
(default), the likelihood is maximized overnu
in each ECME iteration; ifFALSE
, this step is omitted.laststep.do.nu
logical
, ifTRUE
another last maximization of the likelihood overnu
is performed using all observations after the ECME iterations. Only makes sense if eitherECMEstep.do.nu=FALSE
or ifsize.subsample
is smaller than the number of observations. Defaults toFALSE
.resample
logical
, ifTRUE
, a different subsample ofx
is taken in each optimization overnu
in the ECME iterations. Only relevant whensize.subsample
is smaller than the number of observations. Defaults toFALSE
.ECME.miniter
,ECME.maxiter
numeric
positive, minimum and maximum number of ECME iterations. Default to5
and200
, respectively.max.iter.locscaleupdate
numeric
positive. Maximum number of location-scale updates (while heldingnu
fixed) in each individual ECME iteration; defaults to50
.weights.reltol
numeric
non-negative. Relative tolerance to estimate internal weights used to updateloc
andscale
estimates in the ECME iterations. Defaults to1e-2
.weights.interpol.reltol
numeric
non-negative. Some weights can be obtained by interpolating previously calculated weights; if the maximal relative interpolation error is smaller thanweights.interpol.reltol
, this is done. Defaults to1e-2
.ECME.rel.conv.tol
numeric(3)
vector specifying relative convergence tolerances forloc
,scale
andnu
(in this order). Defaults toc(1e-2, 1e-2, 1e-3)
.control.optim
list
of control parameters passed to the underlyingoptim
in the initial step as well as in the ECME iterations. Seeoptim()
for details; defaults tolist(maxit=75)
.control.optim.laststep
like
control.optim
; this list of control arguments is passed tooptim
in the last-step. Only relevant whenlaststep.do.nu = TRUE
and defaults tolist()
(so no defaults ofoptim()
changed).
- For
qnvmix()
: -
max.iter.newton
numeric
, maximum number of Newton iterations allowed to approximate the quantile; defaults to45
.newton.conv.abstol
numeric
, convergence tolerance for the Newton proceudre; convergence is detected once the difference of estimated quantiles in two successive iterations is smaller thannewton.conv.abstol
; defaults to5e-4
.newton.df.reltol
numeric
, relative error tolerance for estimating the univariate distribution function; defaults to2.5e-4
.newton.logdens.abstol
numeric
, absolute error tolerance for the internal estimation of the log-density needed for the update; defaults to1e-2
.newton.df.max.iter.rqmc
numeric
, maximum number of iterations to estimate the univariate distribution function required in the Newton update; defaults to350
. Note that internally used isincrement = "doubling"
, no matter what.
- For
qqplot_maha()
: -
qqplot.df.reltol
numeric
, with the same meaning asnewton.df.reltol
for the functionqnvmix()
. Defaults to5e-3
.
- For
ES_nvmix()
: -
riskmeasures.abstol, riskmeasures.reltol
-
numeric
, absolute or relative error tolerance for estimating riskmeasures, notably forES_nvmix()
. By default,riskmeasures.reltol=5e-2
andriskmeasures.abstol=NA
, so that a relative tolerance is used.
Care should be taken when changing algorithm specific parameters, notably tolerances, as the accuracy of the result is heavily influenced by those.
Value
get_set_param()
returns a list
with more
than 30 elements specifying algorithm specific parameters for the
functions fitnvmix()
, dnvmix()
,
pnvmix()
, qnvmix()
, pgammamix()
,
dgammamix()
and ES_nvmix()
, as well as the
corresponding functions for grouped mixtures such as pgnvmix()
and dgnvmix()
.
Parameter values passed to get_set_param()
via the
control
argument overwrite the defaults; for parameters not
specified in the control
argument, the default values are being
returned.
Author(s)
Erik Hintz, Marius Hofert and Christiane Lemieux
References
Hintz, E., Hofert, M. and Lemieux, C. (2020), Grouped Normal Variance Mixtures. Risks 8(4), 103.
Hintz, E., Hofert, M. and Lemieux, C. (2021), Normal variance mixtures: Distribution, density and parameter estimation. Computational Statistics and Data Analysis 157C, 107175.
Hintz, E., Hofert, M. and Lemieux, C. (2022), Multivariate Normal Variance Mixtures in R: The R Package nvmix. Journal of Statistical Software, doi:10.18637/jss.v102.i02.
See Also
fitnvmix()
, dnvmix()
,
pnvmix()
, qnvmix()
, pgammamix()
,
dgammamix()
, ES_nvmix()
Examples
get_set_param() # obtain defaults