dot-fps_compute_weights: Internal dual formulation weight estimator

.fps_compute_weightsR Documentation

Internal dual formulation weight estimator

Description

Estimates functional propensity score (FPS) weights by maximising the empirical likelihood subject to covariate-balancing constraints and solving the resulting dual problem. The dual reduces to minimising log(sum_i exp(-theta' g_i)) over the unconstrained parameter vector theta, where g_i = [A_i, C_i, vec(A_i C_i')] stacks the balancing moments. The optimisation is solved via the BFGS quasi-Newton algorithm and uses the log-sum-exp trick for numerical stability.

Usage

.fps_compute_weights(
  treat_scores,
  conf_matrix,
  normalize = TRUE,
  tol = 1e-08,
  maxit = 1000
)

Arguments

treat_scores

n x L numeric matrix of FPC scores for the treatment.

conf_matrix

n x p numeric matrix of confounders (scalar + FPC scores of functional covariates).

normalize

Logical. If TRUE (default), standardise A and C before building g_i.

tol

Relative convergence tolerance for optim (default 1e-8).

maxit

Maximum number of BFGS iterations (default 1000).

Value

A named list:

weights

Numeric vector of length n. Positive, sums to 1.

theta

Optimal dual parameter vector.

convergence

Convergence code from optim (0 = success).

value

Optimal dual objective value.


FPScausal documentation built on Aug. 9, 2026, 9:07 a.m.