Optimization_Estimation: Iterative optimization procedure

View source: R/alternated_procedure.R

Optimization_EstimationR Documentation

Iterative optimization procedure

Description

This function performs an iterative optimization routine to correct and minimize the objective function. It iteratively finds a solution and corrects the objective function for such optimal solution, until two consecutive solutions do not change much.

Usage

Optimization_Estimation(
  mu0,
  nu0,
  prop_score,
  X,
  A,
  Y,
  Xi,
  lambda,
  alpha = 0.1,
  precision = 0.05,
  beta = 0.05,
  centered = FALSE,
  tol = 2.5 * 0.01,
  max_iter = 5
)

Arguments

mu0

A fold-specific function predicting primary outcome (Y) given treatment (A) and covariates (X).

nu0

A fold-specific function predicting adverse event outcome (Xi) given treatment (A) and covariates (X).

prop_score

A function that estimates the propensity score given treatment (A) and covariates (X).

X

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

A

A binary vector or matrix of length n indicating treatment assignment (0 or 1).

Y

A numeric vector or matrix of length n representing primary outcomes (in ⁠[0,1]⁠).

Xi

A numeric vector or matrix of length n indicating adverse events (0 or 1).

lambda

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

alpha

A numeric scalar representing the constraint tolerance (0.1 by default).

precision

A numeric scalar defining the desired convergence precision (0.05 by default). The number of Frank-Wolfe iterations (K) is inversely proportional to this value, calculated as 1/precision.

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).

tol

A numeric scalar used as an early stopping criterion based on the RMSE between consecutive solutions (0.025 by default).

max_iter

A numeric scalar specifying the maximum number of iterations (5 by default).

Details

This function saves intermediate results to files in order to recover progress or inspect iteration-level behavior. If the optimization converges or the maximum number of iterations is reached, the final parameter vector theta_init is saved.

Value

A list containing:

iter

The number of completed iterations.

offset_mu

Initial logit-transformed outcome predictions.

offset_nu

Initial logit-transformed auxiliary predictions.

psi_collection

Matrix of covariate projections across iterations.

sigma_psi_collection

Matrix of transformed projections across iterations.

epsilon1

GLM coefficients from the outcome model.

epsilon2

GLM coefficients from the auxiliary model.

theta_collection

List of parameter vectors from each iteration of the functional weight estimation.


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