Skip to content

Conversation

@NathanielF
Copy link
Contributor

@NathanielF NathanielF commented Nov 19, 2025

Just a draft for the minute. Working through some ideas.


📚 Documentation preview 📚: https://causalpy--568.org.readthedocs.build/en/568/

Comment on lines 54 to 57
:param vs_prior_type : str or None, default=None
Type of variable selection prior: 'spike_and_slab', 'horseshoe', or None.
If None, uses standard normal priors.
:param vs_hyperparams : dict, optional
Copy link
Contributor

Choose a reason for hiding this comment

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

This is sphinx format and not numpy

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should add that into AGENTS.md if it's not already there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is sphinx format and not numpy

You got me. The doc strings were AI generated. Will fix.

Provides continuous shrinkage with heavy tails, allowing strong signals
to escape shrinkage while weak signals are dampened:
β_j = τ · λ̃_j · β_j^raw
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should be able to add maths in here for nice rendering in the API docs

Signed-off-by: Nathaniel <[email protected]>
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 97.90210% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.27%. Comparing base (1fc193b) to head (13b320e).

Files with missing lines Patch % Lines
causalpy/variable_selection_priors.py 95.08% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #568      +/-   ##
==========================================
+ Coverage   91.95%   92.27%   +0.31%     
==========================================
  Files          33       35       +2     
  Lines        4776     5050     +274     
==========================================
+ Hits         4392     4660     +268     
- Misses        384      390       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
@NathanielF NathanielF marked this pull request as ready for review November 22, 2025 08:22
@NathanielF
Copy link
Contributor Author

Marking this one as ready for review. There is still some work to be done on the notebook illustrating the functionality. But i think there is enough here that's it worth flagging the architecture choices for discussion. I've made the variable selection priors available as a module. Currently, just integrated with the IV class, but in principle can be dropped into all regression based modules with coefficients. The pattern simply requires an if-else block to be used in e.g. the propensity score model, linear regression model etc....

What do you guys think?

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.

3 participants