codeplea / incbeta Goto Github PK
View Code? Open in Web Editor NEWIncomplete Beta Function (Student's t cumulative distribution function)
Home Page: https://codeplea.com/incomplete-beta-function-c
License: zlib License
Incomplete Beta Function (Student's t cumulative distribution function)
Home Page: https://codeplea.com/incomplete-beta-function-c
License: zlib License
Hi @codeplea,
I made use of this function in the MRtrix3 software to deal with compilation on systems where our primary mathematics library dependency, Eigen, is missing the corresponding function. Its use is in converting t-values / F-values to Z-scores prior to statistical enhancement within a generalised statistical inference framework that operates on different forms of neuroimaging data.
This code was recently flagged by Thread Sanitiser. Our code generates a non-parametric null distribution by evaluating random permutations of the data across multiple threads. The issue is that std::lgamma()
is not thread-safe. It evaluates the logarithm of the absolute value of the gamma function. In order to not lose information where the gamma function is negative, it stores the sign of the gamma function in a static external variable. There may be in some environments an alternative implementation lgamma_r()
, which takes as a second input a pointer to an integer where that sign is instead written, which can therefore be used in a thread safe manner.
Can I suggest:
a
and b
to the regularised incomplete beta function are positive (ie. I presume you're not handling analytic continuation)?std::lgamma()
are always positive and therefore the sign of the gamma function is always positive)?Cheers
Rob
As the title, I need it in c++, but I not very good to write it...
Why make such a choice to use a return 1.0 / 0.0;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.