Skip to content

native nchisq pdfs and cdfs#202

Open
oscardssmith wants to merge 1 commit intoJuliaStats:masterfrom
oscardssmith:os/native-nchisq-pdfs-and-cdfs
Open

native nchisq pdfs and cdfs#202
oscardssmith wants to merge 1 commit intoJuliaStats:masterfrom
oscardssmith:os/native-nchisq-pdfs-and-cdfs

Conversation

@oscardssmith
Copy link
Copy Markdown
Contributor

The pdfs fail tests because (similar to #201) Rmath is 3 orders less accurate than the julia implimentation. (wa here is the result from WolframAlpha).

julia> nchisqpdf(2, 1, 2.2)
0.1645869441310454

julia> RFunctions.nchisqpdf(2,1,2.2)
0.16458694413104188

julia> wa = big"0.1645869441310454112135197604197820880570914582411154316531704994027932337689933940943235034252384319"
0.1645869441310454112135197604197820880570914582411154316531704994027932337689929

julia> wa-RFunctions.nchisqpdf(2,1,2.2)
3.526626556340740986470983317120472560744153170499402793233768992861176677408581e-15

julia> wa-nchisqpdf(2,1,2.2)
1.668453155868970625952770932118068556653170499402793233768992861176677408581158e-18

@oscardssmith oscardssmith force-pushed the os/native-nchisq-pdfs-and-cdfs branch from 75e94da to a18a9e1 Compare February 11, 2026 21:49
@tpapp
Copy link
Copy Markdown
Contributor

tpapp commented Feb 12, 2026

Like #201, I would recommend testing against a table.

@quildtide
Copy link
Copy Markdown

Well, wouldn't you look at the timing:
JuliaStats/Distributions.jl#2035

The Rmath code seems to be causing downstream issues for the Rician distribution in Distributions.jl.

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