Learn R Programming

SelectBoost.beta (version 0.4.5)

betareg_step_aic: Stepwise Beta regression by AIC

Description

Fits a Beta regression with optional joint selection of the mean and precision (phi) submodels using betareg::betareg(). The routine performs greedy forward/backward search using the requested information criterion and returns coefficients aligned with the supplied design matrix. The selectors currently target the mean submodel only, require complete cases, and do not expose offsets. Observation weights are passed through to betareg() when provided.

Usage

betareg_step_aic(
  X,
  Y,
  direction = "both",
  link = "logit",
  link.phi = "log",
  type = "ML",
  trace = FALSE,
  max_steps = NULL,
  epsilon = 1e-08,
  X_phi = NULL,
  direction_phi = c("none", "both", "forward", "backward"),
  weights = NULL
)

Value

Named numeric vector of length p_mean + p_phi + 1 containing the intercept, mean coefficients, phi-intercept (prefixed by "phi|"), and phi coefficients (also prefixed by "phi|"). Non-selected variables have coefficient 0.

Arguments

X

Numeric matrix (n × p) of mean-submodel predictors.

Y

Numeric response in (0,1). Values are squeezed to (0,1) internally.

direction

Stepwise direction for the mean submodel: "both", "forward", or "backward".

link

Link for the mean submodel (passed to betareg). Default "logit".

link.phi

Link for precision parameter. Default "log".

type

Likelihood type for betareg, e.g. "ML".

trace

Logical; print stepwise trace.

max_steps

Integer; maximum number of greedy steps (default p).

epsilon

Numeric; minimum improvement required to accept a move (default 1e-8).

X_phi

Optional matrix of candidate predictors for the precision (phi) submodel. When direction_phi enables precision updates and X_phi is NULL, the function reuses X.

direction_phi

Stepwise direction for the precision submodel. Defaults to "none" (no phi selection). Supported values mirror direction.

weights

Optional non-negative observation weights passed to betareg().

See Also

betareg::betareg()

Examples

Run this code
set.seed(1)
X <- matrix(rnorm(200), 100, 2);
Y <- plogis(0.5 + X[,1]-X[,2]);
betareg_step_aic(X, Y)
Y <- rbeta(100, Y*20, (1-Y)*20)
betareg_step_aic(X, Y)

Run the code above in your browser using DataLab