-
Notifications
You must be signed in to change notification settings - Fork 14
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
Added BCA confidence intervals #552
Added BCA confidence intervals #552
Conversation
WalkthroughThe recent updates to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant FitFunction
participant Bootstrap
participant ConfidenceInterval
User->>FitFunction: Call fit()
FitFunction->>Bootstrap: Generate bootstrap samples using n_p_b
Bootstrap-->>FitFunction: Return resampled data
FitFunction->>ConfidenceInterval: Calculate confidence intervals
ConfidenceInterval-->>FitFunction: Return confidence intervals
FitFunction-->>User: Return results
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- python/python/bystro/parent_of_origin/parent_of_origin.py (3 hunks)
Additional comments not posted (7)
python/python/bystro/parent_of_origin/parent_of_origin.py (7)
331-332
: Introduce a new variable for readabilityThe introduction of
n_p_b
forself.n_permutations_bootstrap
improves readability.
334-335
: Initialize confidence interval storageThe initialization of
ci_eigenvector
for storing confidence intervals is necessary for the subsequent calculations.
335-339
: Initialize bootstrap samples storageThe initialization of
bootstrap_samples_
for storing bootstrap samples is necessary for the resampling process.
340-347
: Resampling logic usingX_het_whitened
The resampling logic has been updated to use
X_het_whitened
, which likely improves the statistical properties of the samples generated.
366-368
: Define alpha values for confidence intervalsThe definition of
alpha
,alpha1
, andalpha2
is necessary for the computation of the confidence intervals.
369-415
: Compute BCA confidence intervalsThe computation of BCA confidence intervals is a significant enhancement that adds robustness to the confidence interval estimation.
417-417
: Store computed confidence intervalsThe computed confidence intervals are stored in
self.confidence_interval_
, replacing the previous method of storing bootstrap samples and quantiles.
jackknife_mean_vector_component = ( | ||
j_values_vector_component.mean() | ||
) | ||
a_vector_component = np.sum( |
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.
Could you explain the constants here (** 3, 6.0 * np.sum, **1.5, etc) or reference the equation?
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.
Referenced the equation, it requires a whole chapter to explain basically.
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.
LGTM
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- python/python/bystro/parent_of_origin/parent_of_origin.py (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- python/python/bystro/parent_of_origin/parent_of_origin.py
This uses the BCA algorithm from the bootstrap to compute confidence intervals on the POE estimates.
Summary by CodeRabbit