4

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)
Rob Donnelly
  • 2,256
  • 2
  • 20
  • 29

1 Answers1

5

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)
Simon Byrne
  • 7,694
  • 1
  • 26
  • 50