choose_mode: Choose the Mode of the Modified Skew Discrete Laplace...

View source: R/06_choose_mode.R

choose_modeR Documentation

Choose the Mode of the Modified Skew Discrete Laplace Regression

Description

Estimation of the mode in a modified skew discrete Laplace (SDL) regression fit via profile log-likelihood.

Usage

choose_mode(
  object,
  grid = -5:5,
  trace = TRUE,
  plot = TRUE,
  control = sdl_control(...),
  ...
)

## S3 method for class 'choose_mode'
print(x, ...)

## S3 method for class 'choose_mode'
plot(x, ...)

Arguments

object

an object of class "sdlrm", a result of a call to sdlrm.

grid

grid of values that will be used to evaluate the profile log-likelihood function.

trace

logical; if TRUE, a summary with the profile log-likelihood value, the AIC, and the BIC of the fit is displayed.

plot

logical; if TRUE, a graph of the profiled log-likelihood evaluated in the considered grid of values is shown.

control

a list of control arguments specified via sdl_control.

...

further arguments passed to sdl_control.

x

an object of class "choose_mode".

Value

An object of class "choose_mode". More specifically, it returns a list in which each element consists of the fit of the modified SDL regression with each value of the mode specified in grid. In addition, it has the elements “logLik” with the vector of log-likelihood values for each adjustment and “grid” with the specified grid of values.

The print function summarizes the fits by displaying, for each value in grid, the log-likelihood value and the Akaike (AIC) and Bayesian (BIC) information criteria. The plot function returns a graph of the profiled likelihood of the mode, highlighting its maximum.

Author(s)

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

References

Medeiros, R. M. R., and Bourguignon, M. (2025). Modified skew discrete Laplace regression models for integer valued data with applications to paired samples. Manuscript submitted for publication.

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 with a model only for the mean with xi = 0 (default)
fit0 <- sdlrm(difference ~ group, data = pss)

# Choosing the mode on the grid {-10, -9, ..., 0, ..., 9, 10}
fit <- choose_mode(fit0, grid = -10:10)

# Class
class(fit)

# It is possible to recovery the plot:
plot(fit)

# and the trace:
fit

# Fit with xi = 1
fit[[1]]

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