You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See `examples/compare_als_vs_em.py` for a complete ALS versus EM comparison.
44
+
See `examples/compare_als_vs_em.py` for a complete ALS versus EM comparison. The
45
+
`benchmarks/compare_sur.py` script contrasts ALS-GLS with `statsmodels` and
46
+
`linearmodels` SUR implementations on matched simulation grids while recording
47
+
peak memory (via Memray, Fil, or the POSIX RSS high-water mark).
37
48
38
49
### Documentation and notebooks
39
50
@@ -63,3 +74,24 @@ To show the magnitude, we ran a Monte‑Carlo experiment with N = 300 observat
63
74
64
75
Statistically, the two estimators are indistinguishable (paired‑test p ≥ 0.14). Computationally, ALS needs only a few megabytes whereas EM needs tens to hundreds.
65
76
77
+
### Defaults, tuning knobs, and failure modes
78
+
79
+
-**Rank (`k`)** – By default the high-level APIs pick `min(8, ceil(K / 10))`, a
80
+
conservative fraction of the number of equations. Increase `rank` if the
81
+
cross-equation correlation matrix is slow to decay; decrease it when the
82
+
diagonal dominates.
83
+
-**ALS ridge terms (`lam_F`, `lam_B`)** – Defaults to `1e-3` for both the
84
+
latent-factor and regression updates; raise them slightly (e.g. `1e-2`) if CG
85
+
struggles to converge or the NLL trace plateaus early.
86
+
-**Noise floor (`d_floor`)** – Keeps the diagonal component positive; the
87
+
default `1e-8` protects against breakdowns when an equation is nearly
88
+
deterministic. Increase it in highly ill-conditioned settings.
89
+
-**Stopping criteria** – ALS stops when the relative drop in NLL per sweep is
90
+
below `1e-6` (configurable via `rel_tol`) or after `max_sweeps`. Inspect
91
+
`info["nll_trace"]` to diagnose stagnation.
92
+
-**Possible failures** – Large condition numbers or nearly-collinear regressors
93
+
can make the β-step CG solve slow; adjust `cg_tol`/`cg_maxit`, add stronger
94
+
ridge, or re-scale predictors. If `info["accept_t"]` stays at zero and the
95
+
NLL does not improve, the factor rank may be too large relative to the sample
0 commit comments