c++ - Matlab - Cumulative distribution function (CDF) -
i'm in middle of code translation matlab c++, , important reasons must obtain cumulative distribution function of 'normal' function (in matlab, 'norm') mean=0 , dispersion=1.
the implementation in matlab this:
map.c = cdf( 'norm', map.c, 0,1 ); which suppose equalization of histogram map.c.
the problem comes @ moment of translating c++, due lack of decimals have. tried lot of typical cdf implementations: such c++ code found here, cumulative normal distribution function in c/c++ got important lack of decimals, tried boost implementation:
#include "boost/math/distributions.hpp" boost::math::normal_distribution<> d(0,1); but still not same implementation matlab's (i guess seems more precise!)
does know find original matlab source such process, or correct amount of decimals should consider?
thanks in advance!
the gaussian cdf interesting function. not know whether answer interest you, interest others question later, here is.
one can compute cdf integrating taylor series of pdf term term. approach works in body of gaussian bell curve, fails numerically in tails. in tails, wants special-function techniques. best source have read n. n. lebedev's special functions , applications, ch. 2, dover, 1972.
Comments
Post a Comment