Code enhancement#162
Merged
Merged
Conversation
Ajoute un optimiseur Newton diagonal coordonné (sans NLopt) pour les modèles PLN standard et ZIPLN, activable via PLN_param(config_optim = list(algorithm = "NEWTON")) ZIPLN_param(config_optim = list(algorithm = "NEWTON")) PLN (`nlopt_optimize_newton`, `nlopt_optimize_vestep_newton`) : - Newton diagonal pour B et M avec backtracking Armijo - Fixed-point exact pour logS : logS* = -0.5 log(Omega_jj + A_ij) - Guard overflow élément par élément : logS <= 0.5 log(max(1, 700-Z)) - Gains sur oaks : +38 loglik, 36% plus rapide que CCSAQ ZIPLN (`optim_zipln_M_S_newton`) : - Même approche, hessien diagonal ajusté pour le masque ZI - Défaut : CCSAQ conservé (Newton donne de mauvais optima locaux sur données très sparse) - Guard de covariance "covar" : substitue CCSAQ avant d'appeler NLopt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…log(S²) is used for optim)
…iational variance -> optimize log(S²)
This was referenced Jun 18, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Various enhancements in code and doc:
New built-in Newton optimizer (
backend = "builtin") for PLN, ZIPLN and PLNPCA,now the default for PLN and ZIPLN. Uses the alternate parametrization of PLN (variational means embeded the covariate effects). Uses envelope-theorem Newton steps with strong Wolfe line search; does not depend on NLOPT. Substantially faster and more accurate than nlopt on large datasets with full covariance (e.g. +30 000 loglik on microcosm, p=259). CCASQ/nlopt remains competitive for PLNPCA
Fix critical convergence bug in PLN/PLNPCA with nlopt: premature termination due to ill-conditioned X scaling triggered the XTOL stopping criterion after very few iterations (e.g. 14 iter on barents, loglik -8520 instead of -4400). The built-in backend is immune to this bug; nlopt is also fixed via better parameter scaling.
ZIPLN joint VE step (
backend = "builtin"): variational parameters (M, ψ, R) are now optimised jointly in a single Newton step per EM iteration, instead of sequentially. Gains up to +666 loglik on oaks compared to the nlopt sequential approach.PLNPCA warm-start and shared SVD init: the collection of PLNPCA models now shares a single SVD initialisation computed once from a fast LM (
init_method = "LM", default). A pre-fitted PLNfit can be supplied viainception = PLN(...)to improve convergence for large ranks (e.g. rank >sqrt(p)); see?PLNPCA_paramfor details.torch backend marked experimental: the torch backend is now clearly documented as experimental. It emits a message on use and is not recommended for PLNPCA (systematically lower loglik than nlopt/builtin). It remains available for PLN on diagonal/spherical covariance where it can be faster.
Other changes