Introduction
Estimating heterogeneous treatment effects (HTE) is essential for optimizing personalized interventions. While standard approaches typically condition on observable covariates, treatment effects in many real-world applications are fundamentally modified by unobserved latent classes. For example, despite an insignificant overall mortality effect, Famous et al. [20 ] identified distinct treatment responses across latent classes of acute respiratory distress syndrome. As another example, Lyu et al. [28 ] found that educational interventions varied across latent student types. Beyond static classes, the relevant latent context often evolves over time. In clinical data, neurostimulation responses have been linked to transient seizure-risk states inferred via hidden Markov models (HMMs) [16 ] . Similarly, HMMs have been applied to track evolving buyer–seller relationships to evaluate state-dependent marketing strategies [47 ] . Other applications of dynamic states include digital health [32 , 12 ] and student learning [17 ] . These examples highlight the need to understand treatment effect heterogeneity with respect to latent classes and/or dynamic states.
This work is motivated by a large-scale industry application at Netflix. A core hypothesis driving this work is that users’ behavior at Netflix ebbs and flows according to dynamic user moods. For instance, users can shift between a discovery state, where they are actively looking for new content, and a nostalgic state, where they default to familiar content that they have watched before. In turn, these states should shape a user’s receptiveness to algorithmic recommendations.
We propose a two-step framework that decouples latent class learning from causal effect estimation. Specifically, we train a latent class model on pre-treatment data to infer underlying states. At Netflix, we train an HMM on pre-treatment user behavioral histories using an independent sample of users disjoint from the experimental cohort to infer dynamic latent states. Leveraging the resulting state posteriors, we can mathematically unmix the observable conditional effects to estimate the true average treatment effect (ATE) within each latent state.
Our contributions are threefold:
Framework: We show how to identify state average treatment effects from posteriors supplied by an independent latent class model, and formally characterize the asymptotic bias inherent in naive “hard” assignment and “soft” posterior-weighting estimators. We further characterize what the estimator targets when the identifying assumptions are violated.
Orthogonal Estimation: We adapt the classical two-step orthogonal score adjustment to posterior unmixing. By augmenting the moment equation with a correction term calculated from the HMM’s likelihood score, our approach cancels first-order sensitivity to HMM fitting error and supports standard influence-function confidence intervals.
Large-Scale Empirical Application: We apply this methodology to a real-world, large-scale A/B test at Netflix. Our latent-state analysis reveals that heavy-engagement users show significantly positive effects across treatments, with limited evidence of benefit among inactive or rewatch-oriented users.
Related Works
Heterogeneous Treatment Effects. Estimating heterogeneous treatment effects is an important problem in causal inference. Athey and Imbens [2 ] and Wager and Athey [41 ] use causal trees and forests to learn the conditional average treatment effect (CATE) with respect to observed covariates. Another line of work proposes meta-learners that can use any machine-learning method to estimate the CATE ([24 , 18 , 36 , 22 , 26 ] ). Many works also look at HTEs with respect to learned covariates, such as the propensity score ([45 ] ), predicted baseline outcome or risk scores ([1 , 13 ] ), and ML predictions of the CATE itself ([15 ] ). We instead target treatment effects within latent classes that are not observed and so cannot be inferred from the outcome, treatment, and covariate data alone.
Latent Variables for Causal Identification. A separate literature uses latent-variable models to address unobserved or imperfectly measured confounding in observational data through proxy measurement models ([25 ] ), deep generative models ([27 , 48 , 49 ] ), matrix factorization ([21 ] ), or balancing over latent-confounder distributions ([6 , 7 ] ). Other approaches model latent mediators for front-door adjustment ([46 ] ), or use factor models for shared confounding across multiple causes ([42 , 43 , 30 ] ), including longitudinal treatment assignments ([9 ] ). Causal identification in these settings requires substantive assumptions beyond fitting the observed distribution ([19 , 37 ] ). We here assume treatment is randomized, immediately yielding identification of average effects. We instead use latent variables to analyze effect heterogeneity.
Treatment Effects for Latent Subgroups. One-step approaches jointly model classes and outcomes or treatment in observational ([23 , 28 ] (Bartuolucci et al. 2016)) or experimental ([38 ] ) data, so fitted classes can depend on the outcome or treatment contrast. Stepwise approaches first fit a measurement model; bias-adjusted three-step methods then correct class misclassification when relating classes to external variables [11 , 39 , 3 ] . We similarly separate class learning from effect estimation, but learn classes from pre-treatment covariates and unmix randomized treatment effects using posteriors latent class probabilities. Our weights are proportional to Bolck–Croon–Hagenaars (BCH) weights (for a detailed comparison, see § 3 ).
Latent Treatment Effects from Proxy Moments. Proxy-moment methods identify class-specific average treatment effects through conditional-independence and rank conditions of observed proxies and do not estimate unit-level class posteriors [29 , 40 ] . We instead measure effects within separately learned behavioral classes by posterior unmixing under treatment-effect sufficiency and posterior rank conditions (§ 3 ).
Two-Step Estimation and Neyman Orthogonality. Our estimator fits the HMM by maximum likelihood before using its filtered posteriors in an effect estimating equation. Classical two-step theory adds a term involving the first-step likelihood score and the sensitivity of the effect moment to HMM parameters to the influence function [33 , 31 , 34 ] . This local-insensitivity construction is related to Neyman’s C ( α ) C(\alpha) C ( α ) and modern orthogonal estimators [35 , 14 ] . We use the same score adjustment in the target estimating equation (§ 4.2 ). Classical two-step inference leaves the estimate unchanged and adjusts its variance, while our correction changes the estimate as the HMM is learned on a separate sample. To first order, the correction is equivalent to a one-step Newton update of the frozen HMM on target histories [10 ] , without rerunning the expectation-maximization (EM) algorithm.
Identification of Latent-Class Treatment Effects
For experimental units i = 1 , … , n i = 1, \ldots, n i = 1 , … , n , let H i H_i H i be the observed pre-treatment covariates, Z i ∈ { 1 , … , K } Z_i \in\{1, \ldots, K\} Z i ∈ { 1 , … , K } denote unit i i i ’s latent class at assignment, A i ∈ { 0 , 1 } A_i \in\{0, 1\} A i ∈ { 0 , 1 } randomized treatment with known probability e ∈ ( 0 , 1 ) e \in(0, 1) e ∈ ( 0 , 1 ) , and Y i ( a ) Y_i(a) Y i ( a ) its potential outcome. In our context, we interpret H i H_i H i as the history of user i i i and Z i Z_i Z i as the user’s transient but unobserved state; we note that, in general, H i H_i H i and Z i Z_i Z i need not have this dynamic interpretation.
The state posterior is the vector q 0 ( H i ) = ( q 01 ( H i ) , … , q 0 K ( H i ) ) ⊤ \mathbf{q}_0(H_i) = (q_{01}(H_i), \ldots, q_{0K}(H_i))^\top q 0 ( H i ) = ( q 01 ( H i ) , … , q 0 K ( H i ) ) ⊤ , where q 0 s ( H i ) = P ( Z i = s ∣ H i ) q_{0s}(H_i) = \mathbb{P}(Z_i = s \mid H_i) q 0 s ( H i ) = P ( Z i = s ∣ H i ) . Let π s = P ( Z i = s ) \pi_s = \mathbb{P}(Z_i = s) π s = P ( Z i = s ) denote the prevalence of state s s s . For states with positive prevalence, we target the state average treatment effects
τ 0 = ( τ 01 , … , τ 0 K ) ⊤ , τ 0 s = E { Y i ( 1 ) − Y i ( 0 ) ∣ Z i = s } . \boldsymbol{\tau}_0 = (\tau_{01}, \ldots, \tau_{0K})^\top,\quad\tau_{0s} = \mathbb{E}\{Y_i(1) - Y_i(0) \mid Z_i = s\}. τ 0 = ( τ 01 , … , τ 0 K ) ⊤ , τ 0 s = E { Y i ( 1 ) − Y i ( 0 ) ∣ Z i = s } .
To identify the state-specific effects from the identified but potentially complex history-specific CATEs, we make the following sufficiency assumption.
Assumption 3.1 (Treatment-effect sufficiency). For each state s s s with positive prevalence, E [ Y i ( 1 ) − Y i ( 0 ) ∣ Z i = s , H i ] = τ 0 s \mathbb{E}[Y_i(1) - Y_i(0) \mid Z_i = s, H_i] = \tau_{0s} E [ Y i ( 1 ) − Y i ( 0 ) ∣ Z i = s , H i ] = τ 0 s almost surely conditional on Z i = s Z_i = s Z i = s .
This assumption says that, within a state, the remaining history does not modify the conditional average treatment effect. Iterated expectation then gives the observable mixture
δ ( H i ) = q 0 ( H i ) ⊤ τ 0 . (1) \delta(H_i) = \mathbf{q}_0(H_i)^\top\boldsymbol{\tau}_0. \tag*{(1)} δ ( H i ) = q 0 ( H i ) ⊤ τ 0 . (1)
Let Q 0 = E [ q 0 ( H i ) q 0 ( H i ) ⊤ ] Q_0 = \mathbb{E}\left[\mathbf{q}_0(H_i)\mathbf{q}_0(H_i)^\top\right] Q 0 = E [ q 0 ( H i ) q 0 ( H i ) ⊤ ] . For a symmetric matrix Q Q Q , let λ min ( Q ) \lambda_{\min}(Q) λ m i n ( Q ) denote its smallest eigenvalues. If λ min ( Q 0 ) > 0 \lambda_{\min}(Q_0) > 0 λ m i n ( Q 0 ) > 0 , multiplying the mixture identity by q 0 ( H i ) \mathbf{q}_0(H_i) q 0 ( H i ) and taking expectations identifies the state effects:
τ 0 = Q 0 − 1 E [ q 0 ( H i ) δ ( H i ) ] . \tau_0 = Q_0^{-1}\mathbb{E}\left[\mathbf{q}_0(H_i)\delta(H_i)\right]. τ 0 = Q 0 − 1 E [ q 0 ( H i ) δ ( H i ) ] .
This rank condition requires variation in the posterior vectors.
Comparison with Prior Work. Similar to Bolck et al. [11 ] and Vermunt [39 ] , our approach is also stepwise but motivated by the mixture identity δ ( H i ) = q 0 ( H i ) ⊤ τ 0 \delta(H_i) = \mathbf{q}_0(H_i)^\top\tau_0 δ ( H i ) = q 0 ( H i ) ⊤ τ 0 , and we unmix the latent class effects by projecting the history-conditional effect onto the posterior vector. Although the motivations differ, the two formulations lead to proportional weights: our unmixing weights satisfy { Q 0 − 1 q 0 ( H i ) } s = w s ( H i ) / π s \{Q_0^{-1}\mathbf{q}_0(H_i)\}_s = w_s(H_i)/\pi_s { Q 0 − 1 q 0 ( H i ) } s = w s ( H i ) / π s , where w s w_s w s is the BCH weight under posterior assignment ([11 , 39 ] ). The scale factor reflects different targets. For some target variable F F F that is mean-independent of H H H given Z Z Z , the BCH weights replace the class indicator, i.e. E [ F w s ( H i ) ] = E [ F 1 ( Z i = s ) ] \mathbb{E}[F w_s(H_i)] = \mathbb{E}[F\mathbb{1}(Z_i = s)] E [ F w s ( H i )] = E [ F 1 ( Z i = s )] . Our weights target the conditional mean E [ F ∣ Z i = s ] \mathbb{E}[F \mid Z_i = s] E [ F ∣ Z i = s ] directly.
We differ from this literature in three other aspects. First, we formally identify causal treatment effects within latent states. Second, our dynamic latent states are learned from an HMM fitted on pre-treatment histories on a separate sample, which allows for comparison of results across different downstream tasks as the same state definition is shared. Third, rather than only adjusting standard errors for first-stage uncertainty (Bakk et al. [4 ] ), we remove its first-order effect on the estimate (§ 4.2 ).
Within-state Effect Variation. The constant-effect restriction in Assumption 3.1 can be relaxed for a prespecified, low-dimensional pre-treatment summary X i = x ( H i ) X_i = x(H_i) X i = x ( H i ) :
E [ Y i ( 1 ) − Y i ( 0 ) ∣ Z i = s , H i ] = τ s ( X i ) . \mathbb{E}[Y_i(1) - Y_i(0) \mid Z_i = s, H_i] = \tau_s(X_i). E [ Y i ( 1 ) − Y i ( 0 ) ∣ Z i = s , H i ] = τ s ( X i ) .
The observable effect then satisfies δ ( H i ) = ∑ s = 1 K q 0 s ( H i ) τ s ( X i ) \delta(H_i) = \sum_{s=1}^{K} q_{0s}(H_i)\tau_s(X_i) δ ( H i ) = ∑ s = 1 K q 0 s ( H i ) τ s ( X i ) . If Q 0 ( x ) = E [ q 0 ( H i ) q 0 ( H i ) ⊤ ∣ X i = x ] Q_0(x) = \mathbb{E}[\mathbf{q}_0(H_i)\mathbf{q}_0(H_i)^\top\mid X_i = x] Q 0 ( x ) = E [ q 0 ( H i ) q 0 ( H i ) ⊤ ∣ X i = x ] is nonsingular for almost every x x x in the target population, conditional inversion identifies ( τ s ( x ) ) s = 1 K (\tau_s(x))_{s=1}^{K} ( τ s ( x ) ) s = 1 K . Pre-treatment baseline activity or unit-level intensity summaries are possible choices for X i X_i X i . This extension requires conditional posterior rank, which is stronger than the global rank condition above. The bias and inference results in the next section use the constant-effect case. Appendix C shows that unmodeled within-state variation makes the same estimator target a posterior projection of δ ( H ) \delta(H) δ ( H ) and bounds its gap from the state ATEs.
Bias of Naive Estimators
For nonnegative weights w = ( w 1 , … , w n ) w = (w_1,\ldots,w_n) w = ( w 1 , … , w n ) , define the weighted difference-in-means estimator:
Δ ^ n ( w ) : = ∑ i A i w i Y i ∑ i A i w i − ∑ i ( 1 − A i ) w i Y i ∑ i ( 1 − A i ) w i . \widehat{\Delta}_n(w) := \frac{\sum_i A_iw_iY_i}{\sum_i A_iw_i} - \frac{\sum_i(1-A_i)w_iY_i}{\sum_i(1-A_i)w_i}. Δ n ( w ) := ∑ i A i w i ∑ i A i w i Y i − ∑ i ( 1 − A i ) w i ∑ i ( 1 − A i ) w i Y i .
when both denominators are positive. Let q ^ i k \widehat{q}_{ik} q ik be the fitted posterior coordinate and I ^ i k = 1 { k = arg max s ≤ K q ^ i s } \widehat{I}_{ik} = \mathbb{1}\{k = \operatorname*{arg\,max}_{s\le K}\widehat{q}_{is}\} I ik = 1 { k = arg max s ≤ K q i s } , with a fixed tie rule. Hard assignment uses Δ ^ n ( I ^ k ) \widehat{\Delta}_n(\widehat{I}_k) Δ n ( I k ) ; soft weighting uses Δ ^ n ( q ^ k ) \widehat{\Delta}_n(\widehat{q}_k) Δ n ( q k ) . Under Assumption 3.1, these contrasts generally target mixtures even with the true posterior. Write q i k = q 0 k ( H i ) q_{ik} = q_{0k}(H_i) q ik = q 0 k ( H i ) and I i k = 1 { k = arg max s ≤ K q i s } I_{ik} = \mathbb{1}\{k = \operatorname*{arg\,max}_{s\le K}q_{is}\} I ik = 1 { k = arg max s ≤ K q i s } . Define the oracle versions by replacing q ^ i k \widehat{q}_{ik} q ik and I ^ i k \widehat{I}_{ik} I ik by q i k q_{ik} q ik and I i k I_{ik} I ik , respectively. They satisfy
τ ^ k , o r s o f t → p ∑ s = 1 K E [ q i k q i s ] E [ q i k ] τ 0 s , \widehat{\tau}_{k,\mathrm{or}}^{\mathrm{soft}} \xrightarrow{p} \sum_{s=1}^{K} \frac{\mathbb{E}[q_{ik}q_{is}]}{\mathbb{E}[q_{ik}]} \tau_{0s}, τ k , or soft p s = 1 ∑ K E [ q ik ] E [ q ik q i s ] τ 0 s ,
τ ^ k , o r h a r d → p ∑ s = 1 K P ( Z i = s ∣ I i k = 1 ) τ 0 s . \widehat{\tau}_{k,\mathrm{or}}^{\mathrm{hard}} \xrightarrow{p} \sum_{s=1}^{K} \mathbb{P}(Z_i=s\mid I_{ik}=1)\tau_{0s}. τ k , or hard p s = 1 ∑ K P ( Z i = s ∣ I ik = 1 ) τ 0 s .
Each set of weights sums to one, so the naive estimators recover convex sums of the true latent state aggregates. A derivation of the bias is in Section A.
Estimation
In our application, we estimate latent-state effects in a randomized experiment using an HMM trained on behavioral histories from a separate set of units. Again, we emphasize that the method can also be applied in non-dynamic settings to infer static latent classes. Once trained, the HMM can be reused across treatments and experiments with the same pre-treatment history distribution, facilitating comparison. For each experiment, we obtain posterior state probabilities for its analysis units, estimate the state effects, and evaluate the orthogonal correction on those units. Our theory assumes that the number of latent states is correctly specified.
The Unmixing Estimator
To estimate the state effects from (1) , write A ~ i = A i − e \widetilde{A}_i=A_i-e A i = A i − e and v A = e ( 1 − e ) v_A=e(1-e) v A = e ( 1 − e ) . By consistency, Y i = Y i ( 0 ) + A i { Y i ( 1 ) − Y i ( 0 ) } Y_i=Y_i(0)+A_i\{Y_i(1)-Y_i(0)\} Y i = Y i ( 0 ) + A i { Y i ( 1 ) − Y i ( 0 )} . Randomization then gives
E [ A ~ i Y i ∣ H i ] = E [ A ~ i ∣ H i ] E [ Y i ( 0 ) ∣ H i ] + E [ A ~ i A i ∣ H i ] δ ( H i ) = e ( 1 − e ) δ ( H i ) = v A δ ( H i ) (2) \begin{aligned}
\mathbb{E}[\widetilde{A}_iY_i\mid H_i]
&=\mathbb{E}[\widetilde{A}_i\mid H_i]\mathbb{E}[Y_i(0)\mid H_i]+\mathbb{E}[\widetilde{A}_iA_i\mid H_i]\delta(H_i)\\
&=e(1-e)\delta(H_i)=v_A\delta(H_i) \tag*{(2)}
\end{aligned} E [ A i Y i ∣ H i ] = E [ A i ∣ H i ] E [ Y i ( 0 ) ∣ H i ] + E [ A i A i ∣ H i ] δ ( H i ) = e ( 1 − e ) δ ( H i ) = v A δ ( H i ) (2)
Because the randomization probability e e e is known, this moment uses Y i Y_i Y i directly; the outcome regression on the history m 0 ( H ) = E [ Y i ∣ H i = H ] m_0(H)=\mathbb{E}[Y_i\mid H_i=H] m 0 ( H ) = E [ Y i ∣ H i = H ] need not be estimated. Let η \eta η denote the HMM parameter, with true value η 0 \eta_0 η 0 , and write q η ( H ) \mathbf{q}_{\eta}(H) q η ( H ) for its filtered state-probability vector based only on pre-treatment history. After label alignment, q η 0 ( H ) = q 0 ( H ) \mathbf{q}_{\eta_0}(H)=\mathbf{q}_0(H) q η 0 ( H ) = q 0 ( H ) . For a coefficient vector τ ∈ R K \boldsymbol{\tau}\in\mathbb{R}^{K} τ ∈ R K , define
ψ i ( τ , η ) = q η ( H i ) A ~ i { Y i − A ~ i q η ( H i ) ⊤ τ } . \psi_i(\boldsymbol{\tau},\eta)=\mathbf{q}_{\eta}(H_i)\widetilde{A}_i\{Y_i-\widetilde{A}_i\mathbf{q}_{\eta}(H_i)^{\top}\boldsymbol{\tau}\}. ψ i ( τ , η ) = q η ( H i ) A i { Y i − A i q η ( H i ) ⊤ τ } .
By (2) , its population mean is
E { ψ i ( τ , η ) } = v A E [ q η ( H i ) { δ ( H i ) − q η ( H i ) ⊤ τ } ] . (3) \mathbb{E}\{\psi_i(\boldsymbol{\tau},\eta)\}=v_A\mathbb{E}\left[\mathbf{q}_{\eta}(H_i)\{\delta(H_i)-\mathbf{q}_{\eta}(H_i)^{\top}\boldsymbol{\tau}\}\right]. \tag*{(3)} E { ψ i ( τ , η )} = v A E [ q η ( H i ) { δ ( H i ) − q η ( H i ) ⊤ τ } ] . (3)
By (1) , this mean vanishes at ( τ 0 , η 0 ) (\boldsymbol{\tau}_0,\eta_0) ( τ 0 , η 0 ) .
Fit η ^ \widehat{\eta} η on the separate HMM training sample. Write q ^ i = q η ^ ( H i ) \widehat{\mathbf{q}}_i=\mathbf{q}_{\widehat{\eta}}(H_i) q i = q η ( H i ) . Let τ ^ p l \widehat{\boldsymbol{\tau}}^{\mathrm{pl}} τ pl denote the plain plug-in unmixing estimator, obtained by solving the sample effect equation. When the sample Gram matrix is invertible, it is
M ^ = 1 n ∑ i = 1 n A ~ i 2 q ^ i q ^ i ⊤ , \widehat{M}=\frac{1}{n}\sum_{i=1}^{n}\widetilde{A}_i^2\widehat{\mathbf{q}}_i\widehat{\mathbf{q}}_i^{\top}, M = n 1 i = 1 ∑ n A i 2 q i q i ⊤ ,
τ ^ p l = M ^ − 1 1 n ∑ i = 1 n q ^ i A ~ i Y i . (4) \widehat{\boldsymbol{\tau}}^{\mathrm{pl}}=\widehat{M}^{-1}\frac{1}{n}\sum_{i=1}^{n}\widehat{\mathbf{q}}_i\widetilde{A}_iY_i. \tag*{(4)} τ pl = M − 1 n 1 i = 1 ∑ n q i A i Y i . (4)
The population Gram matrix is M 0 = v A Q 0 M_0 = v_AQ_0 M 0 = v A Q 0 .
Orthogonal Correction and Inference
Estimation of the external HMM can shift the plug-in effect equation at first order. Let p η ( H ) p_\eta(H) p η ( H ) be the HMM likelihood of the pre-treatment history, with η \eta η in identifiable free coordinates, and let D η D_\eta D η denote differentiation with respect to η \eta η . We use the observed-history score s H ( H ; η ) = D η log p η ( H ) s^H(H;\eta) = D_\eta\log p_\eta(H) s H ( H ; η ) = D η log p η ( H ) . Define
G 0 = E [ D η ψ i ( τ 0 , η ) ∣ η 0 ] , J 0 = E [ D η s H ( H i ; η 0 ) ] , B 0 = G 0 J 0 − 1 . (5) \begin{aligned}
G_0 &= \mathbb{E}[D_\eta\psi_i(\tau_0,\eta)\mid_{\eta_0}],\\
J_0 &= \mathbb{E}[D_\eta s^H(H_i;\eta_0)],\\
B_0 &= G_0J_0^{-1}. \tag*{(5)}
\end{aligned} G 0 J 0 B 0 = E [ D η ψ i ( τ 0 , η ) ∣ η 0 ] , = E [ D η s H ( H i ; η 0 )] , = G 0 J 0 − 1 . (5)
G 0 G_0 G 0 and J 0 J_0 J 0 measure how the effect moment and mean history score change with η \eta η . For a conformable matrix B B B , define the corrected score
ϕ i ( τ , η , B ) = ψ i ( τ , η ) − B s H ( H i ; η ) . \phi_i(\tau,\eta,B) = \psi_i(\tau,\eta) - Bs^H(H_i;\eta). ϕ i ( τ , η , B ) = ψ i ( τ , η ) − B s H ( H i ; η ) .
At η 0 \eta_0 η 0 , the history score has mean zero, so this subtraction preserves the target. Its mean is also insensitive to small HMM parameter errors: under the local conditions below, its derivative with respect to η \eta η at η 0 \eta_0 η 0 is
G 0 − B 0 J 0 = 0. G_0 - B_0J_0 = 0. G 0 − B 0 J 0 = 0.
HMM fitting error therefore enters the mean corrected score quadratically, together with a product of the errors in η ^ \widehat{\eta} η and B ^ \widehat{B} B .
The expectations defining B 0 B_0 B 0 are over the target-unit distribution, so we estimate them on the experiment units. Denote E n [ f ] = n − 1 ∑ i = 1 n f ( W i ) \mathbb{E}_n[f] = n^{-1}\sum_{i=1}^n f(W_i) E n [ f ] = n − 1 ∑ i = 1 n f ( W i ) . Using τ ^ p l \widehat{\tau}^{\mathrm{pl}} τ pl as a preliminary value and holding it fixed in D η ψ D_\eta\psi D η ψ , estimate B 0 B_0 B 0 by
B ^ = E n [ D η ψ ( τ ^ p l , η ^ ) ] × E n [ D η s H ( H ; η ^ ) ] − 1 . (6) \widehat{B} = \mathbb{E}_n[D_\eta\psi(\widehat{\tau}^{\mathrm{pl}},\widehat{\eta})]\times\mathbb{E}_n[D_\eta s^H(H;\widehat{\eta})]^{-1}. \tag*{(6)} B = E n [ D η ψ ( τ pl , η )] × E n [ D η s H ( H ; η ) ] − 1 . (6)
The corrected estimator evaluates the HMM score on the target analysis units:
τ ^ ⊥ = τ ^ p l − M ^ − 1 B ^ E n [ s H ( H ; η ^ ) ] . (7) \widehat{\tau}^{\perp} = \widehat{\tau}^{\mathrm{pl}}-\widehat{M}^{-1}\widehat{B}\mathbb{E}_n[s^H(H;\widehat{\eta})]. \tag*{(7)} τ ⊥ = τ pl − M − 1 B E n [ s H ( H ; η )] . (7)
At an exact interior likelihood fit, the training sample’s mean HMM score is zero. The target sample’s mean score is generally nonzero and cancels the first-order effect of estimating η 0 \eta_0 η 0 . For each target unit, define ϕ ^ i = ϕ i ( τ ^ ⊥ , η ^ , B ^ ) \widehat{\phi}_i=\phi_i(\widehat{\tau}^{\perp},\widehat{\eta},\widehat{B}) ϕ i = ϕ i ( τ ⊥ , η , B ) . The sandwich covariance estimator is
Ω ^ = 1 n ∑ i ϕ ^ i ϕ ^ i ⊤ , \widehat{\Omega}=\frac{1}{n}\sum_i\widehat{\phi}_i\widehat{\phi}_i^{\top}, Ω = n 1 i ∑ ϕ i ϕ i ⊤ ,
Var ^ ( τ ^ ⊥ ) = 1 n M ^ − 1 Ω ^ M ^ − 1 . (8) \widehat{\operatorname{Var}}(\widehat{\tau}^{\perp})=\frac{1}{n}\widehat{M}^{-1}\widehat{\Omega}\widehat{M}^{-1}. \tag*{(8)} Var ( τ ⊥ ) = n 1 M − 1 Ω M − 1 . (8)
Theorem 4.1 (Orthogonal inference with an external HMM). *Let the analysis units be i.i.d., independent of i.i.d. HMM training histories drawn from the same distribution as H i H_i H i . Suppose A i ∼ Bernoulli ( e ) A_i\sim\operatorname{Bernoulli}(e) A i ∼ Bernoulli ( e ) , independently of ( H i , Y i ( 0 ) , Y i ( 1 ) ) (H_i,Y_i(0),Y_i(1)) ( H i , Y i ( 0 ) , Y i ( 1 )) , with known e ∈ ( 0 , 1 ) e\in(0,1) e ∈ ( 0 , 1 ) . Assume observed outcomes are consistent and E { Y i ( a ) 2 } < ∞ \mathbb{E}\{Y_i(a)^2\}<\infty E { Y i ( a ) 2 } < ∞ for a ∈ { 0 , 1 } a\in\{0,1\} a ∈ { 0 , 1 } . Assume the HMM is correctly specified with fixed K K K and a fixed-dimensional interior parameter η 0 \eta_0 η 0 , after a label alignment based only on its training histories. Suppose that Assumption 3.1 holds, λ min ( Q 0 ) ≥ κ 0 > 0 \lambda_{\min}(Q_0)\ge\kappa_0>0 λ m i n ( Q 0 ) ≥ κ 0 > 0 , E { s H ( H i ; η 0 ) } = 0 \mathbb{E}\{s^H(H_i;\eta_0)\}=0 E { s H ( H i ; η 0 )} = 0 , E { ∥ s H ( H i ; η 0 ) ∥ 2 } < ∞ \mathbb{E}\{\lVert s^H(H_i;\eta_0)\rVert^2\}<\infty E {∥ s H ( H i ; η 0 ) ∥ 2 } < ∞ , and nonsingular J 0 J_0 J 0 .
Assume the local L 2 L_2 L 2 continuity and second-order mean expansions in Assumption B.1. Suppose the externally fitted η ^ \hat{\eta} η ^ and the target-sample B ^ \hat{B} B ^ satisfy
∥ η ^ − η 0 ∥ = O p ( r η ) , \lVert\hat{\eta}-\eta_0\rVert= O_p(r_\eta), ∥ η ^ − η 0 ∥ = O p ( r η ) ,
∥ B ^ − B 0 ∥ o p = O p ( r B ) , \lVert\hat{B}-B_0\rVert_{\mathrm{op}} = O_p(r_B), ∥ B ^ − B 0 ∥ op = O p ( r B ) ,
for rates r η , r B → 0 r_\eta,r_B \to0 r η , r B → 0 . Denote ϕ 0 i = ϕ i ( τ 0 , η 0 , B 0 ) \phi_{0i}=\phi_i(\tau_0,\eta_0,B_0) ϕ 0 i = ϕ i ( τ 0 , η 0 , B 0 ) . Then HMM fitting error contributes no linear term:
τ ^ ⊥ − τ 0 = M 0 − 1 1 n ∑ i = 1 n ϕ 0 i + O p ( r η 2 + r η r B ) + O p ( n − 1 / 2 ) . (9) \hat{\tau}^{\perp}-\tau_0=M_0^{-1}\frac{1}{n}\sum_{i=1}^{n}\phi_{0i}
+O_p(r_\eta^2+r_\eta r_B)+O_p(n^{-1/2}). \tag*{(9)} τ ^ ⊥ − τ 0 = M 0 − 1 n 1 i = 1 ∑ n ϕ 0 i + O p ( r η 2 + r η r B ) + O p ( n − 1/2 ) . (9)
Consequently,
∥ τ ^ ⊥ − τ 0 ∥ = O p ( n − 1 / 2 + r η 2 + r η r B v A κ 0 ) . (10) \left\lVert\hat{\tau}^{\perp}-\tau_0\right\rVert
=O_p\left(\frac{n^{-1/2}+r_\eta^2+r_\eta r_B}{v_A\kappa_0}\right). \tag*{(10)} τ ^ ⊥ − τ 0 = O p ( v A κ 0 n − 1/2 + r η 2 + r η r B ) . (10)
If n ( r η 2 + r η r B ) → 0 \sqrt{n}(r_\eta^2+r_\eta r_B)\to0 n ( r η 2 + r η r B ) → 0 , put Ω 0 = E { ϕ 0 i ϕ 0 i T } \Omega_0=\mathbb{E}\{\phi_{0i}\phi_{0i}^{\mathsf{T}}\} Ω 0 = E { ϕ 0 i ϕ 0 i T } . Then
n ( τ ^ ⊥ − τ 0 ) → d N ( 0 , M 0 − 1 Ω 0 M 0 − 1 ) . (11) \sqrt{n}(\hat{\tau}^{\perp}-\tau_0)\xrightarrow{d}\mathcal{N}(0,M_0^{-1}\Omega_0M_0^{-1}). \tag*{(11)} n ( τ ^ ⊥ − τ 0 ) d N ( 0 , M 0 − 1 Ω 0 M 0 − 1 ) . (11)
Under the same condition, n n n times the sandwich covariance in (8) converges in probability to the displayed asymptotic covariance.
Appendix B first verifies the target-sample correction rate in Lemma B.2, then proves the theorem.
For each state, an approximate 95% confidence interval is the corrected effect estimate plus or minus 1.96 times its sandwich standard error from (8). This normal approximation requires a positive limiting variance. Weak posterior rank can inflate the standard error through M 0 − 1 M_0^{-1} M 0 − 1 .
Simulation experiments
We use two designs to separate ambiguity about a latent state from error in estimating the state model. In the oracle-posterior design, every method receives the exact posterior q 0 ( H i ) q_0(H_i) q 0 ( H i ) , which isolates the bias of hard assignment and posterior weighting. In the full workflow, we fit an HMM on histories from separate units and compare plain unmixing with the orthogonal correction on a randomized target sample. All experiments use known treatment probability e = 1 / 2 e=1/2 e = 1/2 ; the centered outcome model has E ( Y i ∣ H i ) = 0 \mathbb{E}(Y_i\mid H_i)=0 E ( Y i ∣ H i ) = 0 . Appendix E gives the designs and additional results.
Oracle Posteriors: Bias and Identification
We first use three equally prevalent states with τ 0 = ( − 1 , 0 , 1 ) T \tau_0=(-1,0,1)^{\mathsf{T}} τ 0 = ( − 1 , 0 , 1 ) T . A categorical pre-treatment signal H i ∈ { 1 , 2 , 3 } H_i\in\{1,2,3\} H i ∈ { 1 , 2 , 3 } equals the state Z i Z_i Z i with probability ρ = P ( H i = Z i ) ∈ { 0.40 , 0.60 , 0.80 , 0.95 , 1.00 } \rho=\mathbb{P}(H_i=Z_i)\in\{0.40,0.60,0.80,0.95,1.00\} ρ = P ( H i = Z i ) ∈ { 0.40 , 0.60 , 0.80 , 0.95 , 1.00 } ; under the balanced prior, ρ \rho ρ is hard-assignment accuracy. With independent standard normal noise ϵ i \epsilon_i ϵ i , outcomes follow Y i = ( A i − 1 / 2 ) τ 0 , Z i + ϵ i Y_i=(A_i-1/2)\tau_{0,Z_i}+\epsilon_i Y i = ( A i − 1/2 ) τ 0 , Z i + ϵ i . We use n ∈ { 500 , 2,000 , 10,000 , 50,000 } n\in\{500,2{,}000,10{,}000,50{,}000\} n ∈ { 500 , 2 , 000 , 10 , 000 , 50 , 000 } units and 1,000 replications per condition. No HMM is estimated in this design.
Even with the exact posterior, hard and soft estimators target mixtures of the state effects. Table 1 presents the root mean squared error (RMSE) of the three estimators as signal accuracy varies at n = 50,000 n=50{,}000 n = 50 , 000 . All methods become less precise as accuracy falls, but unmixing has lower
Table 1. Posterior-overlap results at n = 50,000 n = 50{,}000 n = 50 , 000 , based on 1,000 replications. Signal accuracy is ρ = P ( H i = Z i ) \rho= \mathbb{P}(H_i = Z_i) ρ = P ( H i = Z i ) . Entries are estimates (Monte Carlo standard errors). RMSE weights the three states equally; coverage averages across states for the true latent-state effects. Posterior-based methods use the exact Bayes posterior.
RMSE than hard or soft weighting in this design. Its intervals have near-nominal coverage of the true state effects, whereas the naive intervals often undercover. When ρ = 1 \rho= 1 ρ = 1 , the posterior probability exactly identifies the latent state, and the three methods agree up to finite-sample differences. Appendix Tables 2 and 3 report all sample sizes.
State imbalance also weakens identification: at ρ = 0.80 \rho= 0.80 ρ = 0.80 , reducing the smallest state prevalence from 1 / 3 1/3 1/3 to 0.10 raises the Gram condition number from 2.04 to 18.12 and unmixing’s equal-state RMSE from 0.021 to 0.037. Appendix § 12 .§ 3 reports the imbalance results; the unmixing estimator consistently outperforms the naive estimators.
Estimated HMM: Orthogonal Correction
We next generate 21-day action and viewing-intensity histories from a correctly specified five-state HMM and fit it by EM on independent panels from the same history distribution, with N ∈ { 300 , 600 , 1,200 , 2,400 } N \in\{300, 600, 1{,}200, 2{,}400\} N ∈ { 300 , 600 , 1 , 200 , 2 , 400 } units. In each of 200 paired replications, a randomized 50,000-unit target panel is analyzed at sample-sizes of n ∈ { 2,000 , 10,000 , 50,000 } n \in\{2{,}000, 10{,}000, 50{,}000\} n ∈ { 2 , 000 , 10 , 000 , 50 , 000 } . The state effects, ordered by activity, are τ 0 = ( − 1.2 , − 0.6 , 0 , 0.6 , 1.2 ) T \tau_0 = (-1.2, -0.6, 0, 0.6, 1.2)^{\mathsf{T}} τ 0 = ( − 1.2 , − 0.6 , 0 , 0.6 , 1.2 ) T .
The HMM fit uses a separate set of units with behavioral panel, and the correction’s posterior derivatives, score information, and effect moments are calculated on the target experiment sample. In the implementation of the orthogonal correction term, the target score Jacobian is approximated by the outer product of observed-history scores (OPG). Under correct HMM specification, the information-matrix identity equates the target expected score Jacobian to the negative expected score outer product, motivating the OPG approximation [8 ] without repeated numerical differentiation. Appendix § 13 describes the HMM, orthogonal correction term, and additional effect profiles.
Figure 1 shows that the RMSE gain grows with target size n n n at every HMM training size N N N , and generally shrinks as N N N grows. In the primary comparison pooling N = 600 N = 600 N = 600 and N = 1,200 N = 1{,}200 N = 1 , 200 at n = 50,000 n = 50{,}000 n = 50 , 000 , orthogonal correction reduces equal-state mean squared error (MSE), averaged over replications, by 31.4%. At N = 600 N = 600 N = 600 , empirical interval coverage rises from 85.9% to 93.0%. The sample-size pattern is consistent with correction attenuating HMM fitting error: with fewer training histories there is more such error to remove, while a larger target sample makes it more visible relative to sampling noise.
Figure 1. Equal-state RMSE reduction from target-sample OPG correction relative to plain unmixing under monotone effects. Each cell uses 200 paired replications; positive values favor correction.
Theorem 4.1 helps explain this pattern. Let r η r_\eta r η denote the HMM estimation rate, which depends on the number N N N of training histories. Plain unmixing has error O p ( n − 1 / 2 + r η ) O_p(n^{-1/2} + r_\eta) O p ( n − 1/2 + r η ) . Under the conditions of Lemma B.2, orthogonal unmixing reduces that contribution to second order, giving O p ( n − 1 / 2 + r η 2 ) O_p(n^{-1/2} + r_\eta^2) O p ( n − 1/2 + r η 2 ) . Correction can therefore help more when the HMM is trained on fewer histories. As the target sample grows, sampling noise falls and the correction coefficient is estimated more accurately, which makes the gain easier to detect. Appendix § 13 .§ 3 reports the complete ( n , N ) (n,N) ( n , N ) and effect-profile results.
Real World Case Study
To demonstrate the practical utility of our latent-class HTE estimator, we apply our methodology to evaluate treatment effect heterogeneity due to dynamic latent states in a large-scale randomized A/B test conducted at Netflix.
Personalized recommendation systems are core to improving user engagement at Netflix. However, the impact of these recommendations is plausibly heterogeneous and modified by transient user moods. For example, a user who has recently finished a TV series may be highly receptive to recommendations of novel titles, whereas a user actively progressing through a multi-season show or repeatedly rewatching familiar content is likely to continue their current viewing pattern regardless of recommendations. Because these underlying moods are not directly observed, we characterize them in the above framework as transient latent states that generate different conditional probability distributions over a user’s subsequent actions.
Behavioral-state Hidden Markov Model
Figure 2 illustrates the user behavior HMM. Let T T T be the number of pre-treatment days and O i t O_{it} O i t the observed record on day t t t , so that H i = ( O i 1 , … , O i T ) H_i = (O_{i1}, \ldots, O_{iT}) H i = ( O i 1 , … , O i T ) . Let Z i t Z_{it} Z i t be user i i i ’s state on pre-treatment day
Figure 2. Schematic of the user behavior HMM over T T T pre-treatment days. Z i t Z_{it} Z i t is user i i i ’s latent state and O i t O_{it} O i t is the observed record on day t t t . Activity R i t R_{it} R i t is followed by action C i t C_{it} C i t when active and viewing intensity B i t B_{it} B i t conditional on action. The inputs u i t , G i t a , v i t u_{it},G_{ita},v_{it} u i t , G i t a , v i t are user summaries, and w ( t ) w(t) w ( t ) is weekday.
t t t , R i t R_{it} R i t indicate activity, C i t C_{it} C i t denote the action when active, and B i t B_{it} B i t denote a viewing-duration bin. Write w ( t ) w(t) w ( t ) for the weekday; s , r s,r s , r index states, a a a indexes actions, and b b b indexes duration bins. The transition matrix is A = ( A s r ) A=(A_{sr}) A = ( A sr ) . Conditional on activity, actions include start, continue, complete, mixed start-and-complete, and rewatch. The emission model uses fixed user offsets u i t , G i t a , v i t u_{it},G_{ita},v_{it} u i t , G i t a , v i t , state terms θ s , ϕ s a , κ s \theta_s,\phi_{sa},\kappa_s θ s , ϕ s a , κ s , weekday terms d w ( t ) , δ w ( t ) , a , ψ w ( t ) , a , b d_{w(t)},\delta_{w(t),a},\psi_{w(t),a,b} d w ( t ) , δ w ( t ) , a , ψ w ( t ) , a , b , coefficients λ , β \lambda,\beta λ , β , and a numerical score z b z_b z b for duration bin b b b :
P ( Z i , t + 1 = r ∣ Z i t = s ) = A s r , \mathbb{P}(Z_{i,t+1}=r \mid Z_{it}=s)=A_{sr}, P ( Z i , t + 1 = r ∣ Z i t = s ) = A sr ,
logit ( Pr ( R i t = 1 ∣ Z i t = s ) ) = u i t + θ s + d w ( t ) , \operatorname{logit}\left(\Pr(R_{it}=1 \mid Z_{it}=s)\right)=u_{it}+\theta_s+d_{w(t)}, logit ( Pr ( R i t = 1 ∣ Z i t = s ) ) = u i t + θ s + d w ( t ) ,
P ( C i t = a ∣ R i t = 1 , Z i t = s ) ∝ ϕ s a e λ G i t a + δ w ( t ) , a , \mathbb{P}(C_{it}=a \mid R_{it}=1,Z_{it}=s)\propto\phi_{sa}e^{\lambda G_{ita}+\delta_{w(t),a}}, P ( C i t = a ∣ R i t = 1 , Z i t = s ) ∝ ϕ s a e λ G i t a + δ w ( t ) , a ,
P ( B i t = b ∣ R i t = 1 , C i t = a , Z i t = s ) ∝ ψ w ( t ) , a , b e z b ( β v i t + κ s ) . \mathbb{P}(B_{it}=b \mid R_{it}=1,C_{it}=a,Z_{it}=s)\propto\psi_{w(t),a,b}e^{z_b(\beta v_{it}+\kappa_s)}. P ( B i t = b ∣ R i t = 1 , C i t = a , Z i t = s ) ∝ ψ w ( t ) , a , b e z b ( β v i t + κ s ) .
The offsets summarize trailing viewing intensity and action mix, so state reflects behavior relative to a user’s own baseline. We estimate the HMM’s initial-state distribution ν \boldsymbol{\nu} ν , transition matrix A A A , and emission parameters by Baum–Welch EM on a disjoint fold from the treatment effect estimation.
Figure 3 shows the fitted states’ activity and action profiles. Their viewing-intensity distributions conditional on playback are in Appendix Figure 7 .
Figure 3. Behavioral profiles of the fitted five-state HMM. The left panel shows action shares conditional on activity; the right panel shows marginal activity probabilities. The states describe temporary behavioral contexts, not permanent member types.
Figure 7. Model-implied distribution of daily viewing duration on a playback day, conditional on each state of the fitted five-state HMM. Each row gives the probability of a viewing-minute bin and sums to 100%. The behavioral profile names correspond to those in Figure 3 ; the display order differs.
We choose the number of states using an elbow in out-of-time held-out log-likelihood per observed day for candidate HMMs with K = 2 , … , 7 K=2,\ldots,7 K = 2 , … , 7 on a smaller sample for hyperparameter selection (Appendix Figure 5). The gain from 4 to 5 states is 0.00721, whereas the gain from 5 to 6 falls to 0.00178, and adding a 7 t h 7^{th} 7 t h state gives a similarly small gain of 0.00197. We therefore use K = 5 K = 5 K = 5 . Appendix Figure 6 compares state posteriors across matched K = 4 , 5 , 6 K = 4, 5, 6 K = 4 , 5 , 6 states.
Latent State HTEs
We apply the proposed methodology to a real-world A/B test of a new recommendation model architecture with one control arm and three treatment arms (“cells”) and approximately 24 million users. After selecting K = 5 K = 5 K = 5 , we fit the HMM using 180 pre-treatment days on 10% of the units in the experiment. The fitted HMM is then frozen, and state-specific treatment effects are estimated using the proposed estimator on the remaining 90% of users. By leveraging the inferred latent states at the time of treatment assignment as effect modifiers, we apply our proposed framework to investigate whether the new recommendation architecture exerts uniform benefits across the user population or if its efficacy is statistically isolated to specific, transient behavioral profiles. Let Q ^ = n − 1 ∑ i = 1 n q ^ i q ^ i T \widehat{Q} = n^{-1} \sum_{i=1}^{n} \widehat{q}_i\widehat{q}_i^{\mathsf{T}} Q = n − 1 ∑ i = 1 n q i q i T be the posterior Gram matrix on the effect-estimation users. Posterior variation is adequate for inversion, with the minimum eigenvalue λ min ( Q ^ ) = 0.041 \lambda_{\min}(\widehat{Q}) = 0.041 λ m i n ( Q ) = 0.041 and condition number cond ( Q ^ ) = 6.5 \operatorname{cond}(\widehat{Q}) = 6.5 cond ( Q ) = 6.5 .
The learned states represent distinct, interpretable user behaviors as seen in Figure 3 . As Figure 4 illustrates, treatment effects vary with the level of engagement (e.g., high vs. low). Estimated latent-state ATEs are not statistically significant in all treatment arms for mostly inactive, low-activity, and rewatch-heavy users; these moods also tend to have the lowest marginal engagement. By contrast, continuation-heavy and broad-engagement users, who are highly engaged, show significantly positive effects across all three treatments. Taken together, the treatments appear most effective among users exhibiting ongoing or broad engagement, with limited evidence of benefit among inactive or rewatch-oriented users.
Figure 4. Orthogonal latent-state ATEs for a metric that captures active days. Error bars are pointwise 95% confidence intervals; gray diamonds and bands show the overall ATE. State labels match Figure 3 .
Discussion and Limitations
In this work, we demonstrated that an HMM trained on pre-treatment behavioral histories can be reused to recover heterogeneous treatment effects across transient latent states. Our unmixing estimator successfully isolates true state-specific effects even when individual state assignments remain uncertain. Furthermore, our orthogonal correction mitigates sensitivity to HMM estimation error, yielding robust state-level inference at scale.
Limitations and Assumptions. Interpreting the estimated coefficients as state ATEs requires treatment-effect sufficiency and the number of states (K K K ) to be correctly specified. In general, posterior unmixing estimates the best linear approximation of the CATE conditioning on the history (i.e. δ ( H ) \delta(H) δ ( H ) ) using the fitted posteriors. With a misspecified state count, the estimated effects will be a weighted sum of the true state ATEs (Appendix § 11 ). Under correct HMM specification, the expected score Jacobian equals the negative expected score outer product (OPG approximation), but this equality can fail under misspecification ([44 ] ). In our application, we performed a hyperparameter tuning to select the number of latent states.
Computational Considerations. The orthogonal correction requires estimating and inverting the HMM score Jacobian. We use the OPG approximation of the Jacobian to avoid the prohibitive cost of repeated score evaluations required by finite differences. Because a nearly singular Jacobian can amplify error, in cases of extreme ill-conditioning, aggressive ridge regularization or plain unmixing may be preferable.
Future Work. A natural extension of this framework is estimating latent-state effects in observational settings. This could involve unmixing a cross-fitted doubly robust pseudo-outcome ([22 ] ) for the CATE conditional on the behavioral history. The challenge arises when the latent state Z i Z_i Z i affects both treatment and potential outcomes beyond H i H_i H i . The observed propensity is a mixture of state-specific propensities, so treated and untreated accounts with the same history can have different state mixtures. A pseudo-outcome based only on H i H_i H i need not represent a causal effect, and unmixing it would require additional assumptions about treatment assignment and outcomes within states.
AI use statement
In this work, we used generative AI tools for: generate synthetic data sets (as part of the simulation experiments), formulate mathematical claims, assist in the writing of proofs, design or provide feedback on experiments, implement methods, interpret results (simulation results only).
We have not used generative AI tools for: help develop theoretical models or conceptual frameworks, provide critical ingredients for proving mathematical claims (proof sketch were provided to the AI models to help write the proof), and propose or refine hypotheses, assist with translation, clean and reformat datasets, support qualitative and thematic data analysis are not applicable to this work.
Additionally, we used generative AI tools for tasks: create or modify scientific figures or images, suggest experimental parameters, create or edit software code, draft parts of a research paper, edit a research paper to improve readability, identify relevant literature, format references.
We have reviewed all AI-assisted work. We went through all additional related literature/citations that was identified by AI models as well as the code that was produced by LLM to implement the method. All LLM-assisted proofs were checked line by line.
We take responsibility for the final content of this work, including text, claims, or artifacts produced with the aid of generative AI.
Bias of hard and soft state estimators
Posterior weighting and hard assignment
Hard assignment treats the most likely state as observed, while soft weighting treats posterior probability as fractional membership. The following proposition shows that both contrasts generally mix state effects, even with the true posterior, and gives the conditions under which they are biased for a state’s effect.
Proposition A.1 (Mixture limits of hard and soft contrasts). Fix a state k k k and K ≥ 2 K \ge2 K ≥ 2 . Suppose units are i.i.d., A i ∼ Bernoulli ( e ) A_i \sim\operatorname{Bernoulli}(e) A i ∼ Bernoulli ( e ) independently of ( H i , Y i ( 0 ) , Y i ( 1 ) ) (H_i,Y_i(0),Y_i(1)) ( H i , Y i ( 0 ) , Y i ( 1 )) for e ∈ ( 0 , 1 ) e \in(0,1) e ∈ ( 0 , 1 ) , observed outcomes are consistent, and E [ ∣ Y i ( a ) ∣ ] < ∞ \mathbb{E}[|Y_i(a)|] < \infty E [ ∣ Y i ( a ) ∣ ] < ∞ for a ∈ { 0 , 1 } a \in\{0,1\} a ∈ { 0 , 1 } . Write q i s = Pr ( Z i = s ∣ H i ) q_{is} = \Pr(Z_i = s \mid H_i) q i s = Pr ( Z i = s ∣ H i ) and suppose Assumption 3.1 holds. Let I i k = 1 { k = arg max s ≤ K q i s } I_{ik} = \mathbb{1}\{k = \arg\max_{s \le K} q_{is}\} I ik = 1 { k = arg max s ≤ K q i s } , using a fixed tie rule, and suppose Pr ( I i k = 1 ) > 0 \Pr(I_{ik} = 1) > 0 Pr ( I ik = 1 ) > 0 . For nonnegative weights w = ( w 1 , … , w n ) w = (w_1,\ldots,w_n) w = ( w 1 , … , w n ) , define, whenever both denominators are positive,
Δ ^ n ( w ) = ∑ i A i w i Y i ∑ i A i w i − ∑ i ( 1 − A i ) w i Y i ∑ i ( 1 − A i ) w i . \widehat{\Delta}_n(w) = \frac{\sum_i A_iw_iY_i}{\sum_i A_iw_i} - \frac{\sum_i(1-A_i)w_iY_i}{\sum_i(1-A_i)w_i}. Δ n ( w ) = ∑ i A i w i ∑ i A i w i Y i − ∑ i ( 1 − A i ) w i ∑ i ( 1 − A i ) w i Y i . Define their population mixing weights by
ω k s s o f t = E [ q i k q i s ] E [ q i k ] , \omega^{\mathrm{soft}}_{ks} = \frac{\mathbb{E}[q_{ik}q_{is}]}{\mathbb{E}[q_{ik}]}, ω k s soft = E [ q ik ] E [ q ik q i s ] , ω k s h a r d = Pr ( Z i = s ∣ I i k = 1 ) . \omega^{\mathrm{hard}}_{ks} = \Pr(Z_i = s \mid I_{ik} = 1). ω k s hard = Pr ( Z i = s ∣ I ik = 1 ) . Define the oracle estimators τ ^ k , o r s o f t = Δ ^ n ( ( q i k ) i ) \widehat{\tau}^{\mathrm{soft}}_{k,\mathrm{or}} = \widehat{\Delta}_n((q_{ik})_i) τ k , or soft = Δ n (( q ik ) i ) and τ ^ k , o r h a r d = Δ ^ n ( ( I i k ) i ) \widehat{\tau}^{\mathrm{hard}}_{k,\mathrm{or}} = \widehat{\Delta}_n((I_{ik})_i) τ k , or hard = Δ n (( I ik ) i ) . Then
τ ^ k , o r s o f t → p T k s o f t : = ∑ s = 1 K ω k s s o f t τ 0 s , \widehat{\tau}^{\mathrm{soft}}_{k,\mathrm{or}} \xrightarrow{p} T^{\mathrm{soft}}_k := \sum_{s=1}^{K}\omega^{\mathrm{soft}}_{ks}\tau_{0s}, τ k , or soft p T k soft := s = 1 ∑ K ω k s soft τ 0 s , τ ^ k , o r h a r d → p T k h a r d : = ∑ s = 1 K ω k s h a r d τ 0 s . \widehat{\tau}^{\mathrm{hard}}_{k,\mathrm{or}} \xrightarrow{p} T^{\mathrm{hard}}_k := \sum_{s=1}^{K}\omega^{\mathrm{hard}}_{ks}\tau_{0s}. τ k , or hard p T k hard := s = 1 ∑ K ω k s hard τ 0 s . Both sets of weights are nonnegative and sum to one. Consequently, the probability-limit biases relative to the state-k k k effect are
T k s o f t − τ 0 k = ∑ s ≠ k ω k s s o f t ( τ 0 s − τ 0 k ) , T^{\mathrm{soft}}_k - \tau_{0k} = \sum_{s \ne k}\omega^{\mathrm{soft}}_{ks}(\tau_{0s} - \tau_{0k}), T k soft − τ 0 k = s = k ∑ ω k s soft ( τ 0 s − τ 0 k ) , T k h a r d − τ 0 k = ∑ s ≠ k ω k s h a r d ( τ 0 s − τ 0 k ) . (12) T^{\mathrm{hard}}_k - \tau_{0k} = \sum_{s \ne k}\omega^{\mathrm{hard}}_{ks}(\tau_{0s} - \tau_{0k}). \tag*{(12)} T k hard − τ 0 k = s = k ∑ ω k s hard ( τ 0 s − τ 0 k ) . (12) For either oracle estimator, the bias is nonzero exactly when its corresponding sum in (12) is nonzero. In particular, if Pr ( I i k = 1 , q i k < 1 ) > 0 \Pr(I_{ik} = 1, q_{ik} < 1) > 0 Pr ( I ik = 1 , q ik < 1 ) > 0 , both estimators are asymptotically biased whenever τ 0 k \tau_{0k} τ 0 k is a strict maximum or minimum among states of positive probability. Both limits lie below τ 0 k \tau_{0k} τ 0 k at a strict maximum and above it at a strict minimum.
Proof of Proposition A.1. First use an oracle weight w i = w ( H i ) ∈ [ 0 , 1 ] w_i = w(H_i) \in[0,1] w i = w ( H i ) ∈ [ 0 , 1 ] with E [ w ( H i ) ] > 0 \mathbb{E}[w(H_i)] > 0 E [ w ( H i )] > 0 . Put p 1 = e p_1 = e p 1 = e and p 0 = 1 − e p_0 = 1-e p 0 = 1 − e . Randomization, consistency, and the law of large numbers give, for a ∈ { 0 , 1 } a \in\{0,1\} a ∈ { 0 , 1 } ,
1 n ∑ i 1 { A i = a } w ( H i ) Y i → p p a E [ w ( H i ) Y i ( a ) ] , \frac{1}{n}\sum_i \mathbb{1}\{A_i = a\}w(H_i)Y_i \xrightarrow{p} p_a\mathbb{E}[w(H_i)Y_i(a)], n 1 i ∑ 1 { A i = a } w ( H i ) Y i p p a E [ w ( H i ) Y i ( a )] ,
1 n ∑ i 1 { A i = a } w ( H i ) → p p a E [ w ( H i ) ] , \frac{1}{n}\sum_i \mathbb{1}\{A_i = a\}w(H_i) \xrightarrow{p} p_a\mathbb{E}[w(H_i)], n 1 i ∑ 1 { A i = a } w ( H i ) p p a E [ w ( H i )] ,
The first-moment assumption makes these limits finite, and both denominator limits are positive. The continuous mapping theorem and conditioning on H i H_i H i yield the effect averaged over the histories selected by the weight:
Δ ^ n ( ( w ( H i ) ) i ) → p E [ w ( H i ) δ ( H i ) ] E [ w ( H i ) ] . (13) \widehat{\Delta}_n((w(H_i))_i) \xrightarrow{p} \frac{\mathbb{E}[w(H_i)\delta(H_i)]}{\mathbb{E}[w(H_i)]}. \tag*{(13)} Δ n (( w ( H i ) ) i ) p E [ w ( H i )] E [ w ( H i ) δ ( H i )] . (13)
On { I i k = 1 } \{I_{ik}=1\} { I ik = 1 } , q i k ≥ 1 / K q_{ik} \ge1/K q ik ≥ 1/ K ; thus E [ q i k ] ≥ Pr ( I i k = 1 ) / K > 0 \mathbb{E}[q_{ik}] \ge\Pr(I_{ik}=1)/K > 0 E [ q ik ] ≥ Pr ( I ik = 1 ) / K > 0 . For the soft estimator, substitute w ( H i ) = q i k w(H_i)=q_{ik} w ( H i ) = q ik into (13) and then use (1):
E [ q i k δ ( H i ) ] = ∑ s = 1 K E [ q i k q i s ] τ 0 s . \mathbb{E}[q_{ik}\delta(H_i)] = \sum_{s=1}^{K}\mathbb{E}[q_{ik}q_{is}]\tau_{0s}. E [ q ik δ ( H i )] = s = 1 ∑ K E [ q ik q i s ] τ 0 s .
This establishes the claimed soft-weighting limit. The weights sum to one because the posterior coordinates do: ∑ s E [ q i k q i s ] = E [ q i k ] \sum_s \mathbb{E}[q_{ik}q_{is}] = \mathbb{E}[q_{ik}] ∑ s E [ q ik q i s ] = E [ q ik ] .
For hard assignment, I i k I_{ik} I ik is a function of H i H_i H i , so
E [ I i k δ ( H i ) ] = ∑ s = 1 K τ 0 s E [ I i k q i s ] , \mathbb{E}[I_{ik}\delta(H_i)] = \sum_{s=1}^{K}\tau_{0s}\mathbb{E}[I_{ik}q_{is}], E [ I ik δ ( H i )] = s = 1 ∑ K τ 0 s E [ I ik q i s ] ,
E [ I i k q i s ] = E [ I i k E [ 1 ( Z i = s ) ∣ H i ] ] = Pr ( I i k = 1 , Z i = s ) . \mathbb{E}[I_{ik}q_{is}] = \mathbb{E}[I_{ik}\mathbb{E}[1(Z_i=s)\mid H_i]]
= \Pr(I_{ik}=1,Z_i=s). E [ I ik q i s ] = E [ I ik E [ 1 ( Z i = s ) ∣ H i ]] = Pr ( I ik = 1 , Z i = s ) .
Dividing by E [ I i k ] = Pr ( I i k = 1 ) \mathbb{E}[I_{ik}]=\Pr(I_{ik}=1) E [ I ik ] = Pr ( I ik = 1 ) gives the claimed hard-assignment limit. The hard weights sum to one because they are conditional state probabilities. Subtracting τ 0 k \tau_{0k} τ 0 k from each convex combination proves (12).
Finally, the total weight assigned to states other than k k k is
∑ s ≠ k ω k s s o f t = E [ q i k ( 1 − q i k ) ] E [ q i k ] , \sum_{s\ne k}\omega_{ks}^{\mathrm{soft}} = \frac{\mathbb{E}[q_{ik}(1-q_{ik})]}{\mathbb{E}[q_{ik}]}, s = k ∑ ω k s soft = E [ q ik ] E [ q ik ( 1 − q ik )] ,
∑ s ≠ k ω k s h a r d = Pr ( Z i ≠ k ∣ I i k = 1 ) . \sum_{s\ne k}\omega_{ks}^{\mathrm{hard}} = \Pr(Z_i\ne k\mid I_{ik}=1). s = k ∑ ω k s hard = Pr ( Z i = k ∣ I ik = 1 ) .
On { I i k = 1 , q i k < 1 } \{I_{ik}=1,q_{ik}<1\} { I ik = 1 , q ik < 1 } , the maximum-posterior rule implies q i k ≥ 1 / K > 0 q_{ik}\ge1/K>0 q ik ≥ 1/ K > 0 , so both quantities are strictly positive when this event has positive probability. A state of zero probability has zero mixture weight. Thus, if τ 0 k \tau_{0k} τ 0 k is a strict maximum, every nonzero-weight term in (12) is negative; at a strict minimum, every nonzero-weight term is positive. This proves the claimed directions of both biases.
Orthogonal inference for the state ATEs
Throughout this section, E [ f ( W ) ] \mathbb{E}[f(W)] E [ f ( W )] averages over an independent target unit. If f f f depends on the externally fitted HMM, this expectation and its L 2 L_2 L 2 norm condition on the HMM training sample. For a scalar- or vector-valued function f f f of an analysis unit, write ∥ f ∥ L 2 = E [ ∥ f ( W i ) ∥ 2 ] \|f\|_{L_2}=\mathbb{E}[\|f(W_i)\|^2] ∥ f ∥ L 2 = E [ ∥ f ( W i ) ∥ 2 ] .
This section separates the correction-rate calculation from the inference argument. Lemma B.2 verifies the theorem’s assumed rate for the correction computed on the target units. The subsequent theorem proof establishes orthogonality, the asymptotic expansion, and consistency of the sandwich covariance under its stated rate conditions.
Assumption B.1 (Local regularity for orthogonal inference). As η → η 0 \eta\to\eta_0 η → η 0 , q η ( H ) q_\eta(H) q η ( H ) , s H ( H ; η ) s^H(H;\eta) s H ( H ; η ) , and ψ ( τ 0 , η ) \psi(\tau_0,\eta) ψ ( τ 0 , η ) are continuous in L 2 L_2 L 2 . For u = η − η 0 u=\eta-\eta_0 u = η − η 0 , their relevant population means have the second-order expansions
E [ ψ i ( τ 0 , η ) ] = G 0 u + O ( ∥ u ∥ 2 ) , E [ s H ( H i ; η ) ] = J 0 u + O ( ∥ u ∥ 2 ) . (14) \begin{aligned}
\mathbb{E}[\psi_i(\tau_0,\eta)] &= G_0u + O(\lVert u\rVert^2),\\
\mathbb{E}[s^H(H_i;\eta)] &= J_0u + O(\lVert u\rVert^2). \tag*{(14)}
\end{aligned} E [ ψ i ( τ 0 , η )] E [ s H ( H i ; η )] = G 0 u + O (∥ u ∥ 2 ) , = J 0 u + O (∥ u ∥ 2 ) . (14)
Rate of the target-sample correction
The following lemma verifies the rate for (6) . The result holds when the preliminary effect estimate and derivative averages use the same target units.
Lemma B.2 (Rate of the target-sample correction). Assume the sampling, randomization, correctly specified HMM, mixture, rank, history-score, and outcome moment conditions of Theorem 4.1 . Let the HMM fit on its independent history sample satisfy ∥ η ^ − η 0 ∥ = O p ( r η ) \lVert\widehat{\eta}-\eta_0\rVert=O_p(r_\eta) ∥ η − η 0 ∥ = O p ( r η ) for r η = o ( 1 ) r_\eta=o(1) r η = o ( 1 ) . In neighborhoods of ( τ 0 , η 0 ) (\tau_0,\eta_0) ( τ 0 , η 0 ) , suppose nonnegative envelopes L q ( H ) L_q(H) L q ( H ) , L G ( W ) L_G(W) L G ( W ) , and L J ( H ) L_J(H) L J ( H ) satisfy E [ L q 2 ] + E [ L G ] + E [ L J ] < ∞ \mathbb{E}[L_q^2]+\mathbb{E}[L_G]+\mathbb{E}[L_J]<\infty E [ L q 2 ] + E [ L G ] + E [ L J ] < ∞ and
∥ q η ( H ) − q 0 ( H ) ∥ ≤ L q ( H ) ∥ η − η 0 ∥ , \lVert q_\eta(H)-q_0(H)\rVert\le L_q(H)\lVert\eta-\eta_0\rVert, ∥ q η ( H ) − q 0 ( H )∥ ≤ L q ( H ) ∥ η − η 0 ∥ , ∥ D η ψ ( τ , η ) − D η ψ ( τ 0 , η 0 ) ∥ o p ≤ L G ( W ) { ∥ τ − τ 0 ∥ + ∥ η − η 0 ∥ } , \lVert D_\eta\psi(\tau,\eta)-D_\eta\psi(\tau_0,\eta_0)\rVert_{\mathrm{op}}
\le L_G(W)\{\lVert\tau-\tau_0\rVert+\lVert\eta-\eta_0\rVert\}, ∥ D η ψ ( τ , η ) − D η ψ ( τ 0 , η 0 ) ∥ op ≤ L G ( W ) {∥ τ − τ 0 ∥ + ∥ η − η 0 ∥} , ∥ D η s H ( H ; η ) − D η s H ( H ; η 0 ) ∥ o p ≤ L J ( H ) ∥ η − η 0 ∥ . \lVert D_\eta s^H(H;\eta)-D_\eta s^H(H;\eta_0)\rVert_{\mathrm{op}}
\le L_J(H)\lVert\eta-\eta_0\rVert. ∥ D η s H ( H ; η ) − D η s H ( H ; η 0 ) ∥ op ≤ L J ( H ) ∥ η − η 0 ∥ . Assume also E [ ∥ D η ψ i ( τ 0 , η 0 ) ∥ F 2 ] < ∞ \mathbb{E}[\lVert D_\eta\psi_i(\tau_0,\eta_0)\rVert_F^2]<\infty E [∥ D η ψ i ( τ 0 , η 0 ) ∥ F 2 ] < ∞ and E [ ∥ D η s H ( H i ; η 0 ) ∥ F 2 ] < ∞ \mathbb{E}[\lVert D_\eta s^H(H_i;\eta_0)\rVert_F^2]<\infty E [∥ D η s H ( H i ; η 0 ) ∥ F 2 ] < ∞ . Then the construction in (6) , computed on all target units, satisfies
∥ τ ^ p l − τ 0 ∥ = O p ( n − 1 / 2 + r η ) , ∥ B ^ − B 0 ∥ o p = O p ( n − 1 / 2 + r η ) . (15) \left\lVert\widehat{\tau}^{\mathrm{pl}}-\tau_0\right\rVert
=O_p(n^{-1/2}+r_\eta),\qquad
\left\lVert\widehat{B}-B_0\right\rVert_{\mathrm{op}}
=O_p(n^{-1/2}+r_\eta). \tag*{(15)} τ pl − τ 0 = O p ( n − 1/2 + r η ) , B − B 0 op = O p ( n − 1/2 + r η ) . (15)
Proof. Use the externally trained HMM fit after its training-sample label rule; its labels agree with the true labeling with probability tending to one. Write G ^ = E n [ D η ψ ( τ ^ p l , η ^ ) ] \widehat{G}=\mathbb{E}_n[D_\eta\psi(\widehat{\tau}^{\mathrm{pl}},\widehat{\eta})] G = E n [ D η ψ ( τ pl , η )] and J ^ = E n [ D η s H ( H ; η ^ ) ] \widehat{J}=\mathbb{E}_n[D_\eta s^H(H;\widehat{\eta})] J = E n [ D η s H ( H ; η )] , so that B ^ = G ^ J ^ − 1 \widehat{B}=\widehat{G}\widehat{J}^{-1} B = G J − 1 . The envelope conditions justify G 0 = E [ D η ψ i ( τ 0 , η 0 ) ] G_0=\mathbb{E}[D_\eta\psi_i(\tau_0,\eta_0)] G 0 = E [ D η ψ i ( τ 0 , η 0 )] . The mixture identity and (2) give
E [ q 0 ( H i ) A ~ i Y i ] = v A E [ q 0 ( H i ) δ ( H i ) ] = M 0 τ 0 . \mathbb{E}[q_0(H_i)\widetilde{A}_iY_i]
=v_A\mathbb{E}[q_0(H_i)\delta(H_i)]
=M_0\tau_0. E [ q 0 ( H i ) A i Y i ] = v A E [ q 0 ( H i ) δ ( H i )] = M 0 τ 0 .
Write g η ( W ) = A ~ 2 q η ( H ) q η ( H ) ⊤ g_\eta(W)=\widetilde{A}^2q_\eta(H)q_\eta(H)^\top g η ( W ) = A 2 q η ( H ) q η ( H ) ⊤ . The posterior-simplex bound gives ∥ g η − g η 0 ∥ o p ≤ 2 L q ( H ) ∥ η − η 0 ∥ \lVert g_\eta-g_{\eta_0}\rVert_{\mathrm{op}}\le2L_q(H)\lVert\eta-\eta_0\rVert ∥ g η − g η 0 ∥ op ≤ 2 L q ( H ) ∥ η − η 0 ∥ . Decompose
M ^ − M 0 = ( E n − E ) [ g η 0 ] + E n [ g η ^ − g η 0 ] . \widehat{M}-M_0=(\mathbb{E}_n-\mathbb{E})[g_{\eta_0}]
+\mathbb{E}_n[g_{\widehat{\eta}}-g_{\eta_0}]. M − M 0 = ( E n − E ) [ g η 0 ] + E n [ g η − g η 0 ] .
Because g η 0 g_{\eta_0} g η 0 is bounded and E n [ L q ] = O p ( 1 ) \mathbb{E}_n[L_q]=O_p(1) E n [ L q ] = O p ( 1 ) , the two terms are respectively O p ( n − 1 / 2 ) O_p(n^{-1/2}) O p ( n − 1/2 ) and O p ( r η ) O_p(r_\eta) O p ( r η ) . Therefore
∥ M ^ − M 0 ∥ o p = O p ( n − 1 / 2 + r η ) . (16) \lVert\widehat{M}-M_0\rVert_{\mathrm{op}}
=O_p(n^{-1/2}+r_\eta). \tag*{(16)} ∥ M − M 0 ∥ op = O p ( n − 1/2 + r η ) . (16)
Similarly, q 0 A ~ Y q_0\widetilde{A}Y q 0 A Y has finite second moment, while Cauchy–Schwarz gives E n [ L q ( H ) ∣ Y ∣ ] = O p ( 1 ) \mathbb{E}_n[L_q(H)|Y|]=O_p(1) E n [ L q ( H ) ∣ Y ∣ ] = O p ( 1 ) . The decomposition
E n [ q η ^ ( H ) A ~ Y ] − M 0 τ 0 = ( E n − E ) [ q 0 ( H ) A ~ Y ] + E n [ ( q η ^ ( H ) − q 0 ( H ) ) A ~ Y ] \begin{aligned}
\mathbb{E}_n[q_{\widehat{\eta}}(H)\widetilde{A}Y]-M_0\tau_0
={}&(\mathbb{E}_n-\mathbb{E})[q_0(H)\widetilde{A}Y]\\
&+\mathbb{E}_n[(q_{\widehat{\eta}}(H)-q_0(H))\widetilde{A}Y]
\end{aligned} E n [ q η ( H ) A Y ] − M 0 τ 0 = ( E n − E ) [ q 0 ( H ) A Y ] + E n [( q η ( H ) − q 0 ( H )) A Y ]
then gives
∥ E n [ q η ^ ( H ) A ~ Y ] − M 0 τ 0 ∥ = O p ( n − 1 / 2 + r η ) . (17) \left\lVert\mathbb{E}_n[q_{\widehat{\eta}}(H)\widetilde{A}Y]-M_0\tau_0\right\rVert
=O_p(n^{-1/2}+r_\eta). \tag*{(17)} E n [ q η ( H ) A Y ] − M 0 τ 0 = O p ( n − 1/2 + r η ) . (17)
Positive definiteness of M 0 M_0 M 0 and (16) –(17) imply the preliminary effect rate in (15) .
For the derivative mean, add and subtract its value at the fixed population arguments:
G ^ − G 0 = ( E n − E ) [ D η ψ ( τ 0 , η 0 ) ] + E n [ D η ψ ( τ ^ p l , η ^ ) − D η ψ ( τ 0 , η 0 ) ] . \widehat{G} - G_0 = (\mathbb{E}_n - \mathbb{E})[D_\eta\psi(\tau_0,\eta_0)] + \mathbb{E}_n[D_\eta\psi(\widehat{\tau}^{\mathrm{pl}},\widehat{\eta}) - D_\eta\psi(\tau_0,\eta_0)]. G − G 0 = ( E n − E ) [ D η ψ ( τ 0 , η 0 )] + E n [ D η ψ ( τ pl , η ) − D η ψ ( τ 0 , η 0 )] .
The first term is O p ( n − 1 / 2 ) O_p(n^{-1/2}) O p ( n − 1/2 ) by its finite second moment. The second is bounded in operator norm by E n [ L G { ∥ τ ^ p l − τ 0 ∥ + ∥ η ^ − η 0 ∥ } ] \mathbb{E}_n[L_G\{\|\widehat{\tau}^{\mathrm{pl}}-\tau_0\|+\|\widehat{\eta}-\eta_0\|\}] E n [ L G { ∥ τ pl − τ 0 ∥ + ∥ η − η 0 ∥ }] , which is O p ( n − 1 / 2 + r η ) O_p(n^{-1/2}+r_\eta) O p ( n − 1/2 + r η ) by the envelope law of large numbers. The same decomposition with D η s H D_\eta s^H D η s H and L J L_J L J gives ∥ J ^ − J 0 ∥ o p = O p ( n − 1 / 2 + r η ) \|\widehat{J}-J_0\|_{\mathrm{op}}=O_p(n^{-1/2}+r_\eta) ∥ J − J 0 ∥ op = O p ( n − 1/2 + r η ) . These pointwise envelope bounds hold even though τ ^ p l \widehat{\tau}^{\mathrm{pl}} τ pl and the derivative averages use the same target units. Nonsingularity of J 0 J_0 J 0 implies J ^ − 1 = J 0 − 1 + O p ( n − 1 / 2 + r η ) \widehat{J}^{-1}=J_0^{-1}+O_p(n^{-1/2}+r_\eta) J − 1 = J 0 − 1 + O p ( n − 1/2 + r η ) . Expanding G ^ J ^ − 1 − G 0 J 0 − 1 \widehat{G}\widehat{J}^{-1}-G_0J_0^{-1} G J − 1 − G 0 J 0 − 1 proves the asserted rate for B ^ \widehat{B} B .
Orthogonal Correction and Inference
Proof of Theorem 4.1 . Under the additional conditions of Lemma B.2 , the target-sample construction satisfies the theorem’s correction-rate assumption with r B = n − 1 / 2 + r η r_B=n^{-1/2}+r_\eta r B = n − 1/2 + r η . The proof below uses the theorem’s stated rate r B r_B r B , which also allows other constructions that attain it.
In expectations, abbreviate q η ( H i ) \mathbf{q}_\eta(H_i) q η ( H i ) and q 0 ( H i ) \mathbf{q}_0(H_i) q 0 ( H i ) by q η \mathbf{q}_\eta q η and q 0 \mathbf{q}_0 q 0 . Correct HMM specification gives q 0 ( H ) = ( Pr ( Z i = s ∣ H i = H ) ) s = 1 K \mathbf{q}_0(H)=\left(\Pr(Z_i=s\mid H_i=H)\right)_{s=1}^K q 0 ( H ) = ( Pr ( Z i = s ∣ H i = H ) ) s = 1 K . Assumption 3.1 implies δ ( H ) = q 0 ( H ) ⊤ τ 0 \delta(H)=\mathbf{q}_0(H)^\top\tau_0 δ ( H ) = q 0 ( H ) ⊤ τ 0 . Hence E [ q 0 ( H i ) δ ( H i ) ] = Q 0 τ 0 \mathbb{E}[\mathbf{q}_0(H_i)\delta(H_i)]=Q_0\tau_0 E [ q 0 ( H i ) δ ( H i )] = Q 0 τ 0 . Positive definiteness of Q 0 Q_0 Q 0 makes τ 0 \tau_0 τ 0 the unique coefficient satisfying this equation.
Population orthogonality. By (3) , E [ ψ i ( τ 0 , η 0 ) ] = 0 \mathbb{E}[\psi_i(\tau_0,\eta_0)]=0 E [ ψ i ( τ 0 , η 0 )] = 0 . The HMM score has mean zero at η 0 \eta_0 η 0 by assumption. The negative target Jacobian of the corrected score is
− E [ D τ ϕ i ( τ 0 , η 0 , B 0 ) ] = E [ A ~ i 2 q 0 q 0 ⊤ ] = v A Q 0 = M 0 . -\mathbb{E}[D_\tau\phi_i(\tau_0,\eta_0,B_0)] = \mathbb{E}[\widetilde{A}_i^2\mathbf{q}_0\mathbf{q}_0^\top] = v_AQ_0 = M_0. − E [ D τ ϕ i ( τ 0 , η 0 , B 0 )] = E [ A i 2 q 0 q 0 ⊤ ] = v A Q 0 = M 0 .
Put u = η − η 0 u=\eta-\eta_0 u = η − η 0 . The local mean expansions (14) give E [ ψ i ( τ 0 , η ) ] = G 0 u + R ψ ( u ) \mathbb{E}[\psi_i(\tau_0,\eta)]=G_0u+R_\psi(u) E [ ψ i ( τ 0 , η )] = G 0 u + R ψ ( u ) and E [ s H ( H i ; η ) ] = J 0 u + R s ( u ) \mathbb{E}[s^H(H_i;\eta)]=J_0u+R_s(u) E [ s H ( H i ; η )] = J 0 u + R s ( u ) , where ∥ R ψ ( u ) ∥ + ∥ R s ( u ) ∥ ≤ C ∥ u ∥ 2 \|R_\psi(u)\|+\|R_s(u)\|\le C\|u\|^2 ∥ R ψ ( u ) ∥ + ∥ R s ( u ) ∥ ≤ C ∥ u ∥ 2 . For D = B − B 0 D=B-B_0 D = B − B 0 , the mean corrected score at τ 0 \tau_0 τ 0 is
Φ ( η , B ) : = E [ ϕ i ( τ 0 , η , B ) ] = ( G 0 − B 0 J 0 ) u + R ψ ( u ) − B 0 R s ( u ) − D { J 0 u + R s ( u ) } . \begin{aligned}
\Phi(\eta,B)&:=\mathbb{E}[\phi_i(\tau_0,\eta,B)]\\
&=(G_0-B_0J_0)u+R_\psi(u)-B_0R_s(u)-D\{J_0u+R_s(u)\}.
\end{aligned} Φ ( η , B ) := E [ ϕ i ( τ 0 , η , B )] = ( G 0 − B 0 J 0 ) u + R ψ ( u ) − B 0 R s ( u ) − D { J 0 u + R s ( u )} .
The first term vanishes by B 0 = G 0 J 0 − 1 B_0=G_0J_0^{-1} B 0 = G 0 J 0 − 1 . On a sufficiently small neighborhood,
∥ Φ ( η , B ) ∥ ≤ C { ∥ η − η 0 ∥ 2 + ∥ B − B 0 ∥ o p ∥ η − η 0 ∥ } . \|\Phi(\eta,B)\|\le C\{\|\eta-\eta_0\|^2+\|B-B_0\|_{\mathrm{op}}\|\eta-\eta_0\|\}. ∥Φ ( η , B ) ∥ ≤ C { ∥ η − η 0 ∥ 2 + ∥ B − B 0 ∥ op ∥ η − η 0 ∥ } .
Target-sample fluctuation. The external HMM histories determine the labeling of η ^ \widehat{\eta} η independently of the target units. The assumed rate for η ^ − η 0 \widehat{\eta}-\eta_0 η − η 0 is in this common labeling. Put
f 0 ( W ) = ϕ ( W ; τ 0 , η 0 , B 0 ) , f_0(W)=\phi(W;\tau_0,\eta_0,B_0), f 0 ( W ) = ϕ ( W ; τ 0 , η 0 , B 0 ) ,
d ( W ) = ψ ( W ; τ 0 , η ^ ) − B 0 s H ( H ; η ^ ) − f 0 ( W ) . d(W)=\psi(W;\tau_0,\widehat{\eta})-B_0s^H(H;\widehat{\eta})-f_0(W). d ( W ) = ψ ( W ; τ 0 , η ) − B 0 s H ( H ; η ) − f 0 ( W ) .
Since f 0 ( W ) = ψ ( W ; τ 0 , η 0 ) − B 0 s H ( H ; η 0 ) f_0(W)=\psi(W;\tau_0,\eta_0)-B_0s^H(H;\eta_0) f 0 ( W ) = ψ ( W ; τ 0 , η 0 ) − B 0 s H ( H ; η 0 ) , the triangle inequality gives
∥ d ∥ L 2 ≤ ∥ ψ ( τ 0 , η ^ ) − ψ ( τ 0 , η 0 ) ∥ L 2 + ∥ B 0 ∥ o p ∥ s H ( H ; η ^ ) − s H ( H ; η 0 ) ∥ L 2 = o p ( 1 ) , \|d\|_{L_2}\le\|\psi(\tau_0,\widehat{\eta})-\psi(\tau_0,\eta_0)\|_{L_2}
+\|B_0\|_{\mathrm{op}}\|s^H(H;\widehat{\eta})-s^H(H;\eta_0)\|_{L_2}=o_p(1), ∥ d ∥ L 2 ≤ ∥ ψ ( τ 0 , η ) − ψ ( τ 0 , η 0 ) ∥ L 2 + ∥ B 0 ∥ op ∥ s H ( H ; η ) − s H ( H ; η 0 ) ∥ L 2 = o p ( 1 ) ,
by the assumed L 2 L_2 L 2 continuity and consistency of η ^ \widehat{\eta} η . Both terms in f 0 f_0 f 0 have zero population mean, so E [ f 0 ] = 0 \mathbb{E}[f_0] = \mathbf{0} E [ f 0 ] = 0 . Taking expectations in the definition of d d d and setting u = η ^ − η 0 u = \widehat{\eta} - \eta_0 u = η − η 0 , the local mean expansions give
E [ d ] = E [ ψ ( τ 0 , η ^ ) ] − B 0 E [ s H ( H ; η ^ ) ] = { G 0 u + R ψ ( u ) } − B 0 { J 0 u + R s ( u ) } = R ψ ( u ) − B 0 R s ( u ) , \begin{aligned}
\mathbb{E}[d] &= \mathbb{E}[\psi(\tau_0,\widehat{\eta})] - B_0\mathbb{E}[s^H(H;\widehat{\eta})] \\
&= \{G_0u + R_\psi(u)\} - B_0\{J_0u + R_s(u)\} \\
&= R_\psi(u) - B_0R_s(u),
\end{aligned} E [ d ] = E [ ψ ( τ 0 , η )] − B 0 E [ s H ( H ; η )] = { G 0 u + R ψ ( u )} − B 0 { J 0 u + R s ( u )} = R ψ ( u ) − B 0 R s ( u ) ,
where the last equality uses B 0 J 0 = G 0 B_0J_0 = G_0 B 0 J 0 = G 0 . The remainder bound and ∥ u ∥ = O p ( r η ) \|u\| = O_p(r_\eta) ∥ u ∥ = O p ( r η ) therefore give ∥ E [ d ] ∥ = O p ( r η 2 ) \|\mathbb{E}[d]\| = O_p(r_\eta^2) ∥ E [ d ] ∥ = O p ( r η 2 ) . Let F t r \mathcal{F}_{\mathrm{tr}} F tr contain the external HMM training data and fitting randomness. Conditional on F t r \mathcal{F}_{\mathrm{tr}} F tr , d d d is fixed and the target units are independent. Put X i = d ( W i ) − E [ d ] X_i = d(W_i) - \mathbb{E}[d] X i = d ( W i ) − E [ d ] , so E [ X i ∣ F t r ] = 0 \mathbb{E}[X_i \mid\mathcal{F}_{\mathrm{tr}}] = 0 E [ X i ∣ F tr ] = 0 . Conditional independence makes the cross terms in the squared norm vanish. Expanding ∥ X i ∥ 2 \|X_i\|^2 ∥ X i ∥ 2 then gives
E [ ∥ ( E n − E ) [ d ] ∥ 2 ∣ F t r ] = 1 n 2 ∑ i = 1 n E [ ∥ X i ∥ 2 ∣ F t r ] = 1 n { ∥ d ∥ L 2 2 − ∥ E [ d ] ∥ 2 } ≤ ∥ d ∥ L 2 2 n . \begin{aligned}
\mathbb{E}\left[\|(\mathbb{E}_n-\mathbb{E})[d]\|^2 \mid\mathcal{F}_{\mathrm{tr}}\right]
= \frac{1}{n^2}\sum_{i=1}^n \mathbb{E}\left[\|X_i\|^2 \mid\mathcal{F}_{\mathrm{tr}}\right] \\
&= \frac{1}{n}\left\{\|d\|_{L_2}^2 - \|\mathbb{E}[d]\|^2\right\}
\le\frac{\|d\|_{L_2}^2}{n}.
\end{aligned} E [ ∥ ( E n − E ) [ d ] ∥ 2 ∣ F tr ] = n 2 1 i = 1 ∑ n E [ ∥ X i ∥ 2 ∣ F tr ] = n 1 { ∥ d ∥ L 2 2 − ∥ E [ d ] ∥ 2 } ≤ n ∥ d ∥ L 2 2 .
Conditional Chebyshev’s inequality therefore gives ( E n − E ) [ d ] = o p ( n − 1 / 2 ) (\mathbb{E}_n-\mathbb{E})[d] = o_p(n^{-1/2}) ( E n − E ) [ d ] = o p ( n − 1/2 ) .
The target estimating equation has sample mean S n ( τ ) = E n [ ψ ( W ; τ , η ^ ) ] − B ^ E n [ s H ( H ; η ^ ) ] S_n(\tau) = \mathbb{E}_n[\psi(W;\tau,\widehat{\eta})] - \widehat{B}\mathbb{E}_n[s^H(H;\widehat{\eta})] S n ( τ ) = E n [ ψ ( W ; τ , η )] − B E n [ s H ( H ; η )] . The estimate B ^ \widehat{B} B uses the target units, so we separate its error rather than condition on it. Adding and subtracting B 0 E n [ s H ( H ; η ^ ) ] B_0\mathbb{E}_n[s^H(H;\widehat{\eta})] B 0 E n [ s H ( H ; η )] gives
S n ( τ 0 ) = 1 n ∑ i = 1 n ϕ 0 i + E [ d ] + ( E n − E ) [ d ] S_n(\tau_0) = \frac{1}{n}\sum_{i=1}^n \phi_{0i} + \mathbb{E}[d] + (\mathbb{E}_n-\mathbb{E})[d] S n ( τ 0 ) = n 1 i = 1 ∑ n ϕ 0 i + E [ d ] + ( E n − E ) [ d ]
− ( B ^ − B 0 ) E n [ s H ( H ; η ^ ) ] . \qquad-(\widehat{B}-B_0)\mathbb{E}_n[s^H(H;\widehat{\eta})]. − ( B − B 0 ) E n [ s H ( H ; η )] .
The second expansion in (14) gives E [ s H ( H ; η ^ ) ] = O p ( r η ) \mathbb{E}[s^H(H;\widehat{\eta})] = O_p(r_\eta) E [ s H ( H ; η )] = O p ( r η ) . Conditional on the external HMM fit, the target units are independent. L 2 L_2 L 2 continuity of the history score implies ∥ s H ( H ; η ^ ) ∥ L 2 = O p ( 1 ) \|s^H(H;\widehat{\eta})\|_{L_2} = O_p(1) ∥ s H ( H ; η ) ∥ L 2 = O p ( 1 ) , so conditional Chebyshev’s inequality gives ( E n − E ) [ s H ( H ; η ^ ) ] = O p ( n − 1 / 2 ) (\mathbb{E}_n-\mathbb{E})[s^H(H;\widehat{\eta})] = O_p(n^{-1/2}) ( E n − E ) [ s H ( H ; η )] = O p ( n − 1/2 ) . Therefore ( B ^ − B 0 ) E n [ s H ( H ; η ^ ) ] = O p { r B ( n − 1 / 2 + r η ) } (\widehat{B}-B_0)\mathbb{E}_n[s^H(H;\widehat{\eta})] = O_p\{r_B(n^{-1/2} + r_\eta)\} ( B − B 0 ) E n [ s H ( H ; η )] = O p { r B ( n − 1/2 + r η )} . Since r B = o ( 1 ) r_B = o(1) r B = o ( 1 ) ,
S n ( τ 0 ) = 1 n ∑ i = 1 n ϕ 0 i + O p ( r η 2 + r η r B ) + o p ( n − 1 / 2 ) . (18) S_n(\tau_0) = \frac{1}{n}\sum_{i=1}^n \phi_{0i} + O_p(r_\eta^2 + r_\eta r_B) + o_p(n^{-1/2}). \tag*{(18)} S n ( τ 0 ) = n 1 i = 1 ∑ n ϕ 0 i + O p ( r η 2 + r η r B ) + o p ( n − 1/2 ) . (18)
Gram matrix, rate, and limit. We establish Gram consistency under the theorem’s L 2 L_2 L 2 continuity condition. The preceding lemma gives a stronger quantitative bound under its additional envelope condition. Posterior probabilities are bounded, which keeps the sample Gram matrix stable as η ^ \widehat{\eta} η approaches η 0 \eta_0 η 0 . Put g η ( W ) = A ~ 2 q η ( H ) q η ( H ) ⊤ g_\eta(W) = \widetilde{A}^{2}q_\eta(H)q_\eta(H)^\top g η ( W ) = A 2 q η ( H ) q η ( H ) ⊤ . Posterior vectors lie in the probability simplex, so ∥ q η ( H ) ∥ ≤ 1 \|q_\eta(H)\| \le1 ∥ q η ( H ) ∥ ≤ 1 and
∥ g η ( W ) − g η 0 ( W ) ∥ o p ≤ 2 ∥ q η ( H ) − q 0 ( H ) ∥ . (19) \|g_\eta(W) - g_{\eta_0}(W)\|_{\mathrm{op}} \le2\|q_\eta(H) - q_0(H)\|. \tag*{(19)} ∥ g η ( W ) − g η 0 ( W ) ∥ op ≤ 2∥ q η ( H ) − q 0 ( H ) ∥. (19)
Decompose
M ^ − M 0 = ( E n − E ) [ g η 0 ] + E n [ g η ^ − g η 0 ] . \widehat{M} - M_0 = (\mathbb{E}_n-\mathbb{E})[g_{\eta_0}] + \mathbb{E}_n[g_{\widehat{\eta}} - g_{\eta_0}]. M − M 0 = ( E n − E ) [ g η 0 ] + E n [ g η − g η 0 ] .
The first term is O p ( n − 1 / 2 ) O_p(n^{-1/2}) O p ( n − 1/2 ) , since g η 0 g_{\eta_0} g η 0 is bounded. Correct specification and the common state labeling give q η 0 = q 0 \mathbf{q}_{\eta_0}=\mathbf{q}_0 q η 0 = q 0 . The assumed HMM rate has r η → 0 r_\eta\to0 r η → 0 , so η ^ → p η 0 \hat{\eta}\overset{p}{\to}\eta_0 η ^ → p η 0 . For any ε > 0 \varepsilon>0 ε > 0 , the L 2 L_2 L 2 continuity of q η \mathbf{q}_\eta q η supplies γ > 0 \gamma>0 γ > 0 such that ∥ η − η 0 ∥ < γ \lVert\eta-\eta_0\rVert<\gamma ∥ η − η 0 ∥ < γ implies ∥ q η − q 0 ∥ L 2 < ε \lVert\mathbf{q}_\eta-\mathbf{q}_0\rVert_{L_2}<\varepsilon ∥ q η − q 0 ∥ L 2 < ε . Thus
Pr { ∥ q η ^ − q 0 ∥ L 2 ≥ ε } ≤ Pr { ∥ η ^ − η 0 ∥ ≥ γ } → 0 , \Pr\left\{\lVert\mathbf{q}_{\hat{\eta}}-\mathbf{q}_0\rVert_{L_2}\ge\varepsilon\right\}\le\Pr\left\{\lVert\hat{\eta}-\eta_0\rVert\ge\gamma\right\}\to0, Pr { ∥ q η ^ − q 0 ∥ L 2 ≥ ε } ≤ Pr { ∥ η ^ − η 0 ∥ ≥ γ } → 0 ,
which proves ∥ q η ^ − q 0 ∥ L 2 = o p ( 1 ) \lVert\mathbf{q}_{\hat{\eta}}-\mathbf{q}_0\rVert_{L_2}=o_p(1) ∥ q η ^ − q 0 ∥ L 2 = o p ( 1 ) . By (19) , the second term is bounded in operator norm by 2 E n [ ∥ q η ^ ( H ) − q 0 ( H ) ∥ ] 2\mathbb{E}_n[\lVert\mathbf{q}_{\hat{\eta}}(H)-\mathbf{q}_0(H)\rVert] 2 E n [∥ q η ^ ( H ) − q 0 ( H )∥] . Conditional on the external fit, its expectation is at most 2 ∥ q η ^ − q 0 ∥ L 2 = o p ( 1 ) 2\lVert\mathbf{q}_{\hat{\eta}}-\mathbf{q}_0\rVert_{L_2}=o_p(1) 2 ∥ q η ^ − q 0 ∥ L 2 = o p ( 1 ) . Conditional Markov’s inequality therefore gives M ^ = M 0 + o p ( 1 ) \widehat{M}=M_0+o_p(1) M = M 0 + o p ( 1 ) . Since λ min ( M 0 ) ≥ v A κ 0 \lambda_{\min}(M_0)\ge v_A\kappa_0 λ m i n ( M 0 ) ≥ v A κ 0 , Weyl’s inequality implies, with probability tending to one,
∥ M ^ − 1 ∥ o p ≤ 2 v A κ 0 , M ^ − 1 = M 0 − 1 + o p ( 1 ) . (20) \left\lVert\widehat{M}^{-1}\right\rVert_{\mathrm{op}}\le\frac{2}{v_A\kappa_0},\qquad\widehat{M}^{-1}=M_0^{-1}+o_p(1). \tag*{(20)} M − 1 op ≤ v A κ 0 2 , M − 1 = M 0 − 1 + o p ( 1 ) . (20)
The matrix B ^ \widehat{B} B is computed using the preliminary τ ^ p l \widehat{\tau}^{\mathrm{pl}} τ pl and held fixed when solving for τ \tau τ . By the definitions of ψ \psi ψ and M ^ \widehat{M} M , the sample score is affine in τ \tau τ :
S n ( τ ) = E n [ q η ^ ( H ) A ~ Y ] − M ^ τ − B ^ E n [ s H ( H ; η ^ ) ] = S n ( τ 0 ) − M ^ ( τ − τ 0 ) . \begin{aligned}
S_n(\tau)=\mathbb{E}_n[\mathbf{q}_{\hat{\eta}}(H)\widetilde{A}Y]-\widehat{M}\tau-\widehat{B}\mathbb{E}_n[s^H(H;\hat{\eta})] \\
&=S_n(\tau_0)-\widehat{M}(\tau-\tau_0).
\end{aligned} S n ( τ ) = E n [ q η ^ ( H ) A Y ] − M τ − B E n [ s H ( H ; η ^ )] = S n ( τ 0 ) − M ( τ − τ 0 ) .
(4) makes the first term M ^ τ ^ p l \widehat{M}\widehat{\tau}^{\mathrm{pl}} M τ pl , so (7) satisfies S n ( τ ^ ⊥ ) = 0 S_n(\widehat{\tau}^{\perp})=0 S n ( τ ⊥ ) = 0 . Thus 0 = S n ( τ 0 ) − M ^ ( τ ^ ⊥ − τ 0 ) 0=S_n(\tau_0)-\widehat{M}(\widehat{\tau}^{\perp}-\tau_0) 0 = S n ( τ 0 ) − M ( τ ⊥ − τ 0 ) , and inversion gives the exact identity
τ ^ ⊥ − τ 0 = M ^ − 1 S n ( τ 0 ) . (21) \widehat{\tau}^{\perp}-\tau_0=\widehat{M}^{-1}S_n(\tau_0). \tag*{(21)} τ ⊥ − τ 0 = M − 1 S n ( τ 0 ) . (21)
The mean-zero vectors ϕ 0 i \phi_{0i} ϕ 0 i have finite variance because posterior probabilities and A ~ i \widetilde{A}_i A i are bounded, while Y i ( a ) Y_i(a) Y i ( a ) and the true history score have finite second moments. Their average is therefore O p ( n − 1 / 2 ) O_p(n^{-1/2}) O p ( n − 1/2 ) . Combining (18) and (20) –(21) gives the expansion (9) . The inverse bound in (20) then gives (10) . If n ( r η 2 + r η r B ) → 0 \sqrt{n}(r_\eta^2+r_\eta r_B)\to0 n ( r η 2 + r η r B ) → 0 , the remainder in (9) is o p ( n − 1 / 2 ) o_p(n^{-1/2}) o p ( n − 1/2 ) . The normal limit in (11) follows from the multivariate central limit theorem and Slutsky’s theorem.
Sandwich covariance. Let ϕ ^ i \widehat{\phi}_i ϕ i be the fitted score at τ ^ ⊥ \widehat{\tau}^{\perp} τ ⊥ . Affinity gives
ϕ ^ i − ϕ 0 i = d ( W i ) − ( B ^ − B 0 ) s H ( H i ; η ^ ) − A ~ i 2 q ^ i q ^ i T ( τ ^ ⊥ − τ 0 ) . \widehat{\phi}_i-\phi_{0i}=d(W_i)-(\widehat{B}-B_0)s^H(H_i;\hat{\eta})-\widetilde{A}_i^2\widehat{\mathbf{q}}_i\widehat{\mathbf{q}}_i^{\mathsf T}(\widehat{\tau}^{\perp}-\tau_0). ϕ i − ϕ 0 i = d ( W i ) − ( B − B 0 ) s H ( H i ; η ^ ) − A i 2 q i q i T ( τ ⊥ − τ 0 ) .
Conditional Markov’s inequality and ∥ d ∥ L 2 = o p ( 1 ) \lVert d\rVert_{L_2}=o_p(1) ∥ d ∥ L 2 = o p ( 1 ) imply E n [ ∥ d ( W ) ∥ 2 ] = o p ( 1 ) \mathbb{E}_n[\lVert d(W)\rVert^2]=o_p(1) E n [∥ d ( W ) ∥ 2 ] = o p ( 1 ) . The L 2 L_2 L 2 continuity of the history score and independence of the external fit imply E n [ ∥ s H ( H ; η ^ ) ∥ 2 ] = O p ( 1 ) \mathbb{E}_n[\lVert s^H(H;\hat{\eta})\rVert^2]=O_p(1) E n [∥ s H ( H ; η ^ ) ∥ 2 ] = O p ( 1 ) . This, ∥ B ^ − B 0 ∥ o p = o p ( 1 ) \lVert\widehat{B}-B_0\rVert_{\mathrm{op}}=o_p(1) ∥ B − B 0 ∥ op = o p ( 1 ) , the posterior-simplex bound, and the estimation rate imply n − 1 ∑ i ∥ ϕ ^ i − ϕ 0 i ∥ 2 = o p ( 1 ) n^{-1}\sum_i\lVert\widehat{\phi}_i-\phi_{0i}\rVert^2=o_p(1) n − 1 ∑ i ∥ ϕ i − ϕ 0 i ∥ 2 = o p ( 1 ) . Cauchy–Schwarz and the law of large numbers for n − 1 ∑ i ϕ 0 i ϕ 0 i T n^{-1}\sum_i\phi_{0i}\phi_{0i}^{\mathsf T} n − 1 ∑ i ϕ 0 i ϕ 0 i T give Ω ^ → p Ω 0 \widehat{\Omega}\overset{p}{\to}\Omega_0 Ω → p Ω 0 . Together with (20) , this proves the sandwich assertion in the theorem. □
When treatment-effect sufficiency is violated
This section keeps randomized treatment and a correctly specified, label-aligned HMM with the true number of states K K K , but allows treatment effects to vary with history within a state. If the estimator in Section 4 is left unchanged, it estimates a projection of the history-conditional effect. The gap from the true state effects depends on how within-state effect variation covaries with the posterior; the prevalence-weighted average still equals the overall ATE.
Conditional effects and the projection target. Let Δ i = Y i ( 1 ) − Y i ( 0 ) \Delta_i = Y_i(1) - Y_i(0) Δ i = Y i ( 1 ) − Y i ( 0 ) . For each state with positive prevalence, write
τ s ( h ) = E [ Δ i ∣ Z i = s , H i = h ] , τ 0 s = E [ τ s ( H i ) ∣ Z i = s ] . \tau_s(h) = \mathbb{E}[\Delta_i \mid Z_i = s, H_i = h], \qquad\tau_{0s} = \mathbb{E}[\tau_s(H_i) \mid Z_i = s]. τ s ( h ) = E [ Δ i ∣ Z i = s , H i = h ] , τ 0 s = E [ τ s ( H i ) ∣ Z i = s ] .
The conditional effect τ s ( h ) \tau_s(h) τ s ( h ) is needed only where q 0 s ( h ) > 0 q_{0s}(h) > 0 q 0 s ( h ) > 0 . Define the residual and decompose the conditional effect:
r ( H ) = ∑ s = 1 K q 0 s ( H ) { τ s ( H ) − τ 0 s } , r(H) = \sum_{s=1}^{K} q_{0s}(H)\{\tau_s(H) - \tau_{0s}\}, r ( H ) = s = 1 ∑ K q 0 s ( H ) { τ s ( H ) − τ 0 s } ,
δ ( H ) = ∑ s = 1 K q 0 s ( H ) τ s ( H ) = q 0 ( H ) T τ 0 + r ( H ) . (22) \delta(H) = \sum_{s=1}^{K} q_{0s}(H)\tau_s(H) = \mathbf{q}_0(H)^{\mathsf{T}}\tau_0 + r(H). \tag*{(22)} δ ( H ) = s = 1 ∑ K q 0 s ( H ) τ s ( H ) = q 0 ( H ) T τ 0 + r ( H ) . (22)
Assumption 3.1 makes every within-state deviation zero and therefore implies r ( H ) = 0 r(H) = 0 r ( H ) = 0 . The converse need not hold: deviations in different states can cancel in the observable mixture.
With finite outcome second moments, suppose Q 0 = E [ q 0 ( H i ) q 0 ( H i ) T ] Q_0 = \mathbb{E}[\mathbf{q}_0(H_i)\mathbf{q}_0(H_i)^{\mathsf{T}}] Q 0 = E [ q 0 ( H i ) q 0 ( H i ) T ] is nonsingular. The population moment (3) then has the unique root
τ ⋆ = Q 0 − 1 E [ q 0 ( H i ) δ ( H i ) ] = arg min τ ∈ R K E [ { δ ( H i ) − q 0 ( H i ) T τ } 2 ] . (23) \tau^\star= Q_0^{-1}\mathbb{E}[\mathbf{q}_0(H_i)\delta(H_i)] = \underset{\tau\in\mathbb{R}^{K}}{\arg\min}\mathbb{E}\left[\{\delta(H_i) - \mathbf{q}_0(H_i)^{\mathsf{T}}\tau\}^{2}\right]. \tag*{(23)} τ ⋆ = Q 0 − 1 E [ q 0 ( H i ) δ ( H i )] = τ ∈ R K arg min E [ { δ ( H i ) − q 0 ( H i ) T τ } 2 ] . (23)
Thus q 0 ( H ) T τ ⋆ \mathbf{q}_0(H)^{\mathsf{T}}\tau^\star q 0 ( H ) T τ ⋆ is the best linear approximation to δ ( H ) \delta(H) δ ( H ) using the state posterior coordinates.
Bias relative to the state effects. For any measurable g ( H i ) g(H_i) g ( H i ) integrable within state s s s , posterior reweighting gives
E [ q 0 s ( H i ) g ( H i ) ] = π s E [ g ( H i ) ∣ Z i = s ] . (24) \mathbb{E}[q_{0s}(H_i)g(H_i)] = \pi_s\mathbb{E}[g(H_i) \mid Z_i = s]. \tag*{(24)} E [ q 0 s ( H i ) g ( H i )] = π s E [ g ( H i ) ∣ Z i = s ] . (24)
This identity follows from q 0 s ( H i ) = E [ 1 { Z i = s } ∣ H i ] q_{0s}(H_i) = \mathbb{E}[\mathbb{1}\{Z_i = s\} \mid H_i] q 0 s ( H i ) = E [ 1 { Z i = s } ∣ H i ] .
Proposition C.1 (Bias under within-state effect variation). Suppose A i ∼ Bernoulli ( e ) A_i \sim\operatorname{Bernoulli}(e) A i ∼ Bernoulli ( e ) independently of ( H i , Y i ( 0 ) , Y i ( 1 ) ) (H_i, Y_i(0), Y_i(1)) ( H i , Y i ( 0 ) , Y i ( 1 )) , with known e ∈ ( 0 , 1 ) e \in(0, 1) e ∈ ( 0 , 1 ) . Suppose outcomes are consistent with finite second moments, the HMM is correctly specified with the true K K K , and λ min ( Q 0 ) > 0 \lambda_{\min}(Q_0) > 0 λ m i n ( Q 0 ) > 0 . Treatment-effect sufficiency is not required. Then
c t = ∑ s = 1 K π s Cov { q 0 t ( H i ) , τ s ( H i ) ∣ Z i = s } , t = 1 , … , K , c_t = \sum_{s=1}^{K} \pi_s \operatorname{Cov}\{q_{0t}(H_i), \tau_s(H_i) \mid Z_i = s\}, \qquad t = 1,\ldots,K, c t = s = 1 ∑ K π s Cov { q 0 t ( H i ) , τ s ( H i ) ∣ Z i = s } , t = 1 , … , K , τ ⋆ − τ 0 = Q 0 − 1 c , c = ( c 1 , … , c K ) T . (25) \tau^\star- \tau_0 = Q_0^{-1}c, \qquad c = (c_1,\ldots,c_K)^{\mathsf{T}}. \tag*{(25)} τ ⋆ − τ 0 = Q 0 − 1 c , c = ( c 1 , … , c K ) T . (25) Moreover,
π T τ ⋆ = π T τ 0 = E [ Δ i ] . \pi^{\mathsf{T}}\tau^\star= \pi^{\mathsf{T}}\tau_0 = \mathbb{E}[\Delta_i]. π T τ ⋆ = π T τ 0 = E [ Δ i ] .
Proof. Equations (22) and (23) give
Q 0 ( τ ⋆ − τ 0 ) = E [ q 0 ( H i ) r ( H i ) ] . Q_0(\tau^\star- \tau_0) = \mathbb{E}[\mathbf{q}_0(H_i)r(H_i)]. Q 0 ( τ ⋆ − τ 0 ) = E [ q 0 ( H i ) r ( H i )] .
For coordinate t t t , apply (24) to each term in r ( H i ) r(H_i) r ( H i ) :
E [ q 0 t ( H i ) r ( H i ) ] = ∑ s = 1 K π s E [ q 0 t ( H i ) { τ s ( H i ) − τ 0 s } ∣ Z i = s ] . \mathbb{E}[q_{0t}(H_i)r(H_i)] = \sum_{s=1}^{K}\pi_s\mathbb{E}[q_{0t}(H_i)\{\tau_s(H_i) - \tau_{0s}\} \mid Z_i = s]. E [ q 0 t ( H i ) r ( H i )] = s = 1 ∑ K π s E [ q 0 t ( H i ) { τ s ( H i ) − τ 0 s } ∣ Z i = s ] .
Because E [ τ s ( H i ) ∣ Z i = s ] = τ 0 s \mathbb{E}[\tau_s(H_i) \mid Z_i = s] = \tau_{0s} E [ τ s ( H i ) ∣ Z i = s ] = τ 0 s , each conditional expectation is the covariance in (25) . Finite outcome second moments make these terms integrable.
The posterior coordinates sum to one, so Q 0 1 = E [ q 0 ( H i ) ] = π Q_0\mathbf{1}=\mathbb{E}[\mathbf{q}_0(H_i)]=\boldsymbol{\pi} Q 0 1 = E [ q 0 ( H i )] = π . Hence
π ⊤ τ ⋆ = 1 ⊤ Q 0 τ ⋆ = E [ δ ( H i ) ] = E [ Δ i ] = π ⊤ τ 0 . \boldsymbol{\pi}^{\top}\boldsymbol{\tau}^{\star}=\mathbf{1}^{\top}Q_0\boldsymbol{\tau}^{\star}=\mathbb{E}[\delta(H_i)]=\mathbb{E}[\Delta_i]=\boldsymbol{\pi}^{\top}\boldsymbol{\tau}_0. π ⊤ τ ⋆ = 1 ⊤ Q 0 τ ⋆ = E [ δ ( H i )] = E [ Δ i ] = π ⊤ τ 0 .
Within-state effect variation alone does not force bias. A sufficient condition for τ ⋆ = τ 0 \boldsymbol{\tau}^{\star}=\boldsymbol{\tau}_0 τ ⋆ = τ 0 is that, within every true state, τ s ( H i ) \tau_s(H_i) τ s ( H i ) is uncorrelated with each posterior coordinate. Bias can arise when histories that make a state more likely also change treatment response among members of that state. For example, members with a large q 0 s ( H ) q_{0s}(H) q 0 s ( H ) might respond more strongly than less typical members of the same true state.
Because ∥ Q 0 − 1 ∥ o p = 1 / λ min ( Q 0 ) \lVert Q_0^{-1}\rVert_{\mathrm{op}}=1/\lambda_{\min}(Q_0) ∥ Q 0 − 1 ∥ op = 1/ λ m i n ( Q 0 ) , weak posterior rank can amplify the covariance vector in (25) . The resulting error redistributes effect across states: some state effects can be too high and others too low, but their prevalence-weighted average remains the overall ATE.
A sensitivity bound from posterior spread. Let σ t s = std ( q 0 t ( H i ) ∣ Z i = s ) \sigma_{ts}=\operatorname{std}\left(q_{0t}(H_i)\mid Z_i=s\right) σ t s = std ( q 0 t ( H i ) ∣ Z i = s ) . Equation (24) identifies this within-state posterior spread from the distribution of the true posteriors:
σ t s 2 = E [ q 0 s ( H i ) q 0 t ( H i ) 2 ] π s − { E [ q 0 s ( H i ) q 0 t ( H i ) ] π s } 2 . \sigma_{ts}^{2}=\frac{\mathbb{E}\left[q_{0s}(H_i)q_{0t}(H_i)^2\right]}{\pi_s}-\left\{\frac{\mathbb{E}\left[q_{0s}(H_i)q_{0t}(H_i)\right]}{\pi_s}\right\}^{2}. σ t s 2 = π s E [ q 0 s ( H i ) q 0 t ( H i ) 2 ] − { π s E [ q 0 s ( H i ) q 0 t ( H i ) ] } 2 .
Suppose the analyst posits std ( τ s ( H i ) ∣ Z i = s ) ≤ Γ \operatorname{std}\left(\tau_s(H_i)\mid Z_i=s\right)\leq\Gamma std ( τ s ( H i ) ∣ Z i = s ) ≤ Γ for every state. Cauchy–Schwarz applied to (25) gives
b k = ∑ t = 1 K ∣ ( Q 0 − 1 ) k t ∣ ∑ s = 1 K π s σ t s , b_k=\sum_{t=1}^{K}\left|(Q_0^{-1})_{kt}\right|\sum_{s=1}^{K}\pi_s\sigma_{ts}, b k = t = 1 ∑ K ( Q 0 − 1 ) k t s = 1 ∑ K π s σ t s ,
{#eq:26}
|\tau_k^{\star}-\tau_{0k}|\leq\Gamma b_k.
All terms in b k b_k b k depend only on the posterior distribution and can be estimated from fitted target posteriors. The bound is conservative: it allows the covariance terms to attain their largest magnitudes with the signs that maximize the error in state k k k .
When the fitted number of states is incorrect
The main identification and inference results assume a correctly specified HMM with the true number of states. Here we describe the population target of posterior unmixing when the fitted state count differs from the true count. The same characterization applies to other misspecified state models.
Let K 0 K_0 K 0 be the true state count and K K K the fitted count. The main-text posterior q 0 \mathbf{q}_0 q 0 , effect vector τ 0 \boldsymbol{\tau}_0 τ 0 , and mean posterior π \boldsymbol{\pi} π have K 0 K_0 K 0 coordinates here; the mixture identity (1) continues to hold. We retain randomized treatment, consistency, and E [ Y i ( a ) 2 ] < ∞ \mathbb{E}[Y_i(a)^2]<\infty E [ Y i ( a ) 2 ] < ∞ for a ∈ { 0 , 1 } a\in\{0,1\} a ∈ { 0 , 1 } .
Suppose an HMM fitted on independent histories yields, after a fixed label rule, posterior maps converging in L 2 L_2 L 2 to a deterministic map q ∗ ( H ) = ( q 1 ∗ ( H ) , … , q K ∗ ( H ) ) ⊤ \mathbf{q}^{\ast}(H)=(q_1^{\ast}(H),\ldots,q_K^{\ast}(H))^{\top} q ∗ ( H ) = ( q 1 ∗ ( H ) , … , q K ∗ ( H ) ) ⊤ whose coordinates are nonnegative and sum to one:
∥ q ^ η − q ∗ ∥ L 2 → p 0. \left\lVert\widehat{\mathbf{q}}_{\eta}-\mathbf{q}^{\ast}\right\rVert_{L_2}\xrightarrow{p}0. ∥ q η − q ∗ ∥ L 2 p 0.
Define the fitted posterior Gram matrix and its mean:
Q ∗ = E [ q ∗ ( H i ) q ∗ ( H i ) ⊤ ] , π ∗ = E [ q ∗ ( H i ) ] . Q^{\ast}=\mathbb{E}\left[\mathbf{q}^{\ast}(H_i)\mathbf{q}^{\ast}(H_i)^{\top}\right],\qquad\boldsymbol{\pi}^{\ast}=\mathbb{E}\left[\mathbf{q}^{\ast}(H_i)\right]. Q ∗ = E [ q ∗ ( H i ) q ∗ ( H i ) ⊤ ] , π ∗ = E [ q ∗ ( H i ) ] .
Assume Q ∗ Q^{\ast} Q ∗ is nonsingular. We impose no merge or refinement relation between q ∗ \mathbf{q}^{\ast} q ∗ and q 0 \mathbf{q}_0 q 0 .
Proposition D.1 (Projection target and overall average effect). The plug-in estimator in (4) converges to
τ ⋆ = ( Q ⋆ ) − 1 E [ q ⋆ ( H i ) δ ( H i ) ] = arg min τ ∈ R K E [ { δ ( H i ) − q ⋆ ( H i ) ⊤ τ } 2 ] . (26) \tau^\star= (Q^\star)^{-1}\mathbb{E}[\mathbf{q}^\star(H_i)\delta(H_i)] = \underset{\tau\in\mathbb{R}^K}{\operatorname{arg\,min}}\ \mathbb{E}\left[\left\{\delta(H_i)-\mathbf{q}^\star(H_i)^\top\tau\right\}^2\right]. \tag*{(26)} τ ⋆ = ( Q ⋆ ) − 1 E [ q ⋆ ( H i ) δ ( H i )] = τ ∈ R K arg min E [ { δ ( H i ) − q ⋆ ( H i ) ⊤ τ } 2 ] . (26) Thus q ⋆ ( H ) ⊤ τ ⋆ \mathbf{q}^\star(H)^\top\tau^\star q ⋆ ( H ) ⊤ τ ⋆ is the least-squares approximation of δ ( H ) \delta(H) δ ( H ) from the fitted posterior coordinates, and
( π ⋆ ) ⊤ τ ⋆ = E [ Y i ( 1 ) − Y i ( 0 ) ] . (27) (\boldsymbol{\pi}^\star)^\top\tau^\star= \mathbb{E}[Y_i(1)-Y_i(0)]. \tag*{(27)} ( π ⋆ ) ⊤ τ ⋆ = E [ Y i ( 1 ) − Y i ( 0 )] . (27) Under Assumption 3.1 , define
Λ = ( Q ⋆ ) − 1 E [ q ⋆ ( H i ) q 0 ( H i ) ⊤ ] ∈ R K × K 0 . \Lambda= (Q^\star)^{-1}\mathbb{E}[\mathbf{q}^\star(H_i)\mathbf{q}_0(H_i)^\top] \in\mathbb{R}^{K \times K_0}. Λ = ( Q ⋆ ) − 1 E [ q ⋆ ( H i ) q 0 ( H i ) ⊤ ] ∈ R K × K 0 . Then τ ⋆ = Λ τ 0 \tau^\star= \Lambda\tau_0 τ ⋆ = Λ τ 0 and Λ 1 K 0 = 1 K \Lambda\mathbf{1}_{K_0}=\mathbf{1}_K Λ 1 K 0 = 1 K . The rows of Λ \Lambda Λ need not be nonnegative.
Proof. By (4) , the assumed L 2 L_2 L 2 convergence, and the randomization identities in (2) , conditional laws of large numbers give
M ^ → p v A Q ⋆ , 1 n ∑ i = 1 n q ^ i A ~ i Y i → p v A E [ q ⋆ ( H i ) δ ( H i ) ] . \widehat{M}\mathrel{\xrightarrow{p}}v_AQ^\star,\qquad\frac{1}{n}\sum_{i=1}^{n}\widehat{\mathbf{q}}_i\widetilde{A}_iY_i\mathrel{\xrightarrow{p}}v_A\mathbb{E}[\mathbf{q}^\star(H_i)\delta(H_i)]. M p v A Q ⋆ , n 1 i = 1 ∑ n q i A i Y i p v A E [ q ⋆ ( H i ) δ ( H i )] .
Since Q ⋆ Q^\star Q ⋆ is nonsingular, the estimator converges to τ ⋆ \tau^\star τ ⋆ in (26) . The least-squares claim follows from the normal equation Q ⋆ τ ⋆ = E [ q ⋆ ( H i ) δ ( H i ) ] Q^\star\tau^\star=\mathbb{E}[\mathbf{q}^\star(H_i)\delta(H_i)] Q ⋆ τ ⋆ = E [ q ⋆ ( H i ) δ ( H i )] .
Posterior coordinates sum to one, so Q ⋆ 1 K = π ⋆ Q^\star\mathbf{1}_K=\boldsymbol{\pi}^\star Q ⋆ 1 K = π ⋆ . Thus
( π ⋆ ) ⊤ τ ⋆ = 1 K ⊤ E [ q ⋆ ( H i ) δ ( H i ) ] = E [ δ ( H i ) ] = E [ Y i ( 1 ) − Y i ( 0 ) ] . (\boldsymbol{\pi}^\star)^\top\tau^\star=\mathbf{1}_K^\top\mathbb{E}[\mathbf{q}^\star(H_i)\delta(H_i)]=\mathbb{E}[\delta(H_i)]=\mathbb{E}[Y_i(1)-Y_i(0)]. ( π ⋆ ) ⊤ τ ⋆ = 1 K ⊤ E [ q ⋆ ( H i ) δ ( H i )] = E [ δ ( H i )] = E [ Y i ( 1 ) − Y i ( 0 )] .
Substituting δ ( H i ) = q 0 ( H i ) ⊤ τ 0 \delta(H_i)=\mathbf{q}_0(H_i)^\top\tau_0 δ ( H i ) = q 0 ( H i ) ⊤ τ 0 from (1) into (26) gives
τ ⋆ = ( Q ⋆ ) − 1 E [ q ⋆ ( H i ) q 0 ( H i ) ⊤ ] τ 0 = Λ τ 0 . \tau^\star=(Q^\star)^{-1}\mathbb{E}[\mathbf{q}^\star(H_i)\mathbf{q}_0(H_i)^\top]\tau_0=\Lambda\tau_0. τ ⋆ = ( Q ⋆ ) − 1 E [ q ⋆ ( H i ) q 0 ( H i ) ⊤ ] τ 0 = Λ τ 0 .
Since q 0 ⊤ 1 K 0 = 1 \mathbf{q}_0^\top\mathbf{1}_{K_0}=1 q 0 ⊤ 1 K 0 = 1 , Λ 1 K 0 = ( Q ⋆ ) − 1 π ⋆ = 1 K \Lambda\mathbf{1}_{K_0}=(Q^\star)^{-1}\boldsymbol{\pi}^\star=\mathbf{1}_K Λ 1 K 0 = ( Q ⋆ ) − 1 π ⋆ = 1 K .
The weighting in (27) uses the mean fitted posterior π ⋆ \boldsymbol{\pi}^\star π ⋆ . The true posterior mean π \boldsymbol{\pi} π is the true-state prevalence vector. Under misspecification, the fitted mean need not represent true-state prevalences and may even have a different dimension. Likewise, Λ \Lambda Λ is a linear coefficient map, not necessarily a matrix of probabilities. Below is an example that gives negative entries of Λ \Lambda Λ .
Example D.2 (Negative coefficient weights). Let h ( H ) ∼ Unif ( 0 , 1 ) h(H)\sim\operatorname{Unif}(0,1) h ( H ) ∼ Unif ( 0 , 1 ) , and consider the valid simplex-valued maps
q ⋆ = ( h , 1 − h ) ⊤ , q 0 = ( h 2 , 2 h ( 1 − h ) , ( 1 − h ) 2 ) ⊤ . \mathbf{q}^\star=(h,1-h)^\top,\qquad\mathbf{q}_0=(h^2,2h(1-h),(1-h)^2)^\top. q ⋆ = ( h , 1 − h ) ⊤ , q 0 = ( h 2 , 2 h ( 1 − h ) , ( 1 − h ) 2 ) ⊤ . Linear combinations of q 1 ⋆ = h q_1^\star=h q 1 ⋆ = h and q 2 ⋆ = 1 − h q_2^\star=1-h q 2 ⋆ = 1 − h are affine in h h h . Regressing the coordinates of q 0 \mathbf{q}_0 q 0 on these fitted posterior coordinates gives
Λ = ( 5 / 6 1 / 3 − 1 / 6 − 1 / 6 1 / 3 5 / 6 ) . \Lambda=\begin{pmatrix}
5/6 & 1/3 & -1/6\\
-1/6 & 1/3 & 5/6
\end{pmatrix}. Λ = ( 5/6 − 1/6 1/3 1/3 − 1/6 5/6 ) . For τ 0 = ( 0 , 0 , 1 ) ⊤ \tau_0=(0,0,1)^\top τ 0 = ( 0 , 0 , 1 ) ⊤ , the fitted coefficients are τ ⋆ = ( − 1 / 6 , 5 / 6 ) ⊤ \tau^\star=(-1/6,5/6)^\top τ ⋆ = ( − 1/6 , 5/6 ) ⊤ : one is negative although all true-state effects are nonnegative. The least-squares reconstruction of q 0 \mathbf{q}_0 q 0 is not itself a posterior: its first coordinate is h − 1 / 6 < 0 h-1/6<0 h − 1/6 < 0 for h < 1 / 6 h<1/6 h < 1/6 .
Oracle-posterior simulation details
Data-generating process and metrics
Let K = 3 K=3 K = 3 , draw Z i ∈ { 1 , 2 , 3 } Z_i \in\{1,2,3\} Z i ∈ { 1 , 2 , 3 } with state probabilities π = ( π 1 , π 2 , π 3 ) T \boldsymbol{\pi}=(\pi_1,\pi_2,\pi_3)^{\mathsf{T}} π = ( π 1 , π 2 , π 3 ) T , and set τ 0 = ( − 1 , 0 , 1 ) T \boldsymbol{\tau}_0=(-1,0,1)^{\mathsf{T}} τ 0 = ( − 1 , 0 , 1 ) T . The pre-treatment history is a single categorical signal H i ∈ { 1 , 2 , 3 } H_i \in\{1,2,3\} H i ∈ { 1 , 2 , 3 } , with state-conditional accuracy ρ = Pr ( H i = Z i ∣ Z i = s ) \rho=\Pr(H_i=Z_i\mid Z_i=s) ρ = Pr ( H i = Z i ∣ Z i = s ) common to every state s s s :
Pr ( H i = h ∣ Z i = s ) = { ρ , h = s , ( 1 − ρ ) / 2 , h ≠ s . \Pr(H_i=h\mid Z_i=s)=
\begin{cases}
\rho, & h=s,\\
(1-\rho)/2, & h\ne s.
\end{cases} Pr ( H i = h ∣ Z i = s ) = { ρ , ( 1 − ρ ) /2 , h = s , h = s .
This signal creates ambiguity about Z i Z_i Z i even though its posterior is known exactly. By iterated expectation, its mean posterior is the state prior: E [ q 0 ( H i ) ] = π \mathbb{E}[\mathbf{q}_0(H_i)]=\boldsymbol{\pi} E [ q 0 ( H i )] = π . No HMM trajectory or HMM parameter is simulated.
Independently across units, draw ϵ i ∼ N ( 0 , 1 ) \epsilon_i\sim\mathcal{N}(0,1) ϵ i ∼ N ( 0 , 1 ) , independently of ( Z i , H i ) (Z_i,H_i) ( Z i , H i ) , and randomize A i ∼ Bernoulli ( e ) A_i\sim\operatorname{Bernoulli}(e) A i ∼ Bernoulli ( e ) independently of these variables, with e = 1 / 2 e=1/2 e = 1/2 . With A ~ i = A i − e \widetilde{A}_i=A_i-e A i = A i − e , the outcome is
Y i = A ~ i τ 0 , Z i + ϵ i . Y_i=\widetilde{A}_i\tau_{0,Z_i}+\epsilon_i. Y i = A i τ 0 , Z i + ϵ i .
Thus Y i ( a ) = ( a − e ) τ 0 , Z i + ϵ i Y_i(a)=(a-e)\tau_{0,Z_i}+\epsilon_i Y i ( a ) = ( a − e ) τ 0 , Z i + ϵ i , E [ Y i ( 1 ) − Y i ( 0 ) ∣ Z i = s , H i ] = τ 0 s \mathbb{E}[Y_i(1)-Y_i(0)\mid Z_i=s,H_i]=\tau_{0s} E [ Y i ( 1 ) − Y i ( 0 ) ∣ Z i = s , H i ] = τ 0 s , and E [ Y i ∣ H i ] = 0 \mathbb{E}[Y_i\mid H_i]=0 E [ Y i ∣ H i ] = 0 . Hard and soft contrasts use the exact q 0 ( H i ) \mathbf{q}_0(H_i) q 0 ( H i ) ; unmixing uses (4) directly. We also report an unattainable true-state oracle: it observes each simulated Z i Z_i Z i and takes the treated-minus-control mean within each state.
For each condition, we use n ∈ { 500 , 2,000 , 10,000 , 50,000 } n\in\{500,2{,}000,10{,}000,50{,}000\} n ∈ { 500 , 2 , 000 , 10 , 000 , 50 , 000 } and R = 1,000 R=1{,}000 R = 1 , 000 independent replications. For method-specific estimate τ ^ r k \widehat{\tau}_{rk} τ r k of τ 0 k \tau_{0k} τ 0 k in replication r r r , the primary metric gives each state equal weight:
RMSE s t a t e = { 1 R K ∑ r = 1 R ∑ k = 1 K ( τ ^ r k − τ 0 k ) 2 } 1 / 2 \operatorname{RMSE}_{\mathrm{state}}=
\left\{\frac{1}{RK}\sum_{r=1}^{R}\sum_{k=1}^{K}\left(\widehat{\tau}_{rk}-\tau_{0k}\right)^2\right\}^{1/2} RMSE state = { R K 1 r = 1 ∑ R k = 1 ∑ K ( τ r k − τ 0 k ) 2 } 1/2
We also examine state-specific bias and RMSE, interval width, coverage of nominal 95% confidence intervals, and the condition number of the population design matrix M 0 M_0 M 0 . Let S E ^ k \widehat{\mathrm{SE}}_k SE k be a method’s estimated account-level standard error for state k k k . Each interval uses the normal approximation τ ^ k ± 1.96 S E ^ k \widehat{\tau}_k\pm1.96\widehat{\mathrm{SE}}_k τ k ± 1.96 SE k . The oracle, hard, and soft methods use the empirical treated- and control-arm variances of their weighted means. Unmixing uses the empirical sandwich variance of its residualized-treatment moment. Coverage is the proportion of state-by-replication intervals containing the true τ 0 k \tau_{0k} τ 0 k . Parenthetical Monte Carlo standard errors (SEs) in the tables quantify uncertainty in these simulation summaries.
Balanced states and posterior overlap
Set π 1 = π 2 = π 3 = 1 / 3 \pi_1=\pi_2=\pi_3=1/3 π 1 = π 2 = π 3 = 1/3 and vary ρ ∈ { 0.40 , 0.60 , 0.80 , 0.95 , 1.00 } \rho\in\{0.40,0.60,0.80,0.95,1.00\} ρ ∈ { 0.40 , 0.60 , 0.80 , 0.95 , 1.00 } . For ρ > 1 / 3 \rho>1/3 ρ > 1/3 , the maximum a posteriori (MAP) state is H i H_i H i , with classification accuracy ρ \rho ρ . Bayes’ rule gives
q 0 k ( h ) = Pr ( Z i = k ∣ H i = h ) = { ρ , k = h , ( 1 − ρ ) / 2 , k ≠ h . q_{0k}(h)=\Pr(Z_i=k\mid H_i=h)=
\begin{cases}
\rho, & k=h,\\
(1-\rho)/2, & k\ne h.
\end{cases} q 0 k ( h ) = Pr ( Z i = k ∣ H i = h ) = { ρ , ( 1 − ρ ) /2 , k = h , k = h .
Let d ρ = ( 3 ρ − 1 ) / 2 d_\rho=(3\rho-1)/2 d ρ = ( 3 ρ − 1 ) /2 . Applying Proposition A.1 coordinatewise yields
τ ^ h a r d → p d ρ τ 0 \widehat{\boldsymbol{\tau}}^{\mathrm{hard}}\xrightarrow{p}d_\rho\boldsymbol{\tau}_0 τ hard p d ρ τ 0
τ ^ s o f t → p d ρ 2 τ 0 \widehat{\boldsymbol{\tau}}^{\mathrm{soft}}\xrightarrow{p}d_\rho^2\boldsymbol{\tau}_0 τ soft p d ρ 2 τ 0
For ρ < 1 \rho< 1 ρ < 1 , both estimators attenuate the nonzero state effects, with greater attenuation under soft weighting. These errors persist as n n n grows.
The population Gram matrix M 0 = v A E [ q 0 ( H i ) q 0 ( H i ) ⊤ ] M_0 = v_A\mathbb{E}[q_0(H_i)q_0(H_i)^\top] M 0 = v A E [ q 0 ( H i ) q 0 ( H i ) ⊤ ] has eigenvalues v A / 3 v_A/3 v A /3 and v A d ρ 2 / 3 v_A d_\rho^2/3 v A d ρ 2 /3 , the latter with multiplicity two. Consequently, the spectral condition number is
cond ( M 0 ) = d ρ − 2 = 4 ( 3 ρ − 1 ) 2 . \operatorname{cond}(M_0) = d_\rho^{-2} = \frac{4}{(3\rho- 1)^2}. cond ( M 0 ) = d ρ − 2 = ( 3 ρ − 1 ) 2 4 .
The inverse amplifies sampling noise as ρ \rho ρ approaches the uninformative boundary 1 / 3 1/3 1/3 . At ρ = 0.40 \rho= 0.40 ρ = 0.40 , this condition number is 100.
At ρ = 0.40 \rho= 0.40 ρ = 0.40 , unmixing RMSE falls from 1.386 to 0.679, 0.309, and 0.139 as n n n increases from 500 to 2,000, 10,000, and 50,000; hard-assignment RMSE remains near 0.74. Thus the variance cost of unmixing is most visible at small n n n .
Table 1 shows coverage of the true state effects at n = 50 , 000 n = 50,000 n = 50 , 000 . Across all simulated sample sizes and signal accuracies, state-specific unmixing coverage ranges from 93.3% to 96.8%, and its equal-state average ranges from 94.2% to 95.9%. For ρ < 1 \rho< 1 ρ < 1 at n = 50 , 000 n = 50,000 n = 50 , 000 , hard and soft intervals cover the true effects only 31–32% of the time, consistent with their bias for the latent-state effects. Even with the fairly accurate signal ρ = 0.95 \rho= 0.95 ρ = 0.95 , hard and soft true-effect coverage falls from 92.6% and 86.8% at n = 500 n = 500 n = 500 to 31.5% and 31.4% at n = 50 , 000 n = 50,000 n = 50 , 000 , as their intervals narrow around the mixture limits.
At ρ = 1 \rho= 1 ρ = 1 , H i = Z i H_i = Z_i H i = Z i and q 0 k ( H i ) = 1 { Z i = k } q_{0k}(H_i) = 1\{Z_i = k\} q 0 k ( H i ) = 1 { Z i = k } . Hard and soft contrasts then use the same true-state groups. Residualized unmixing can differ in a finite sample because it uses the known randomization probability e e e , whereas a difference in means uses the realized arm counts. They are asymptotically equivalent in this design. At n = 50 , 000 n = 50,000 n = 50 , 000 , the three RMSEs in Table 1 and the true-state oracle RMSE in Table 2 all round to 0.015.
Table 2. Equal-state RMSE in the oracle-posterior experiment, based on 1,000 replications per condition. Entries are RMSE (Monte Carlo standard error). The oracle observes the true state; all other methods use the exact Bayes posterior.
Table 2 and Table 3 give the complete grids across sample sizes and signal accuracies, with Monte Carlo standard errors.
Table 3. Coverage of the true latent-state effects by nominal 95% intervals in the oracle-posterior experiment, based on 1,000 replications per condition. Entries are coverage (Monte Carlo standard error), averaged equally across the three states.
State imbalance with oracle posterior
We fix ρ = 0.80 \rho= 0.80 ρ = 0.80 and vary the state prior π \pi π :
π b a l a n c e d = ( 1 / 3 , 1 / 3 , 1 / 3 ) ⊤ , \pi^{\mathrm{balanced}} = (1/3,1/3,1/3)^\top, π balanced = ( 1/3 , 1/3 , 1/3 ) ⊤ ,
π m o d e r a t e = ( 0.50 , 0.30 , 0.20 ) ⊤ , \pi^{\mathrm{moderate}} = (0.50,0.30,0.20)^\top, π moderate = ( 0.50 , 0.30 , 0.20 ) ⊤ ,
π s e v e r e = ( 0.70 , 0.20 , 0.10 ) ⊤ . \pi^{\mathrm{severe}} = (0.70,0.20,0.10)^\top. π severe = ( 0.70 , 0.20 , 0.10 ) ⊤ .
The signal channel, treatment assignment, outcome model, and τ 0 \tau_0 τ 0 remain fixed. For each prior, we recompute the exact posterior by Bayes’ rule:
q 0 k ( h ) = π k Pr ( H i = h ∣ Z i = k ) ∑ ℓ = 1 K π ℓ Pr ( H i = h ∣ Z i = ℓ ) . q_{0k}(h) = \frac{\pi_k \Pr(H_i = h \mid Z_i = k)}{\sum_{\ell=1}^{K} \pi_\ell\Pr(H_i = h \mid Z_i = \ell)}. q 0 k ( h ) = ∑ ℓ = 1 K π ℓ Pr ( H i = h ∣ Z i = ℓ ) π k Pr ( H i = h ∣ Z i = k ) .
For all three priors, the MAP state remains H i H_i H i , so classification accuracy stays at 0.80. The designs therefore change state prevalence and posterior geometry while holding signal accuracy fixed. The marginal treatment effect also changes because π ⊤ τ 0 \pi^\top\tau_0 π ⊤ τ 0 depends on the prior.
Alongside equal-state RMSE, we report prevalence-weighted RMSE:
RMSE π = { 1 R ∑ r = 1 R ∑ k = 1 K π k ( τ ^ r k − τ 0 k ) 2 } 1 / 2 . \operatorname{RMSE}_{\pi} = \left\{\frac{1}{R}\sum_{r=1}^{R}\sum_{k=1}^{K}\pi_k(\hat{\tau}_{rk}-\tau_{0k})^2\right\}^{1/2}. RMSE π = { R 1 r = 1 ∑ R k = 1 ∑ K π k ( τ ^ r k − τ 0 k ) 2 } 1/2 .
The first metric gives each state equal weight; the second gives more weight to states that are more common in the target population.
Table 4 reports results at n = 50,000 n = 50{,}000 n = 50 , 000 . From the balanced to the severe prior, cond ( M 0 ) \operatorname{cond}(M_0) cond ( M 0 ) increases from 2.04 to 18.12, and unmixing’s equal-state RMSE rises from 0.021 to 0.037. Its coverage remains near 95%. Hard and soft RMSE rise more sharply as their mixture targets move away from the state effects. Under severe imbalance, unmixing’s equal-state RMSE decreases from 0.353 to 0.184, 0.079, and 0.037 across the four sample sizes, while average true-effect coverage remains between 94.8% and 95.5%.
Table 4. State imbalance at n = 50,000 n = 50{,}000 n = 50 , 000 and ρ = 0.80 \rho= 0.80 ρ = 0.80 , based on 1,000 replications. The three method columns report equal-state RMSE; coverage is for unmixing’s nominal 95% intervals, averaged across states.
Table 5 reports prevalence-weighted RMSE at every sample size, with Monte Carlo standard errors. Under balance, the equal-state and prevalence-weighted metrics coincide by definition. At n = 50,000 n = 50{,}000 n = 50 , 000 , unmixing’s prevalence-weighted RMSE under severe imbalance is 0.0244, versus 0.037 when states are weighted equally.
Table 5. Prevalence-weighted RMSE in the oracle-posterior state-imbalance experiment at ρ = 0.80 \rho= 0.80 ρ = 0.80 , based on 1,000 replications per condition. Monte Carlo standard errors appear in parentheses. Each state’s squared error receives weight π k \pi_k π k ; the oracle observes the true state.
The rarest state is particularly difficult. Under severe imbalance, its unmixing RMSE is 0.054, with coverage 0.951. Prevalence weighting reduces its contribution because its population share is only 0.10.
Average posterior entropy, measured in nats, falls from 0.639 under balance to 0.486 under severe imbalance, even as cond ( M 0 ) \operatorname{cond}(M_0) cond ( M 0 ) rises. The majority-state prior makes posteriors more concentrated, but observations informative about the rare state become scarcer. Neither entropy nor MAP accuracy alone therefore describes the precision of every state effect.
At n = 50,000 n = 50{,}000 n = 50 , 000 , hard and soft true-effect coverage is 31.8% and 31.9% under balance, but zero for both methods under moderate and severe imbalance. True-state oracle coverage is 94.1–95.1% across the three priors at this sample size. The hard and soft intervals concentrate around mixture effects rather than the target state effects.
Estimated-HMM simulation details
Design and evaluation
This experiment adds HMM estimation error to the posterior ambiguity studied above. We generate T = 21 T = 21 T = 21 days of pre-treatment activity, action, and viewing intensity from a five-state joint HMM with the same layers as the application model. Initial state probabilities are uniform. Each transition row has probability 0.76 of remaining in the same state and 0.06 of moving to each other state. The activity intercepts are θ = ( − 0.8 , − 0.4 , 0 , 0.4 , 0.8 ) T \boldsymbol{\theta} = (-0.8, -0.4, 0, 0.4, 0.8)^{\mathsf{T}} θ = ( − 0.8 , − 0.4 , 0 , 0.4 , 0.8 ) T ; each state has a distinct modal action with probability 0.70; and the ordered intensity coefficients are ( κ s ) s = 1 5 = ( − 2 , − 1 , 0 , 1 , 2 ) (\kappa_s)_{s=1}^{5} = (-2, -1, 0, 1, 2) ( κ s ) s = 1 5 = ( − 2 , − 1 , 0 , 1 , 2 ) .
In each of 200 replications, we fit the correctly specified five-state HMM by three-start EM on nested panels of N ∈ { 300 , 600 , 1,200 , 2,400 } N \in\{300, 600, 1{,}200, 2{,}400\} N ∈ { 300 , 600 , 1 , 200 , 2 , 400 } units. These HMM training units are drawn from the target history distribution and are independent of the randomized target panel. We analyze prefixes of n ∈ { 2,000 , 10,000 , 50,000 } n \in\{2{,}000, 10{,}000, 50{,}000\} n ∈ { 2 , 000 , 10 , 000 , 50 , 000 } units from that panel; each prefix supplies its own correction statistics and effect moments. Another 10,000 target units are held out only for conditional-effect prediction. Methods share HMM fits, treatment assignments, and outcome errors within each replication.
Treatment is randomized with e = 1 / 2 e = 1/2 e = 1/2 , and outcomes follow
Y i = ( A i − 1 / 2 ) τ 0 , Z i T + ε i , ε i ∼ N ( 0 , 1 ) . Y_i = (A_i - 1/2)\tau_{0,Z_{iT}} + \varepsilon_i,\qquad\varepsilon_i \sim\mathcal{N}(0,1). Y i = ( A i − 1/2 ) τ 0 , Z i T + ε i , ε i ∼ N ( 0 , 1 ) .
The history-conditional mean outcome is zero. The primary effect profile is τ 0 = ( − 1.2 , − 0.6 , 0 , 0.6 , 1.2 ) T \tau_0 = (-1.2, -0.6, 0, 0.6, 1.2)^{\mathsf{T}} τ 0 = ( − 1.2 , − 0.6 , 0 , 0.6 , 1.2 ) T , ordered by the true activity intercept. The nonmonotone and constant control profiles are ( 0.6 , − 1.2 , 1.2 , − 0.6 , 0 ) ⊤ (0.6, -1.2, 1.2, -0.6, 0)^\top ( 0.6 , − 1.2 , 1.2 , − 0.6 , 0 ) ⊤ and ( 0.6 , 0.6 , 0.6 , 0.6 , 0.6 ) ⊤ (0.6, 0.6, 0.6, 0.6, 0.6)^\top ( 0.6 , 0.6 , 0.6 , 0.6 , 0.6 ) ⊤ , respectively.
We order fitted states by the rank of their estimated activity intercept θ ^ k \hat{\theta}_k θ ^ k , without consulting treatment outcomes. Holding the unit offset and weekday fixed, a larger intercept implies a higher daily activity probability. We apply this permutation to fitted parameters, posterior columns, scores, and derivatives; true states use the same activity order. An outcome-blind match of true and fitted target posteriors, used only as a diagnostic, agrees with this rule in all 200 replications at the two primary HMM training sizes, 600 and 1,200. Median fitted-posterior MSE on the 50,000 target histories, averaged over units and states, decreases from 0.001902 at N = 300 N = 300 N = 300 to 0.000245 at $N = 2,400.
For method a a a , replication r r r , and HMM training size N N N , define equal-state MSE by
L r , N ( a ) = 1 5 ∑ k = 1 5 ( τ ^ r , N , k ( a ) − τ 0 k ) 2 . L_{r,N}^{(a)} = \frac{1}{5}\sum_{k=1}^{5}\left(\widehat{\tau}_{r,N,k}^{(a)}-\tau_{0k}\right)^2. L r , N ( a ) = 5 1 k = 1 ∑ 5 ( τ r , N , k ( a ) − τ 0 k ) 2 .
The primary contrast at n = 50,000 n = 50{,}000 n = 50 , 000 averages the paired differences over N = 600 N = 600 N = 600 and N = 1,200 N = 1{,}200 N = 1 , 200 :
D r = 1 2 ∑ N ∈ { 600 , 1,200 } { L r , N ( p l a i n ) − L r , N ( O P G ) } . D_r = \frac{1}{2}\sum_{N\in\{600,1{,}200\}}\left\{L_{r,N}^{(\mathrm{plain})}-L_{r,N}^{(\mathrm{OPG})}\right\}. D r = 2 1 N ∈ { 600 , 1 , 200 } ∑ { L r , N ( plain ) − L r , N ( OPG ) } .
Positive D r D_r D r favors correction. Its paired 95% Monte Carlo confidence interval (CI) uses the mean D ˉ = 200 − 1 ∑ r = 1 200 D r \bar{D}=200^{-1}\sum_{r=1}^{200}D_r D ˉ = 20 0 − 1 ∑ r = 1 200 D r , the standard deviation s D s_D s D across replications, and the 97.5th percentile t 0.975 , 199 t_{0.975,199} t 0.975 , 199 of a Student t t t distribution with 199 degrees of freedom: D ˉ ± t 0.975 , 199 s D / 200 \bar{D} \pm t_{0.975,199}s_D/\sqrt{200} D ˉ ± t 0.975 , 199 s D / 200 . This interval measures precision of the mean performance gain, rather than coverage of a state effect. Held-out conditional average treatment effect (CATE) error compares q η ^ ( H ) T τ ^ q_{\hat{\eta}}(H)^{\mathsf{T}}\hat{\tau} q η ^ ( H ) T τ ^ with q 0 ( H ) T τ 0 q_0(H)^{\mathsf{T}}\tau_0 q 0 ( H ) T τ 0 , a target invariant to state labels.
Orthogonal Correction
Plain unmixing uses the fitted terminal posterior in (4) . For correction, the target-law sensitivities G 0 G_0 G 0 , J 0 J_0 J 0 , and B 0 = G 0 J 0 − 1 B_0 = G_0J_0^{-1} B 0 = G 0 J 0 − 1 are defined in (5) . At the true HMM, randomization and the mixture identity give the following expression, where E t a r g e t \mathbb{E}_{\mathrm{target}} E target averages over target histories:
G 0 = − v A E t a r g e t [ q 0 ( H ) { τ 0 T D η q η 0 ( H ) } ] , v A = 1 4 . G_0 = -v_A\mathbb{E}_{\mathrm{target}}\left[q_0(H)\left\{\tau_0^{\mathsf{T}}D_{\eta}q_{\eta_0}(H)\right\}\right], \qquad v_A = \frac{1}{4}. G 0 = − v A E target [ q 0 ( H ) { τ 0 T D η q η 0 ( H ) } ] , v A = 4 1 .
The derivative of the leading posterior factor has conditional mean zero at ( τ 0 , η 0 ) (\tau_0,\eta_0) ( τ 0 , η 0 ) . We use the resulting history-only plug-in estimate on the same target prefix used for effect estimation:
G ^ t a r = − v A E n [ q η ^ ( H ) { ( τ ^ p l ) T D η q η ^ ( H ) } ] . \widehat{G}_{\mathrm{tar}} = -v_A\mathbb{E}_n\left[q_{\hat{\eta}}(H)\left\{(\hat{\tau}^{\mathrm{pl}})^{\mathsf{T}}D_{\eta}q_{\hat{\eta}}(H)\right\}\right]. G tar = − v A E n [ q η ^ ( H ) { ( τ ^ pl ) T D η q η ^ ( H ) } ] .
Posterior derivatives are averaged over exactly the target units whose state effects are estimated. Treating unit offsets and weekday covariates as given, correct conditional HMM specification implies a mean-zero observed-history score s H ( H ; η ) s^H(H;\eta) s H ( H ; η ) , which integrates over latent paths. Differentiating its conditional mean also differentiates the history density. At the true parameter,
J 0 = − E t a r g e t [ s H ( H ; η 0 ) s H ( H ; η 0 ) T ] . J_0 = -\mathbb{E}_{\mathrm{target}}\left[s^H(H;\eta_0)s^H(H;\eta_0)^{\mathsf{T}}\right]. J 0 = − E target [ s H ( H ; η 0 ) s H ( H ; η 0 ) T ] .
The primary outer-product-of-gradients (OPG) approximation [8 ] uses scores from each analyzed target prefix. Let I I I be the identity matrix of the score dimension:
J ^ O P G = − { E n [ s H ( H ; η ^ ) s H ( H ; η ^ ) T ] + 10 − 4 I } , B ^ O P G = G ^ t a r J ^ O P G − 1 . \widehat{J}_{\mathrm{OPG}} = -\left\{\mathbb{E}_n\left[s^H(H;\hat{\eta})s^H(H;\hat{\eta})^{\mathsf{T}}\right] + 10^{-4}I\right\}, \qquad\widehat{B}_{\mathrm{OPG}} = \widehat{G}_{\mathrm{tar}}\widehat{J}_{\mathrm{OPG}}^{-1}. J OPG = − { E n [ s H ( H ; η ^ ) s H ( H ; η ^ ) T ] + 1 0 − 4 I } , B OPG = G tar J OPG − 1 .
The score Gram is positive semidefinite, and the ridge stabilizes inversion without repeated score evaluations at perturbed HMM parameters. We insert B ^ O P G \widehat{B}_{\mathrm{OPG}} B OPG into (7) . A secondary arm uses the same G ^ t a r \widehat{G}_{\mathrm{tar}} G tar and estimates J 0 J_0 J 0 by central differences of the mean score on the same target prefix, symmetrizes it, and uses an outcome-blind ridge to cap the information condition number at 2,000. This arm was prespecified for N = 600 N = 600 N = 600 and N = 1,200 N = 1{,}200 N = 1 , 200 ; its N = 300 N = 300 N = 300 and N = 2,400 N = 2{,}400 N = 2 , 400 results were added after the primary run using the same seeds and panels.
The history-only G ^ t a r \widehat{G}_{\mathrm{tar}} G tar is a plug-in estimate of the same population G 0 G_0 G 0 targeted by the direct sample derivative in (6) . OPG uses the information identity at the correctly specified true HMM. Fitted scores, finite target data, and especially the fixed ridge make B ^ O P G \widehat{B}_{\mathrm{OPG}} B OPG a regularized approximation to B 0 B_0 B 0 . The exact zero-derivative assertion of Theorem 4.1 concerns unregularized B 0 B_0 B 0 ; the fixed-ridge implementation is assessed empirically here. Misspecification can also invalidate the information identity.
A true-posterior oracle uses q 0 ( H i ) q_0(H_i) q 0 ( H i ) with the same target outcomes; it does not observe each unit’s realized latent state. For the oracle, plain unmixing, OPG, and capped-Jacobian methods, we report nominal 95% confidence intervals of the form τ ^ k ± 1.96 S E ^ k \hat{\tau}_k \pm1.96\widehat{\mathrm{SE}}_k τ ^ k ± 1.96 SE k . Standard errors use the empirical sandwich variance of each target-unit moment, including the HMM score term for corrected methods. They treat the fitted HMM and estimated correction coefficient as fixed. Coverage averages the five state effects over 200 replications.
Full-workflow state-effect results
For the well-conditioned five-state design, the tables below give all four estimators at every HMM training size N N N and target size n n n for the three effect profiles. Reported RMSE is the square root of the mean equal-state MSE over 200 replications at each ( N , n ) (N, n) ( N , n ) . Each method cell shows equal-state RMSE (Monte Carlo SE) above empirical coverage (Monte Carlo SE) of nominal 95% state-effect intervals. Coverage averages five states within each of 200 replications. These Monte Carlo SEs describe uncertainty in the simulation summaries; the unit-level standard errors used to construct the intervals treat the fitted HMM and correction coefficient as fixed. The oracle uses the true terminal posterior and the same target outcomes, without observing realized states.
Paired correction gains. Under monotone effects with n = 50,000 n = 50{,}000 n = 50 , 000 , the primary paired contrast averaging N = 600 N = 600 N = 600 and N = 1,200 N = 1{,}200 N = 1 , 200 within replication gives an OPG state-MSE gain of 0.502 × 10 − 3 0.502 \times10^{-3} 0.502 × 1 0 − 3 , with paired 95% Monte Carlo interval [ 0.413 , 0.591 ] × 10 − 3 [0.413, 0.591] \times10^{-3} [ 0.413 , 0.591 ] × 1 0 − 3 . This is a 31.4% reduction in mean state MSE, with lower MSE in 84.0% of replications. The corresponding capped-J J J gain is 0.390 × 10 − 3 0.390 \times10^{-3} 0.390 × 1 0 − 3 , interval [ 0.279 , 0.501 ] × 10 − 3 [0.279, 0.501] \times10^{-3} [ 0.279 , 0.501 ] × 1 0 − 3 , a 24.4% reduction and a 69.0% win rate. Table 6 separates the HMM training sizes; positive gains favor correction.
Table 6: Paired plain-minus-corrected equal-state MSE gain at n = 50,000 n = 50{,}000 n = 50 , 000 under monotone effects, in units of 10 − 3 10^{-3} 1 0 − 3 . Parentheses give Monte Carlo SEs, brackets give paired 95% Monte Carlo intervals, and win rates give the fraction of 200 replications with lower MSE after correction. Capped-J J J results at N = 300 N = 300 N = 300 and N = 2,400 N = 2{,}400 N = 2 , 400 were added after the primary run.
Table 6.
Posterior accuracy and score conditioning. Table 7 uses all 50,000 target histories for the posterior diagnostic and raw OPG condition number. Posterior MSE falls as N N N grows, while raw OPG condition numbers remain near 10 3 10^3 1 0 3 ; the separate numerical-Jacobian condition cap also activates in many fits. All 800 HMM fits and scheduled numerical-Jacobian calculations completed.
Table 7: Fitted-HMM posterior accuracy and correction conditioning by training size N N N . Posterior MSE compares fitted and true terminal posteriors on 50,000 target histories; entries are medians over 200 replications. Outcome-blind matching is a diagnostic and does not choose reported state labels. Condition numbers use the raw target OPG at n = 50,000 n = 50{,}000 n = 50 , 000 . Parentheses are bootstrap Monte Carlo SEs of medians from 2,000 resamples; mismatch and cap entries are counts out of 200 fits.
Table 7.
Complete state-effect and coverage grids. Table 8 –Table 10 report every target prefix for the monotone, nonmonotone, and constant effect profiles, respectively.
Table 8. Monotone effects: equal-state RMSE and coverage of nominal 95% state-effect intervals across all HMM and target sample sizes. Each cell gives RMSE (Monte Carlo SE) above coverage (Monte Carlo SE) over 200 replications.
Table 10. Constant effects: equal-state RMSE and coverage of nominal 95% state-effect intervals across all HMM and target sample sizes. Each cell gives RMSE (Monte Carlo SE) above coverage (Monte Carlo SE) over 200 replications.
Across the monotone grid, OPG gains grow with the target sample size at each fixed N N N , as Figure 1 shows. Posterior error also decreases with HMM training size, consistent with less first-stage error to correct. Under nonmonotone effects, OPG still improves state RMSE at large target sizes, whereas capped J J J can worsen it. Under constant effects, all four methods have similar RMSE.
Prediction, effect profiles, and conditioning
At the two primary HMM training sizes, correction does not improve held-out CATE prediction. At N = 600 N = 600 N = 600 , CATE RMSE is 0.04166 for plain unmixing, 0.04534 for OPG, and 0.04835 for capped J J J ; at N = 1,200 N = 1{,}200 N = 1 , 200 , the corresponding values are 0.03288, 0.03588, and 0.03709. Under nonmonotone effects, the pooled OPG state-MSE gain is 2.493 × 10 − 3 2.493 \times10^{-3} 2.493 × 1 0 − 3 , with paired interval [ 2.195 , 2.792 ] × 10 − 3 [2.195, 2.792] \times10^{-3} [ 2.195 , 2.792 ] × 1 0 − 3 . Under constant effects, its gain is the small negative value − 0.0072 × 10 − 3 -0.0072 \times10^{-3} − 0.0072 × 1 0 − 3 , with interval [ − 0.0119 , − 0.0026 ] × 10 − 3 [-0.0119, -0.0026] \times10^{-3} [ − 0.0119 , − 0.0026 ] × 1 0 − 3 . For capped J J J , the pooled nonmonotone gain is − 1.140 × 10 − 3 -1.140 \times10^{-3} − 1.140 × 1 0 − 3 , with interval [ − 2.266 , − 0.014 ] × 10 − 3 [-2.266, -0.014] \times10^{-3} [ − 2.266 , − 0.014 ] × 1 0 − 3 ; its constant-effect gain is near zero. Thus the capped-Jacobian benefit is not uniform over effect profiles.
Weak score directions can amplify error through B 0 = G 0 J 0 − 1 B_0 = G_0J_0^{-1} B 0 = G 0 J 0 − 1 . At 50,000 target units, median condition numbers of the raw OPG score Gram are 1,031 and 936 for N = 600 N = 600 N = 600 and N = 1,200 N = 1{,}200 N = 1 , 200 ; the numerical-Jacobian condition cap activates in 173 and 75 of 200 fits, respectively. The smallest eigenvalue and condition number of the unregularized target score information, together with the ridge used for inversion, are useful diagnostics. The reported gains concern regularized correction and do not evaluate a rule for withholding it when score information is weak.
Table 9. Nonmonotone effects: equal-state RMSE and coverage of nominal 95% state-effect intervals across all HMM and target sample sizes. Each cell gives RMSE (Monte Carlo SE) above coverage (Monte Carlo SE) over 200 replications.
The HMM family and state count are correctly specified, treatment is randomized with known propensity, and the history-conditional mean outcome is zero by design. Exploratory pilots informed the data-generating process. The same target units estimate the correction and solve the effect moment; reported unit-level standard errors hold the fitted HMM and correction coefficient fixed. These intervals have no general unconditional 95% coverage guarantee. The experiments do not address HMM misspecification, observational treatment, or alternative regularization rules.
Additional case-study figures
Figure 5. Selection of the HMM state count using out-of-time held-out log-likelihood per observed day. Candidate joint action–intensity HMMs use the same 120,000 fitting units and 60,000 held-out units across state counts. Models are fitted on days 0–419 and evaluated on days 420–559. The right panel shows the gain from adding one state, which drops sharply after K = 5 K = 5 K = 5 . Joint-intensity model only. Same RNG(0) account split for every K K K : 120k fit accounts, 60k held-out accounts; fit on days 0–419 and scored out-of-time on days 420–559. Higher log-likelihood is better.
Figure 6. Stability of behavioral-state posteriors across HMM fits with K = 4 , 5 , 6 K = 4, 5, 6 K = 4 , 5 , 6 . The fits use 100,000 training accounts and are compared on the same 100,000 held-out accounts. Node percentages are mean posterior state probabilities on the held-out accounts; each band’s width is proportional to the mean product of its endpoint posterior probabilities for adjacent state counts. States are ordered by activity. Bands compare fitted models and do not represent transitions over time.