Reputation: 2326
In Julia has anyone implemented the normal distributions pdf or cdf to support arbitrary precision BigFloats.
For example this code returns 0.0, when in fact the values should be slightly different.
x = parse(BigFloat, "2.1")
x_small = float64(x)
pdf(Normal(), x) - pdf(Normal(), x_small)
Upvotes: 4
Views: 424
Reputation: 7864
Not directly. My eventual plan is to make Distribution types parametric, which would also allow for Float32
arguments, but that is a while away yet.
In the meantime, there is the non-exported φ
which gives the result you wanted:
Distributions.φ(x) - pdf(Normal(), x_small)
Upvotes: 5