Rob Donnelly
Rob Donnelly

Reputation: 2326

Julia: BigFloat Normal distribution

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

Answers (1)

Simon Byrne
Simon Byrne

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

Related Questions