Skip to content

Conversation

plidan123
Copy link
Collaborator

This branch consolidates four upstream pull requests into a single topic branch to simplify rebasing onto main:

By combining all changes here first, you can perform one clean rebase against main instead of rebasing each PR independently.

plidan123 and others added 28 commits May 28, 2025 21:34
This commit unifies the sample generators for all mixture types (NMM, NMV, NV)
by integrating canonical form support directly into the main generator function.
Previously, each mixture type had separate classical and canonical generators.

Now, the generator checks mixture_form inside the function and switches behavior
accordingly. In canonical form, the beta parameter is not used. This simplifies
the generator API and reduces code duplication.

- Updated nm_generator.py, nmv_generator.py, nv_generator.py
- Remembered `mixture_form` in AbstractMixture class
- Updated tests and notebook to use the new unified API

BREAKING CHANGE: canonical_generate() methods were removed; use generate() instead.
* added base StatisticalProcedure protocol
* replaced NDArray[np.float64] with np.ndarray
* Rename NVSemiParametricGEstimationPostWidder → NVEstimationDensityPW
* Rename SemiParametricGEstimationPostWidder → NMVEstimationDensityPW
* Rename folders in src/procedures
* Rename tests/algorithms → tests/procedures

lgorithms/semiparametric_sigma_estimation/__init__.py -> tests/procedures/nm_procedures/semiparametric_sigma_estimation/__init__.py
In the previous commit "NVSemiParametricGEstimationPostWidder" were mistakenly replaced by "NMVEstimationDensityPW"
- Updated `moment`, `pdf`, `cdf`, and `logpdf` methods to support both scalar and list inputs for efficient batch computation.
- Extracted shared evaluation logic (e.g., `moment`, `pdf`, `cdf`, `logpdf`) into the `AbstractMixtures` base class to eliminate code duplication across subclasses.
- Centralized input validation, RQMC integration, and distribution handling within the base class for better maintainability.
- Fixed type annotations to align with abstract method signatures and resolve `mypy` type-checking issues.

These changes improve code clarity, enable vectorized evaluations, and make future extensions easier to implement.
feat: dynamic integrator selection
feat: unify mixture generators and support canonical forms
feat: add batch support and refactor mixture evaluation logic
…ures

Api/renaming of statistical procedures
@plidan123 plidan123 requested a review from Desiment June 26, 2025 01:11
@Desiment Desiment requested a review from andreev-sergej June 26, 2025 10:51
Copy link
Collaborator

@Desiment Desiment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflict between #46 and #40 should be resolved in another manner

Current approach with passing integrator to mixture class breaks two things:
1.log_pdf should be computed using LogRQMC, but now it computed via default integrator and it is giving incorrect results now I guess
2. Moments of NMV mixtures should be computed bu default via quad

Checkout @Amellgo PR #40 too see better implementation

@Desiment Desiment changed the title update_main Global refactoring Jun 27, 2025
Copy link
Collaborator

@Engelsgeduld Engelsgeduld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Desiment Desiment self-requested a review June 27, 2025 20:13
@Desiment Desiment merged commit c2652d0 into main Jun 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants