Papers
Topics
Authors
Recent
Search
2000 character limit reached

TWICE Methods: Dual Penalization & Wage Inference

Updated 5 July 2026
  • TWICE is a term for two distinct dual-structured methods that leverage complementary penalties to stabilize estimation in asymmetric datasets and wage modeling.
  • The twice-penalized P-spline approach integrates a traditional roughness penalty with a marginal alignment penalty to accurately model overlapping asymmetric datasets.
  • The tree-based wage inference framework uses observable clustering of workers and firms to decompose wage variance and overcome limitations of standard fixed-effects models.

TWICE denotes two distinct methodological constructions in recent arXiv literature. In one usage, TWICE is the acronym for Tree-based Wage Inference with Clustering and Estimation, a framework for modeling conditional wage functions from observables with gradient-boosted trees, observable-anchored worker and firm partitions, and a variance decomposition that includes sorting and non-additive interactions (Bakirov et al., 2 Jan 2026). In another usage, “twice” refers to a twice-penalized P-spline approach for handling overlapping asymmetric datasets, where a flexible regression on a smaller cohort is regularized both by a customary P-spline roughness penalty and by a second penalty that aligns horizontal-cohort marginals with information learned from a larger cohort (McTeer et al., 2023). The two methods are unrelated in application domain, but both are organized around a dual-regularization or dual-structure idea: one combines tree ensembles with clustering and estimation, while the other combines smoothing with marginal alignment.

1. Terminological scope and problem classes

The two uses of TWICE arise from different statistical problems. McTeer et al. study overlapping asymmetric datasets, motivated by healthcare settings in which “a small amount of information” may be available for a larger number of patients, while “a small number of patients may have had extensive further testing” (McTeer et al., 2023). Their objective is to model the smaller cohort against a response while considering the larger cohort, without relying on missing data imputation when the smaller cohort is “significantly different in scale to the larger sample.”

Bakirov, Del Prato, and Zacchia define TWICE explicitly as Tree-based Wage Inference with Clustering and Estimation (Bakirov et al., 2 Jan 2026). Their setting is matched worker–firm panel data with log wages Yit=lnwitY_{it}=\ln w_{it}, worker covariates ZitZ_{it}, and firm covariates XjX_j. The framework is proposed against a background in which standard latent fixed-effects approaches depend on worker mobility, enforce additivity, and may produce decompositions with limited interpretability.

These two constructions therefore address different inferential objects. The twice-penalized P-spline targets a predictive function on an asymmetric, partially overlapping data structure. TWICE in wage inference targets the conditional-expectation function m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it}) and then projects that function onto observable worker and firm partitions. A plausible implication is that the commonality in naming is methodological rather than substantive: both use a “two-part” architecture to stabilize estimation under structural asymmetry.

2. Twice-penalized P-spline methodology for overlapping asymmetric datasets

The twice-penalized P-spline approach is formulated around a B-spline basis and a penalized objective on the smaller “horizontal” cohort HH (McTeer et al., 2023). Let xx and zz lie in [a,b][a,b], with an ordered knot sequence t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}, where qq is the B-spline order and ZitZ_{it}0 is the number of interior segments. The Cox–de Boor recursion defines B-splines ZitZ_{it}1, and the design matrix ZitZ_{it}2 is constructed either additively, with separate bases in ZitZ_{it}3 and ZitZ_{it}4, or as a tensor-product basis ZitZ_{it}5 when interactions are allowed.

The central objective is to estimate ZitZ_{it}6 so that ZitZ_{it}7 fits ZitZ_{it}8 in the small cohort while enforcing two regularization criteria. The first uses the customary P-spline roughness matrix ZitZ_{it}9, for example XjX_j0 with a finite-difference operator of order XjX_j1. The second uses a matrix XjX_j2 that maps XjX_j3 to estimated horizontal-cohort marginals on a grid XjX_j4, together with XjX_j5, the vector of marginal fits from the large “vertical” cohort XjX_j6. The criterion is

XjX_j7

For continuous responses, the estimator has the closed form

XjX_j8

with XjX_j9. For binary responses, the method maximizes a penalized log-likelihood with m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})0 and fits the model by penalized iteratively weighted least squares, specifically Newton–Raphson or Fisher scoring. The gradient is

m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})1

and the Hessian includes the usual GLM curvature term together with the two penalty contributions.

The second penalty is the distinctive component. It is created “through discrepancies in the marginal value of covariates that exist in both the smaller and larger cohorts” (McTeer et al., 2023). This makes the approach different from a once-penalized P-spline: the estimator is not only smoothed, but also pulled toward consistency with a marginal structure learned from the larger cohort.

