Learn R Programming

glmSTARMA (version 1.0.0)

glmstarma.control: Control Parameters for glmstarma Fitting

Description

List of control parameters to be passed as an an argument to glmstarma.

Usage

glmstarma.control(
  parameter_init = "zero",
  init_link = "first_obs",
  dispersion_est_type = "deviance",
  use_sparsity = TRUE,
  sparsity_threshold = 2/3,
  method = "nloptr",
  constrained = TRUE,
  constraint_tol = 1e-08,
  constrain_method = "sum_of_absolutes",
  gradtol = sqrt(.Machine$double.eps),
  changetol = sqrt(.Machine$double.eps),
  trace = 0L,
  fnscale = 1,
  maxit = 10000L,
  abstol = -Inf,
  reltol = sqrt(.Machine$double.eps),
  lmm = 5,
  factr = 1e+07,
  pgtol = 0
)

Value

A named list of control parameters

Arguments

parameter_init

Character or list. Start values for parameter estimation. See details.

init_link

Character or matrix, specifing how to initialize the linear process of the mean model, if regression on the feedback process is included.

  • "first_obs": Use the first (transformed) observed values at each location.

  • "mean": Use the mean of the (transformed) observed values at each location.

  • "transformed_mean": Calculates the mean of the obsverved values at each location and transforms it by the link function.

  • "zero": Use zero as initial value.

  • (numeric matrix) specifying starting values (rows = location, columns = time, must match maximum temporal order of model)

dispersion_est_type

Character. Estimation of global dispersion parameter either based on deviance ("deviance") or pearson residuals ("pearson"), if applicable.

use_sparsity

Logical; whether to use sparse matrices for the neighborhood matrices.

sparsity_threshold

Numeric in \([0, 1]\). Threshold for proportion of non-zero elements for considering neighborhood matrices as sparse (default: 2/3).

method

Character. Optimization method to be used. Options are:

  • "nloptr" (requires nloptr, default),

  • "optim" (base R optim)

constrained

Logical; whether to use parameter constraints ensuring a stationary solution. Only works with method = "nloptr".

constraint_tol

Numeric. Tolerance for constraint satisfaction.

constrain_method

Character. Method for applying parameter constraints.

  • "sum_of_absolutes": Sum of absolute values of parameters is constrained

  • "absolute_sum": Absolute sum of parameters is constrained. (only intended for univariate models)

  • "soft": Constraints for "softplus" and "softclipping" link functions (not available for different link functions).

gradtol

Numeric. Tolerance for gradient convergence. See details.

changetol

Numeric. Tolerance for parameter change convergence. See details.

trace

Integer. Level of tracing output. See details.

fnscale

Numeric. Scaling factor for the objective function. See details.

maxit

Integer. Maximum number of iterations. See details.

abstol

Numeric. Absolute convergence tolerance. See details.

reltol

Numeric. Relative convergence tolerance. See details.

lmm

Integer. Limited-memory BFGS parameter. See details.

factr

Numeric. Factor for controlling the convergence tolerance. See details.

pgtol

Numeric. Tolerance for projected gradient convergence. See details.

Details

This function is called internally in glmstarma to validate control parameters in the control argument.

The arguments constraint_tol, gradtol, changetol, trace, fnscale, maxit, abstol, reltol, lmm, factr, and pgtol are passed to the optimization routines and control the convergence behavior and output. Some of these arguments are not used by all optimization methods.

The optim method uses the L-BFGS-B algorithm when non-negative parameters are required, otherwise the BFGS algorithm is used. Stationarity constraints cannot be applied when using optim. Only if method = "nloptr" stationarity constraints are supported, and the specified constrain_method is applied. For optimization we use the SLSQP routine. The constraints implied by constrain_method are given by:

  • "sum_of_absolutes": $$\sum_{i = 1}^q\sum_{\ell = 0}^{a_i} | \alpha_{i\ell} | + \sum_{j = 1}^r \sum_{\ell = 0}^{b_j} | \beta_{j\ell} | \leq 1$$

  • "absolute_sum": $$\left|\sum_{i = 1}^q\sum_{\ell = 0}^{a_i} \alpha_{i\ell} + \sum_{j = 1}^r \sum_{\ell = 0}^{b_j} \beta_{j\ell} \right| \leq 1$$

  • "soft": $$\sum_{i = 1}^q\sum_{\ell = 0}^{a_i} \max \lbrace 0, \alpha_{i\ell} \rbrace + \sum_{j = 1}^r \sum_{\ell = 0}^{b_j} \max\lbrace0, \beta_{j\ell}\rbrace \leq 1$$ and $$\sum_{i = 1}^q\sum_{\ell = 0}^{a_i} | \alpha_{i\ell} | < 1$$

Start values for the optimization can be provided as a named list via parameter_init or as a character. If a named list is provided, these must match the model orders, see glmstarma.sim. Otherwise, parameter_init must be one of the following:

  • "zero": All parameters initialized to (near) zero. If parameters must be non-negative a small value within the feasible region is used.

  • "random": All parameters initialized to random values in the stationary region of the model.

In case of a negative binomial family, the global dispersion parameter is always estimated using dispersion_est_type = "pearson". It corresponds to the shape parameter of the negative binomial distribution.

See Also

glmstarma, nloptr, optim

Examples

Run this code
# \donttest{
dat <- load_data("chickenpox", directory = tempdir())
chickenpox <- dat$chickenpox
population_hungary <- dat$population_hungary
W_hungary <- dat$W_hungary

model_autoregressive <- list(past_obs = rep(1, 7))
glmstarma(chickenpox, model_autoregressive, W_hungary, family = vpoisson("log"), 
          control = list(parameter_init = "random", init_link = "mean"))
# }

Run the code above in your browser using DataLab