jmdem.control: Auxiliary for Controlling JMDEM Fitting

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Auxiliary function for jmdem fitting. Typically only used internally by jmdem.fit, but may be used to construct a control argument to either function.

Usage

1
2
3
4
5
6
7
jmdem.control(maxit = 100, epsilon = 1e-8, prefit.trace = FALSE, 
              fit.trace = FALSE, null.approx = 1e-8, trace = 0, 
              fnscale = -1, parscale = 1, ndeps = 0.001, 
              abstol = -Inf, reltol = sqrt(.Machine$double.eps), 
              alpha = 1, beta = 0.5, gamma = 2, REPORT = 10, 
              type = 1, lmm = 5, factr = 1e+07, pgtol = 0, 
              temp = 10, tmax = 10)

Arguments

maxit

integer giving the maximal number of optimisation iterations.

epsilon

positive convergence tolerance ε; the iterations converge when |dev - dev_{old}|/(|dev| + 0.1) < ε.

prefit.trace

logical indicating if output should be produced for each iteration in the prefit process.

fit.trace

logical indicating if output should be produced for each iteration in the jmdem.fit process.

null.approx

approximisation of zeros to avoid estimation abortion in the case of log(0) or 1/0.

The following control arguments are used by optim. Please refer to optim for details

trace

non-negative integer. If positive, tracing information on the progress of the optimisation is produced. Higher values may produce more tracing information: for method "L-BFGS-B" there are six levels of tracing.

fnscale

An overall scaling to be applied to the value of fn and gr during optimisation. If negative, turns the problem into a maximisation problem. Optimisation is performed on fn(par)/fnscale.

parscale

A vector of scaling values for the parameters. Optimisation is performed on par/parscale and these should be comparable in the sense that a unit change in any element produces about a unit change in the scaled value. Not used (nor needed) for method = "Brent".

ndeps

A vector of step sizes for the finite-difference approximation to the gradient, on par/parscale scale. Defaults to 1e-3.

abstol

The absolute convergence tolerance. Only useful for non-negative functions, as a tolerance for reaching zero.

reltol

Relative convergence tolerance. The algorithm stops if it is unable to reduce the value by a factor of reltol * (abs(val) + reltol) at a step. Defaults to sqrt(.Machine$double.eps), typically about 1e-8.

alpha, beta, gamma

Scaling parameters for the "Nelder-Mead" method. alpha is the reflection factor (default 1.0), beta the contraction factor (0.5) and gamma the expansion factor (2.0).

REPORT

The frequency of reports for the "BFGS", "L-BFGS-B" and "SANN" methods if control$trace is positive. Defaults to every 10 iterations for "BFGS" and "L-BFGS-B", or every 100 temperatures for "SANN".

type

for the conjugate-gradients ("CG") method. Takes value 1 for the Fletcher-Reeves update, 2 for Polak-Ribiere and 3 for Beale-Sorenson.

lmm

is an integer giving the number of BFGS updates retained in the "L-BFGS-B" method, It defaults to 5.

factr

controls the convergence of the "L-BFGS-B" method. Convergence occurs when the reduction in the objective is within this factor of the machine tolerance. Default is 1e7, that is a tolerance of about 1e-8.

pgtol

helps control the convergence of the "L-BFGS-B" method. It is a tolerance on the projected gradient in the current search direction. This defaults to zero, when the check is suppressed.

tmax

controls the "SANN" method. It is the starting temperature for the cooling schedule. Defaults to 10.

temp

is the number of function evaluations at each temperature for the "SANN" method. Defaults to 10.

Details

The control argument of jmdem is by default passed to the control argument of jmdem.fit, which uses its elements as arguments to jmdem.control: the latter provides defaults and sanity checking.

When trace is true, calls to cat produce the output for each iteration. Hence, options(digits = *) can be used to increase the precision, see the example.

Value

A list with components named as the arguments.

Author(s)

Karl Wu Ka Yui (karlwuky@suss.edu.sg)

References

Belisle, C.J.P. (1992). Convergence theorems for a class of simulated annealing algorithms on Rd. Journal of Applied Probability, 29, 885-895.

Byrd, R. H., Lu, P., Nocedal, J. and Zhu, C. (1995). A limited memory algorithm for bound constrained optimisation. SIAM Journal on Scientific Computing, 16, 1190-1208.

Fletcher, R. and Reeves, C.M. (1964). Function minimization by conjugate gradients. Computer Journal, 7, 148-154.

Hastie, T. J. and Pregibon, D. (1992). Generalized linear models. Chapter 6 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.

Nash, J.C. (1990). Compact Numerical Methods for Computers. Linear Algebra and Function Minimisation. Adam Hilger.

Nelder, J.A., Mead, R. (1965). A simplex algorithm for function minimization. Computer Journal, 7, 308-313.

Nocedal, J., Wright, S.J. (1999). Numerical Optimisation. Springer.

Smyth, G.K. (1989). Generalised linear models with varying dispersion. J. R. Statist. Soc. B, 51 (1), 47-60.

Smyth, G.K., Verbyla, A.P. (1999). Adjusted likelihood methods for modelling dispersion in generalised linear models. Environmetrics, 10, 695-709.

Wu, K.Y.K., Li, W.K. (2016). On a dispersion model with Pearson residual responses. Comput. Statist. Data Anal., 103, 17-27.

See Also

jmdem.fit, the fitting procedure used by jmdem.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Example in jmdem(...). Limit maximum iteration number to 20 and 
## trace the deviance development in the fitting process
MyData <- simdata.jmdem.sim(mformula = y ~ x, dformula = ~ s, 
                            mfamily = poisson(), 
                            dfamily = Gamma(link = "log"), 
                            beta.true = c(0.5, 4), 
                            lambda.true = c(2.5, 3), n = 100)
                            
fit <- jmdem(mformula = y ~ x, dformula = ~ s, data = MyData, 
             mfamily = poisson, dfamily = Gamma(link = "log"), 
             dev.type = "deviance", method = "CG",
             control = list(maxit = 20, fit.trace = TRUE))

## Change to a small convergence tolerance and trace the optimisation 
## process in optim
jmdem.control(list(epsilon = 1e-14, trace = 1))

jmdem documentation built on March 13, 2020, 2:20 a.m.

Related to jmdem.control in jmdem...