-
Notifications
You must be signed in to change notification settings - Fork 6
Add bivariate copula implementation #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
simon-hirsch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I miss the base class for the copulas, because now all distributions need to implement the param_link parameter. This should be solved by a CopulaMixin class that implements the necessary methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for bivariate copulas by introducing new link functions and multivariate copula distributions, and integrates them into the online multivariate distribution regression estimator.
- Introduce
FisherZLinkandTauToParincopulalinks.py - Extend base
Distributionto acceptparam_linksand update existing distributions - Add
BiCopNormalandMarginalCopulaclasses for Gaussian copula modeling - Integrate copula-based parameter handling into
online_mvdistreg
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ondil/link/copulalinks.py | New Fisher Z and Kendall‐tau link functions |
| src/ondil/link/init.py | Export copula link functions |
| src/ondil/base/distribution.py | Add support for param_links in base Distribution |
| src/ondil/distributions/normal.py | Update constructor signature for param_links |
| src/ondil/distributions/mv_t_low_rank.py | Pass param_links through to superclass |
| src/ondil/distributions/mv_normal_chol.py | Pass param_links through to superclass |
| src/ondil/distributions/mv_marg_cop.py | New MarginalCopula distribution |
| src/ondil/distributions/bicop_normal.py | New BiCopNormal Gaussian copula distribution |
| src/ondil/distributions/init.py | Register new copula distributions |
| src/ondil/estimators/online_mvdistreg.py | Integrate copula option and branching logic into fitting routine |
Comments suppressed due to low confidence (3)
src/ondil/distributions/normal.py:47
- The
param_linksparameter should be typed asdict[int, LinkFunction]instead ofLinkFunction, and default to an empty dict. Update the annotation toparam_links: dict[int, LinkFunction] = {}.
param_links: LinkFunction = {},
src/ondil/distributions/bicop_normal.py:33
- The constructor uses a singular
param_linkbut the base class expectsparam_links: dict[int, LinkFunction]. Consider renaming toparam_linksand accepting a mapping keyed by parameter index.
param_link: LinkFunction = TauToPar(),
src/ondil/estimators/online_mvdistreg.py:690
- The code previously scaled X and stored it in X_scaled but now passes the raw X to
_outer_fit, bypassing the scaling step. It should likely beX_scaledhere.
self._outer_fit(X=X, y=y, theta=theta)
cc8a021 to
48f3249
Compare
63c30eb to
f5a3724
Compare
|
@chrischu12 I have changed the base branch as we #134 is merged now. |
c403d59 to
ac94ff5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 12 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
What's the status on the tests in this PR? A lot of them fail. And what about the numerous comments from @simon-hirsch above? |
…in distribution.py
…into bivariate_copula
|
Now the |
No description provided.