seg.control {segmented} | R Documentation |
Auxiliary for controlling segmented/stepmented model fitting
Description
Auxiliary function as user interface for 'segmented' and 'stepmented' fitting. Typically only used when calling any 'segmented' or 'stepmented' method.
Usage
seg.control(n.boot=10, display = FALSE, tol = 1e-05, it.max = 30, fix.npsi=TRUE,
K = 10, quant = FALSE, maxit.glm = NULL, h = 1.25, break.boot=5, size.boot=NULL,
jt=FALSE, nonParam=TRUE, random=TRUE, seed=NULL, fn.obj=NULL, digits=NULL,
alpha = NULL, fc=.95, check.next=TRUE, tol.opt=NULL, fit.psi0=NULL, eta=NULL,
min.nj=2)
Arguments
n.boot |
number of bootstrap samples used in the bootstrap restarting algorithm. If 0 the standard algorithm,
i.e. without bootstrap restart, is used. Default to 10 that appears to be sufficient in most of problems. However
when multiple breakpoints have to be estimated it is suggested to increase |
display |
logical indicating if the value of the objective function should be printed along with current breakpoint estimates at each iteration or at each bootstrap resample (but no more than 5 breakpoints are printed). If bootstrap restarting is employed, the values of objective and breakpoint estimates should not change at the last runs. |
tol |
positive convergence tolerance. |
it.max |
integer giving the maximal number of iterations. |
fix.npsi |
logical (it replaces previous argument |
K |
the number of quantiles (or equally-spaced values) to supply as starting values for the breakpoints
when the |
quant |
logical, indicating how the starting values should be selected. If |
maxit.glm |
integer giving the maximum number of inner IWLS iterations (see details). If |
h |
positive factor modifying the increments in breakpoint updates during the estimation process (see details). |
break.boot |
Integer, less than |
size.boot |
the size of the bootstrap samples. If |
jt |
logical. If |
nonParam |
if |
random |
if |
seed |
The seed to be passed on to |
fn.obj |
A character string to be used (optionally) only when |
digits |
optional. If specified it means the desidered number of decimal points of the breakpoint to be used during the iterative algorithm. |
alpha |
optional numerical values. The breakpoints are estimated within the quantiles |
fc |
A proportionality factor ( |
check.next |
logical, effective only for stepmented fit. If |
tol.opt |
Numerical value to be passed to |
fit.psi0 |
Possible list including preliminary values. |
eta |
Only for segmented/stepmented fits: starting values to be passed to |
min.nj |
How many observations (at least) should be in the covariate intervals induced by the breakpoints? |
Details
Fitting a ‘segmented’ GLM model is attained via fitting iteratively standard GLMs. The number of (outer)
iterations is governed by it.max
, while the (maximum) number of (inner) iterations to fit the GLM at
each fixed value of psi is fixed via maxit.glm
. Usually three-four inner iterations may be sufficient.
When the starting value for the breakpoints is set to NA
for any segmented variable specified
in seg.Z
, K
values (quantiles or equally-spaced) are selected as starting values for the breakpoints.
Since version 0.2-9.0 segmented
implements the bootstrap restarting algorithm described in Wood (2001).
The bootstrap restarting is expected to escape the local optima of the objective function when the
segmented relationship is noisy and the loglikelihood can be flat. Notice bootstrap restart runs n.boot
iterations regardless of tol
that only affects convergence within the inner loop.
Value
A list with the arguments as components.
Author(s)
Vito Muggeo
References
Muggeo, V.M.R., Adelfio, G. (2011) Efficient change point detection in genomic sequences of continuous measurements. Bioinformatics 27, 161–166.
Wood, S. N. (2001) Minimizing model fitting objectives that contain spurious local minima by bootstrap restarting. Biometrics 57, 240–244.
Examples
#decrease the maximum number inner iterations and display the
#evolution of the (outer) iterations
#seg.control(display = TRUE, maxit.glm=4)