l2_balance_internal: Re-weight data to a target with local and global constraints

View source: R/balance_l2.R

l2_balance_internalR Documentation

Re-weight data to a target with local and global constraints

Description

Re-weight data to a target with local and global constraints

Usage

l2_balance_internal(
  Xz,
  targetz,
  lambda = 0,
  lowlim = 0,
  uplim = 1,
  scale_sample_size = T,
  exact_global = T,
  target_propz = NULL,
  verbose = TRUE,
  eps_abs = 1e-05,
  eps_rel = 1e-05,
  ...
)

Arguments

Xz

length J list of n_j x d matrix of covariates for each group j

targetz

length J list of d-dimensional vectors of targets for each group j

lambda

Regularization hyper parameter, default 0

lowlim

Lower limit on weights, default 0

uplim

Upper limit on weights, default 1

scale_sample_size

Whether to scale the dispersion penalty by the sample size of each group, default T

exact_global

Whether to enforce exact balance for overall population

target_propz

J-dimensional vector of group proportions in the target population, must not be NULL if exact_global is TRUE

verbose

Whether to show messages, default T

eps_abs

Absolute error tolerance for solver

eps_rel

Relative error tolerance for solver

...

Extra arguments for osqp solver

Value

vector of weights solving balancing optimization problem


ebenmichael/balancer documentation built on Jan. 17, 2024, 2:56 p.m.