Skip to content

Remove unused n parameter from von_mises_known_concentration#272

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-unused-n-parameter
Draft

Remove unused n parameter from von_mises_known_concentration#272
Copilot wants to merge 2 commits intomainfrom
copilot/fix-unused-n-parameter

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 1, 2025

The von_mises_known_concentration function included an unused n parameter in its signature. For Von Mises distributions with known concentration, the sufficient statistics are cos_total and sin_total alone—sample size is mathematically unnecessary.

Changes

  • conjugate/models.py: Removed n: NUMERIC parameter from function signature and docstring
  • tests/test_models.py: Added test coverage for the function

Example

from conjugate.distributions import VonMisesKnownConcentration
from conjugate.models import von_mises_known_concentration

prior = VonMisesKnownConcentration(a=1.0, b=0.0)

# Before: required unused n parameter
# posterior = von_mises_known_concentration(
#     cos_total=cos_total, sin_total=sin_total, n=10, kappa=2.0, prior=prior
# )

# After: n parameter removed
posterior = von_mises_known_concentration(
    cos_total=cos_total, sin_total=sin_total, kappa=2.0, prior=prior
)

Note

Line 1725 computes a_post = kappa * sin_total_post, which appears mathematically incorrect—should likely use resultant length sqrt(cos_total_post^2 + sin_total_post^2). This is a separate issue requiring paper verification.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • web.archive.org
    • Triggering command: curl -L REDACTED -o paper.pdf (dns block)
  • www.people.cornell.edu
    • Triggering command: wget --timeout=10 REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>von_mises_known_concentration has unused n parameter</issue_title>
<issue_description>Need to check the validity here</issue_description>

<agent_instructions>Please confirm with the paper referenced that n is not required. and make adjustments to the function signature depending upon it being correct or now</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: williambdean <57733339+williambdean@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unused n parameter in von_mises_known_concentration Remove unused n parameter from von_mises_known_concentration Nov 1, 2025
Copilot AI requested a review from williambdean November 1, 2025 23:57
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.37%. Comparing base (45a453a) to head (1209a6f).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #272      +/-   ##
==========================================
+ Coverage   95.00%   95.37%   +0.36%     
==========================================
  Files           9        9              
  Lines        1082     1082              
==========================================
+ Hits         1028     1032       +4     
+ Misses         54       50       -4     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

models Has to do with the models no releasenotes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

von_mises_known_concentration has unused n parameter

2 participants