grad_Lagrangian_p: Gradient of the objective function

View source: R/objective_functions.R

grad_Lagrangian_pR Documentation

Gradient of the objective function

Description

Computes the gradient of the objective function with respect to psi at X. The gradient is used in optimization algorithms like Stochastic Gradient Descent (SGD).

Usage

grad_Lagrangian_p(
  psi,
  X,
  delta_Mu,
  delta_Nu,
  lambda,
  alpha = 0.1,
  beta = 0.05,
  centered = FALSE
)

grad_Lagrangian_p_X(
  psi_X,
  delta_Mu_X,
  delta_Nu_X,
  lambda,
  alpha = 0.1,
  beta = 0.05,
  centered = FALSE
)

Arguments

psi

A function that takes an input X and returns a numeric vector with values in the range ⁠[-1,1]⁠.

X

A matrix of covariates of size n x d (input data in ⁠[0,1]⁠).

delta_Mu

A function of X that determines the contrast between primary outcomes.

delta_Nu

A function of X that determines the contrast between adverse event outcomes.

lambda

A non-negative numeric scalar controlling the penalty for violating the constraint.

alpha

A numeric scalar representing the constraint tolerance (in ⁠[0,1/2]⁠, 0.1 by default).

beta

A non-negative numeric scalar controlling the sharpness of the probability function (0.05 by default).

centered

A logical value indicating whether to apply centering in sigma_beta (FALSE by default).

psi_X

The function psi evaluated at X (numeric vector).

delta_Mu_X

The function delta_Mu evaluated at X (numeric vector).

delta_Nu_X

The function delta_Nu evaluated at X (numeric vector).

Value

A numeric vector representing the gradient of the objective function with respect to psi(X).


PLUCR documentation built on March 30, 2026, 5:08 p.m.