Coder Social home page Coder Social logo

log(0) warning about arspy HOT 2 OPEN

bsxfan avatar bsxfan commented on June 18, 2024
log(0) warning

from arspy.

Comments (2)

MFreidank avatar MFreidank commented on June 18, 2024

Hey @bsxfan,
Thanks for reporting this.
Currently, the only alternative I see would be to cap inputs to log at a small value to avoid the error, but that is guaranteed to affect sample statistics so I'm not sure it's a better solution.

I will double-check that the formula computed is correct (it's been a while since I looked at it) and if yes, I'll probably just add a few lines of documentation and suggest your workaround for such cases.

Update: on a separate note: do you know how the matlab implementation handles this? I don't have access to Matlab right now, but ideally we should handle this case in the same way.

from arspy.

bsxfan avatar bsxfan commented on June 18, 2024

@MFreidank

  • Sorry, my MATLAB license stayed behind with my previous employer. But as far as I remember from MATLAB, the default behaviour would be to quietly return -inf for log(0). So if the same thing happened in the MATLAB implementation, nobody would have noticed.
  • I can mention that the problem seems rare. As you can see in my test code, I had to do 1000 invocations to make it happen. If I do just 10, chances are it does not occur.

from arspy.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.