| 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:
-
methodcharacterstring 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.
incrementcharacterstring 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.factormultiplier of the Monte Carlo confidence interval bounds. The algorithm runs until
CI.factortimes the estimated standard error is less thanabstolorreltol(whichever is provided). IfCI.factor = 3.5(the default), one can expect the actual absolute error to be less thanabstolin 99.9% of the cases.fun.evalnumeric(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.evaldefaults toc(2^7, 1e12).max.iter.rqmcnumeric, providing the maximum number of iterations allowed in the RQMC approach; the default is15ifincrement = "doubling"and1250otherwise.Bnumber of randomizations for obtaining an error estimate in the RQMC approach; the default is
15.
- For
pnvmix()andpgnvmix(): -
pnvmix.abstol,pnvmix.reltolnon-negative
numericproviding the relative/absolute precision required for the distribution function. Relative precision viapnvmix.reltolis only used whenpnvmix.abstol = NA; in all other cases, absolute precision will be used.pnvmix.abstoldefaults to1e-3. Ifpnvmix.abstol = 0andpnvmix.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(soupperhas more than one row), the algorithm runs until the precision requirement is reached for allnprobability estimates.mean.sqrt.mixexpectation 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.precondlogicalindicating whether preconditioning is applied, that is, reordering of the integration variables. IfTRUE, integration limitslower,upperas well asscaleare 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.tolnon-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 factorCare set to zero, yielding a singular matrix.cholesky.toldefaults to1e-9.
- For
dnvmix()anddgnvmix(): -
dnvmix.reltol,dnvmix.abstolnon-negative
numericproviding the relative/absolute precision for the *log-* density required. Absolute precision viadnvmix.abstolis only used whendnvmix.reltol = NA; in all other cases, relative precision will be used.dnvmix.reltoldefaults to1e-2. Ifdnvmix.reltol=0anddnvmix.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(soxhas more than one row), the algorithm runs until the precision requirement is reached for allnlog-density estimates.dnvmix.doAdaptlogicalindicating if an adaptive integration procedure shall be used that only samples in relevant subdomains of the mixing variable; defaults toTRUE.dnvmix.max.iter.rqmc.pilotnumeric, 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
numericand nonnegative. RQMC integration is only performed where the integrand is > than the maximum ofdnvmix.tol.int.lowerand10^{-c} g_{max}, whereg_{max}is the theoretical maximum of the integrand andcis the specifieddnvmix.order.lower. Default to1e-100and5, respectively. dnvmix.tol.bisecnumericvectorof length 3 specifying bisection tolerances in the adaptive RQMC algorithm. First/second/third element specify the tolerance onu,Wand the log-integrand and default to1e-6,1e-1and1e-1, respectively.dnvmix.max.iter.bisecnumeric, maximum number of iterations in the internal bisection procedure to find good cutting points allowed, defaults to15.dnvmix.tol.stratlengthnumeric, nonnegative. If the stratum found by the adaptive integration method has length >dnvmix.tol.stratlengthRQMC integration is used there; otherwise a crude approximation. Defaults to1e-50.
- For
fitnvmix(): -
ECMEsteplogical, ifTRUE(default), ECME iteration is performed; ifFALSE, no ECME step is performed so thatfitnvmix()performs between zero and two optimizations overnu, depending onlaststep.do.nuand whethernu.initwas provided.ECMEstep.do.nulogical, ifTRUE(default), the likelihood is maximized overnuin each ECME iteration; ifFALSE, this step is omitted.laststep.do.nulogical, ifTRUEanother last maximization of the likelihood overnuis performed using all observations after the ECME iterations. Only makes sense if eitherECMEstep.do.nu=FALSEor ifsize.subsampleis smaller than the number of observations. Defaults toFALSE.resamplelogical, ifTRUE, a different subsample ofxis taken in each optimization overnuin the ECME iterations. Only relevant whensize.subsampleis smaller than the number of observations. Defaults toFALSE.ECME.miniter,ECME.maxiternumericpositive, minimum and maximum number of ECME iterations. Default to5and200, respectively.max.iter.locscaleupdatenumericpositive. Maximum number of location-scale updates (while heldingnufixed) in each individual ECME iteration; defaults to50.weights.reltolnumericnon-negative. Relative tolerance to estimate internal weights used to updatelocandscaleestimates in the ECME iterations. Defaults to1e-2.weights.interpol.reltolnumericnon-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.tolnumeric(3)vector specifying relative convergence tolerances forloc,scaleandnu(in this order). Defaults toc(1e-2, 1e-2, 1e-3).control.optimlistof control parameters passed to the underlyingoptimin the initial step as well as in the ECME iterations. Seeoptim()for details; defaults tolist(maxit=75).control.optim.laststeplike
control.optim; this list of control arguments is passed tooptimin the last-step. Only relevant whenlaststep.do.nu = TRUEand defaults tolist()(so no defaults ofoptim()changed).
- For
qnvmix(): -
max.iter.newtonnumeric, maximum number of Newton iterations allowed to approximate the quantile; defaults to45.newton.conv.abstolnumeric, 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.reltolnumeric, relative error tolerance for estimating the univariate distribution function; defaults to2.5e-4.newton.logdens.abstolnumeric, absolute error tolerance for the internal estimation of the log-density needed for the update; defaults to1e-2.newton.df.max.iter.rqmcnumeric, 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.reltolnumeric, with the same meaning asnewton.df.reltolfor 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-2andriskmeasures.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