Bug in Expectations.jl?

Hey everyone,

I wanted to use Expectations.jl and I think this constitutes an error?

using Distributions, Expectations
E    = expectation(Normal(1, 1))
E(x -> x)

with the result being

julia> E(x -> x)
5.778544334733716e-17

where it clearly should be 1. Am I missing something obvious or should I file an issue?

Hmm… Try it again? I didn’t just try it right now but I did something similar a few days ago and did not have this problem.

If you still get the problem then I’d suggest filing an issue.

I get the same thing. Please file an issue with the package author in github. Or dig in and make a PR :wink:

https://github.com/econtoolkit/Expectations.jl/issues/23

Filed an issue :slight_smile:

1 Like

One of the package maintainers here. Just an update that after the issue was filed, I caught the bug (broadcasting error in the normal quadrature routine, which also impacted LogNormal) and added some tests with different parameters. The current master should be kosher, and we also tagged a new release 1.0.2.

Thanks for catching this and reporting. I’ll try to stay on top of the Discourse, but I’m more plugged into issues on the repo or emails (arnav.sood@ubc.ca).

2 Likes