sdl_control: Optimization Control Parameters Passed to optim

View source: R/03_mle.R

sdl_controlR Documentation

Optimization Control Parameters Passed to optim

Description

Optimization parameters passed to optim for the fit of an modified skew discrete Laplace (SDL) regression model via sdlrm. This function acts in the same spirit as betareg.control from the betareg package. Its primary purpose is to gather all the optimization control arguments in a single function.

Usage

sdl_control(
  method = "BFGS",
  maxit = 8000,
  hessian = FALSE,
  start = NULL,
  reltol = 1e-10,
  ...
)

Arguments

method

the method to be used. See "Details" in optim. The default method ("BFGS") is a quasi-Newton method (also known as a variable metric algorithm), specifically that published simultaneously in 1970 by Broyden, Fletcher, Goldfarb and Shanno.

maxit

the maximum number of iterations of the algorithm. Defaults to 2000.

hessian

logical. Should a numerically differentiated Hessian matrix be returned?

start

an optional vector with starting values for all parameters for fitting an SDL regression model. It must be passed in the order: (beta, gamma), where beta and gamma are regression coefficients associated with the mean and dispersion regression submodels, respectively.

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 1e-10.

...

further arguments to be passed to optim.

Value

A list with the arguments specified.

Author(s)

Rodrigo M. R. de Medeiros <rodrigo.matheus@ufrn.br>

References

Cribari-Neto, F., and Zeileis, A. (2010). Beta regression in R. Journal of statistical software, 34, 1-24.

Examples

# Data set: pss (for description run ?pss)
barplot(table(pss$difference), xlab = "PSS index difference", ylab = "Frequency")
boxplot(pss$difference ~ pss$group, xlab = "Group", ylab = "PSS index difference")

## Fit of the model using the Fisher information matrix to obtain the covariance
## matrix of the coefficients
fit1 <- sdlrm(difference ~ group, data = pss, xi = 1)

## Fit of the model using the numerical Hessian matrix provided by optim
fit2 <- sdlrm(difference ~ group, data = pss, xi = 1, hessian = TRUE)

## Compare the reported standard errors
summary(fit1)
summary(fit2)

sdlrm documentation built on April 12, 2025, 1:15 a.m.