hakaru-CS4ZP6 / hakaru

A probabilistic programming language
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Floor function #17

Closed sohraa3 closed 6 years ago

sohraa3 commented 6 years ago

The transformation from standard uniform to benford requires a floor function. But I could not find any function in hakaru that would do that.

http://www.math.wm.edu/~leemis/chart/UDR/UDR.html

@JacquesCarette

JacquesCarette commented 6 years ago

If you add me to the project, then you could assign this issue to me. I've asked the team about this.

JacquesCarette commented 6 years ago

I understand that this is blocking you for Benford - anything else? I am trying to figure out the relative priority.

mkhattab940 commented 6 years ago

I think that's it. I haven't come across any other transformation that takes a floor

JacquesCarette commented 6 years ago

Ok, it's in my 'to do' list (at the appropriate priority).

JacquesCarette commented 6 years ago

I believe that commit https://github.com/hakaru-dev/hakaru/commit/62c662f2f9b52c817d54ed1c41dac4fe374daeec on master fixes this. You should merge this in.

Please close when you can verify it. In the meantime, I am switching assignees.

mkhattab940 commented 6 years ago

I have pulled in the latest code to master. @sohraa3 try it out

mkhattab940 commented 6 years ago

@sohraa3 Have you tried this yet?

sohraa3 commented 6 years ago

I tried floor(). it gives me this error.

hakaru: TODO: evaluatePrimOp{Floor} CallStack (from HasCallStack): error, called at haskell/Language/Hakaru/Sample.hs:382:5 in hakaru-0.6.0-AbnzUW5EnqjBuQmLn3LJbU:Language.Hakaru.Sample

JacquesCarette commented 6 years ago

You did make sure to recompile hakaru first, right?

sohraa3 commented 6 years ago

I did "git pull" and then "stack install"

mkhattab940 commented 6 years ago

Were you working from the master branch when you tried this?

mkhattab940 commented 6 years ago

To pull the latest master code into your working branch

git checkout master git pull git checkout your-branch git merge master

mkhattab940 commented 6 years ago

Also try deleting hakaru/.stack-work and the contents of ~/.local/bin before running stack install

JacquesCarette commented 6 years ago

stack clean should be enough...

sohraa3 commented 6 years ago

I still get the same message. My hakaru program is floor(3.6) I ran these in order from the master branch: git pull stack clean stack install

JacquesCarette commented 6 years ago

Ok, I've re-added this to my 'to do' list. Unlikely to get to it until next week though.

JacquesCarette commented 6 years ago

I did miss a case. Merge in c561495f from master.

JacquesCarette commented 6 years ago

[Note that you can re-open if it seems that it is not fully fixed]