Open
Conversation
Engelsgeduld
requested changes
May 25, 2025
Collaborator
Engelsgeduld
left a comment
There was a problem hiding this comment.
Also tests for cdf, pdf, logpdf, and Mellin g estimation should be rewritten with new integrators
|
|
||
| """Base class for integral calculation""" | ||
|
|
||
| def compute_integral(self, func: Callable, params: dict) -> IntegrationResult: |
Collaborator
There was a problem hiding this comment.
params should be in class constructor and rename to compute
| Returns: moment approximation and error tolerance | ||
| """ | ||
|
|
||
| full_output_requested = params.pop('full_output', False) |
Collaborator
There was a problem hiding this comment.
By default, it called "verbose" parameter
|
|
||
|
|
||
| class RQMCIntegrator: | ||
|
|
Collaborator
There was a problem hiding this comment.
Duplicate RQMC docs here
src/mixtures/nm_mixture.py
Outdated
| return data_class | ||
|
|
||
| def _classical_moment(self, n: int, params: dict) -> tuple[float, float]: | ||
| def _classical_moment(self, n: int, params: dict, integrator: Integrator = None) -> tuple[float, float]: |
Collaborator
There was a problem hiding this comment.
Its should better to be
def _classical_moment(self, n: int, integrator: Integrator = DefaultIntegrator(default params))
src/mixtures/nm_mixture.py
Outdated
| """ | ||
| mixture_moment = 0 | ||
| error_tolerance = 0 | ||
| integrator = integrator or QuadIntegrator() |
Collaborator
There was a problem hiding this comment.
With previous remark this line is useless
src/mixtures/nm_mixture.py
Outdated
Comment on lines
+140
to
+141
| rqmc = integrator.compute_integral(func=lambda u: norm.cdf((x - self.params.distribution.ppf(u)) / np.abs(self.params.sigma)), **params) | ||
| return rqmc.value, rqmc.error |
Collaborator
There was a problem hiding this comment.
better to call it result, or integration_result
19a9ca1 to
93da7ae
Compare
93da7ae to
51a7303
Compare
plidan123
added a commit
that referenced
this pull request
Jun 25, 2025
feat: dynamic integrator selection
Merged
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.
Implement dynamic integrator selection and enabling the use of custom integrators