pdf(uniform(a,b),x) returns half the correct density at both endpoints, so pdf(uniform(0,1),0) is 0.5 instead of 1
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, machine-learning
Research direction
Start by locating the Rust implementation of pdf(uniform(a,b), x) and its tests; the issue does not name specific files. Check how the support interval handles its endpoints, then add or update tests for both endpoints and an interior value across intervals of different widths. Done when endpoint densities equal 1/(b-a), matching the stated dunif results.
Written by the indexing model from the issue text.
Description
pdf(uniform(a,b), x) returns half the correct density at both endpoints x = a and x = b. The interior is right, so the density is not constant on its own support.
library(rssn)
compute(parse_term("pdf(uniform(0,1), 0.5)"))$value # 1 (correct)
compute(parse_term("pdf(uniform(0,1), 0)"))$value # 0.5 (wrong)
compute(parse_term("pdf(uniform(0,1), 1)"))$value # 0.5 (wrong)
compute(parse_term("pdf(uniform(0,2), 0)"))$value # 0.25 (wrong)
R gives dunif(0,0,1) = 1, dunif(1,0,1) = 1 and dunif(0,0,2) = 0.5. The uniform density is 1/(b-a) on the closed interval [a,b], so it must be 1 at both ends of [0,1] and 0.5 at both ends of [0,2].
The mechanism is a x > a && x < b style strict-interval test that falls through to a different branch exactly at the boundary; the returned value is exactly 1/(2(b-a)), i.e. the density is halved at x == a and x == b only.
Expected: pdf(uniform(a,b), a) = pdf(uniform(a,b), b) = 1/(b-a), matching dunif.
rssn 0.3.0, R 4.6.2 binding, Windows x86_64.
- Dominant language
- Rust
- Stars
- 36
- Forks
- 3
- Avg merge
- 14h 51m
- Merged PRs (30d)
- 29
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Apich-Organization/rssn
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothOpenarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#383 ·
Maintainers usually reply within 1 day
-
area/numerical good first issue help wanted kind/doc-mismatch severity/5-trivial
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Apich-Organization/rssn#373 ·
Maintainers usually reply within 1 day
-
area/numerical good first issue help wanted kind/doc-mismatch severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#371 ·
Maintainers usually reply within 1 day
-
json_encode() re-emits a decoded empty JSON object as [], so {} and {"":1} are not round-trip stableOpenarea/api-bindings good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#361 ·
Maintainers usually reply within 1 day
-
area/statistics good first issue help wanted kind/wrong-result severity/3-major
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Apich-Organization/rssn#358 ·
Maintainers usually reply within 1 day
All issues in Apich-Organization/rssn
Similar issues
-
Update Wasmtime to 48.0.11 for RUSTSEC-2026-0648Possibly taken @flyingrobots claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flyingrobots/edict#457 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
approved
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
fritzprix/libr-agent#3266 ·
Maintainers usually reply within 1 day
-
Frame::second_to_frame truncates f32 product, causing periodic off-by-one framesPossibly taken @ShamanicArts claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dmtrKovalenko/fframes#296 ·
Maintainers usually reply within 1 day