Cleanup FIML, enhance em_mvn()#303
Cleanup FIML, enhance em_mvn()#303Maximilian-Stefan-Ernst merged 12 commits intoStructuralEquationModels:develfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #303 +/- ##
==========================================
- Coverage 71.83% 71.45% -0.39%
==========================================
Files 51 51
Lines 2223 2288 +65
==========================================
+ Hits 1597 1635 +38
- Misses 626 653 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Looks nice, also the imporvements to the EM algorithm. I made some small comments, apart from that, I'm happy to merge. |
31593be to
a4f5d7a
Compare
|
@Maximilian-Stefan-Ernst thank you for the review! I've addressed your comments in the recent commits (If you approve the PR, I will cleanup the history before the merge). |
7386699 to
17ce0bb
Compare
|
Thank you, I would be happy to merge now - do you want to clean anything up still, or should I go ahead? |
* refactor FIML code to consolidate pattern methods under SemFIMLPattern * rename semfiml/lossfun to loss for consistency
so EM MVN could be done when SemObsMissing is constructed
- report rel_error if not converged - add max_nsamples_em opttion to limit number of samples used
to make tests pass
it's ok to return vector
17ce0bb to
4989950
Compare
|
@Maximilian-Stefan-Ernst I've just rebased it to the devel branch and cleaned up the commit history. It should be ready to merge. Thank you! |
9b05e61
into
StructuralEquationModels:devel
This is hopefully one of the 2 big remaining refactorings from #193:
SemFIMLPattern-- it handles FIML calculation for a specific missing pattern.Previously, we introduced
SemObservedMissingPatternto collect observed samples with a specific missing pattern; this PR applies a similar change for FIML.em_mvn(): decouple fromSemObservedMissing. Previously one could only useem_mvn()fromSemObservedMissingafter it's already created.Now it could be used outside, and there is no
EmMVNModelstruct.obs_cov and obs_mean for
SemObservedMissingare still lazily calculated, but now it follows the common SemObserved API, so there is lessneed for overloading methods to handle
SemObservedMissingem_mvn()was optimized:em_mvn()some options to help with large matrices:max_nsamples_emlimits how many samples from each missing pattern is used -- to handle data with thousands of samplesmin_eigvalto enforce pos-def of the resulting matrixem_mvn()for monitoring the convergence of large matrices (thousands of samples, >1000 observed vars)