3. Tuning, identifiability, and empirical behavior of the twice-penalized P-spline

The two tuning parameters have distinct roles. m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})2 is chosen by K-fold cross-validation in the horizontal cohort m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})3, cycling through a grid of m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})4 and selecting the value that optimizes one of several held-out criteria: sum of squares, penalized log-likelihood, or AUC for binary m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})5 (McTeer et al., 2023). m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})6 is then selected over a modest grid m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})7 by requiring either a prescribed reduction in the marginal discrepancy m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})8, such as 50%, or the absolute best marginal fit. In simulated or real NAFLD data, the paper reports m0(XJ(i,t),Zit)m_0(X_{J(i,t)},Z_{it})9 when HH0.

Theoretical properties are stated in terms of the bias–variance trade-off, identifiability, and convergence. HH1 controls smoothness of HH2, while HH3 controls bias–variance in the marginal alignment. Two separate penalties “ensure one does not collapse into the other,” and HH4 is full rank after adding a small ridge if necessary. Convergence is immediate in the continuous case because of the closed-form estimator, while local convergence for the binary case is guaranteed under standard GLM regularity conditions.

The empirical results reported in the paper are substantial. In simulations with HH5, noise HH6, with or without HH7–HH8 interaction, and HH9 knots, the twice-penalized fit (“Fit 2”) reduced the sum of squares of the marginal curve by 40–90% over the single-penalty P-spline (“Fit 1”) and by even more relative to an unpenalized B-spline linear model (“Fit 0”) (McTeer et al., 2023). Applied to NAFLD registry data with xx0 patients and xx1 patients, a binary “At-Risk NASH” outcome, 19 routine covariates in xx2, and 37 genomic covariates in xx3, the method achieved xx4 reduction in marginal-SS across linear predictor, PCA, and tSNE dimension-reduction schemes, and xx5 improvement in AUC versus standard P-splines. The authors characterize this as a flexible and numerically stable way to borrow “vertical” cohort accuracy into a smoother “horizontal” cohort fit, without imputation.

4. TWICE as Tree-based Wage Inference with Clustering and Estimation

In the wage-inequality setting, TWICE begins from the conditional-expectation model

xx6

and estimates xx7 with a gradient-boosted tree ensemble (Bakirov et al., 2 Jan 2026). The fitted predictor is

xx8

where each tree partitions the feature space into leaves and assigns each leaf a constant score. Estimation minimizes a regularized squared-error objective

xx9

with

zz0

Here zz1 penalizes the number of leaves and zz2 shrinks leaf weights toward zero; early stopping, learning-rate control, maximum depth, and minimum leaf-size constraints are used for regularization.

The framework then constructs observable-anchored partitions rather than latent worker and firm effects. For firms, TWICE computes each firm-year’s mean log wage zz3 and fits a single regression tree of depth zz4 to predict zz5 from zz6. The zz7 terminal leaves define firm-cells zz8. For workers, it aggregates each worker to mean log wage zz9 and mean covariates [a,b][a,b]0, then fits a depth-[a,b][a,b]1 tree to predict [a,b][a,b]2 from [a,b][a,b]3. The [a,b][a,b]4 leaves define worker-cells [a,b][a,b]5. At each observation [a,b][a,b]6, assignment uses the period-specific [a,b][a,b]7, so workers may move between leaves over time.

With [a,b][a,b]8 and [a,b][a,b]9 fixed, the final predictor is estimated via LightGBM using raw covariates t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}0 together with one-hot indicators of worker-cell and firm-cell membership. The procedure is therefore a hybrid of nonparametric prediction and structured discretization: tree ensembles recover nonlinearities in the conditional wage function, while the worker and firm partitions create an interpretable representation of two-sided heterogeneity.

5. Cross-fitting, decomposition, and relation to AKM in TWICE

A defining estimation feature of TWICE is two-way ID-blocked cross-fitting (Bakirov et al., 2 Jan 2026). Worker IDs are partitioned into t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}1 blocks t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}2, firm IDs into t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}3 blocks t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}4, and for each pair t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}5 the validation set is

t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}6

Training excludes any data with the same worker or firm as those in t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}7, and the blocked MSE

t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}8

is minimized over a grid in t1t2tm+qt_1\le t_2\le\cdots\le t_{m+q}9. The final model is retrained on all training data with the selected qq0 and evaluated on an external firm-level holdout set.

The fitted ensemble induces predicted cell means

