Skip to main content
. 2026 Feb 18;26(4):1321. doi: 10.3390/s26041321
Algorithm 1 Penalized EM Algorithm for the Robust Absorbing-State HMM.
Require: Observed trajectories {yit}t=1Ti for i=1,,N; number of states K (state K absorbing); ridge penalties {λk}k=1K1.
  •   1:

    Initialize parameters Θ(0)={P(0),(η0,1(0),η1,1(0),σ12(0)),,(η0,K(0),η1,K(0),σK2(0))} (e.g., simple-failure P(0) and a global linear regression for emissions).

  •   2:

    repeat

  •   3:

          E-step (forward–backward).

  •   4:

          Run the scaled forward–backward recursion to obtain γit(k) for t=1,,Ti and ξit(k,) for t=1,,Ti1 (see (6)–(11)).

  •   5:

          M-step: transition matrix.

  •   6:
          Update
    p^k=i=1Nt=1Ti1ξit(k,)i=1Nt=1Ti1γit(k),k,=1,,K.
  •   7:

          M-step: emission parameters (ridge-regularized).

  •   8:

          Select λk by weighted K-fold cross-validation under the current weights γit(k).

  •   9:

          for each transient state k=1,,K1 do

  • 10:
                Update (η0,k,η1,k) by slope-only ridge regression:
    (η0,k,η1,k)=argminη0,η1i=1Nt=1Tiγit(k)yitη0η1t2+12λkη12.
  • 11:

                Update σk2 using a Huber-type robust scale estimator based on the weighted residuals.

  • 12:

          end for

  • 13:

    until convergence of the log-likelihood and parameter updates.