qq1

which are decomposed as

qq2

The pair qq3 solves a weighted two-way least-squares projection using cell probabilities qq4, and the interaction term qq5 is orthogonal to both additive components by construction. Defining

qq6

TWICE yields the exact variance decomposition

qq7

The comparison benchmark is the canonical AKM model

qq8

Bakirov, Del Prato, and Zacchia emphasize two AKM limitations: additivity, which rules out complementarities, and limited-mobility bias, under which sparse job-switching networks inflate qq9 and attenuate estimated sorting ZitZ_{it}00 (Bakirov et al., 2 Jan 2026). TWICE addresses these by replacing latent effects with observable partitions, allowing explicit non-additivity ZitZ_{it}01, and accepting a trade-off: it gives up some ability to capture purely idiosyncratic unobservables in exchange for robustness to sampling noise and out-of-sample portability.

6. Empirical results and interpretability diagnostics in TWICE

The empirical application uses Portuguese administrative data, combining Quadros de Pessoal and SCIE over 2012–2019, restricted to full-time workers aged 20–65 at firms with at least five employees and to the largest mobility-connected set (Bakirov et al., 2 Jan 2026). The sample contains approximately 3.4 million worker-years, 750,000 workers, and 96,000 firms. On an external firm-holdout test, TWICE with two-way cross-fitted LightGBM and worker-plus-firm cells achieves Test MSE ZitZ_{it}02 and Test ZitZ_{it}03, whereas a flexible OLS benchmark with age polynomials attains Test ZitZ_{it}04.

The variance decomposition shares are reported as follows:

Component TWICE share Comparison values
Worker 27.6% AKM: 59%; Bonhomme and Manresa (2019): 50%
Firm 8.7% AKM: 20%; Bonhomme and Manresa (2019): 5%
Sorting 11.6% AKM: 7%; Bonhomme and Manresa (2019): 20%
Interaction 7.3% AKM: none; Bonhomme and Manresa (2019): none
Residual 44.8% AKM: 14%; Bonhomme and Manresa (2019): 25%

These figures support the paper’s central substantive claim that sorting is quantitatively important and that non-additive interactions are nonzero (Bakirov et al., 2 Jan 2026). The interaction share is “modest (7.3%)” but present, while sorting is larger than in AKM on the same sample.

Interpretability is provided through Partial Dependence Plots and Accumulated Local Effects. The paper reports that age–wage PDPs by worker qualification and education show standard concave profiles, gender gaps, and steeper slopes for managers; tenure ALEs reveal a brief probationary dip at very low tenure followed by sustained firm-specific returns; and firm-size PDPs conditional on productivity are flat, suggesting that the canonical size premium largely reflects sorting on productivity and workforce composition rather than size per se (Bakirov et al., 2 Jan 2026). The framework also compares observable partitions to AKM fixed effects using ZitZ_{it}05, the fraction of AKM effect-variance explained by TWICE cell membership, finding ZitZ_{it}06 for workers and ZitZ_{it}07 for firms on an observation-weighted basis.

7. Comparative significance and future directions

The two TWICE-related methods occupy different positions in contemporary statistical methodology. The twice-penalized P-spline approach is framed as, to the authors’ knowledge, “the first work to propose additional marginal penalties in a flexible regression” for asymmetric datasets, and it is explicitly motivated by avoiding missing data imputation while incorporating information from a larger cohort (McTeer et al., 2023). Its future work includes adaptation “to not require dimensionality reduction” and extension to “parametric modelling methods.” This suggests a broader agenda in which the second penalty might be embedded in richer semiparametric or multivariate structures.

TWICE in wage inference is positioned as an alternative to latent fixed-effects decompositions. Its contribution is to model the wage CEF directly from observables, to cluster workers and firms into interpretable cells, and to decompose wage dispersion into worker, firm, sorting, interaction, and residual components (Bakirov et al., 2 Jan 2026). The authors emphasize that this replaces latent effects with observable-anchored partitions and thereby trades off the ability to capture idiosyncratic unobservables for robustness to sampling noise and out-of-sample generalization.

Taken together, these two usages illustrate different meanings of “TWICE” in current quantitative research. In one case, the term denotes a dual-penalty smoothing architecture for overlapping asymmetric datasets. In the other, it denotes a tree-based inferential framework for wage inequality decomposition. The shared conceptual thread is the deliberate introduction of a second structural layer—marginal alignment in one case, clustered observable heterogeneity in the other—to address limitations of simpler one-stage estimators.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to TWICE.