Tensorflow Probability CDF lower than it's PDF value

38 Views Asked by At

I've been testing Tensorflow Probability on some use cases and have some error. Working backwards, I found that, at least in the Normal distribution, you can see that while the PDF value for 0.9568... is 7.69...e-22, the CDF is 7.621...e-24. That is technically not possible in the theoretical Normal distribution nor on the empirical. Any ideas of what is happening or what did I miss? See the code and the results below:

import tensorflow_probability as tfp

tfd = tfp.distributions
tfb = tfp.bijectors

dist = tfd.Normal(loc=1.0, scale=0.1)
print('sample   :', dist.sample(3).numpy()) #Samples 3 numbers
print('prob     :',dist.prob((0,1,2)).numpy()) #Calculates the probabilities for positions 0,1,2
print('log_prob :',dist.log_prob((0,1,2)).numpy()) #Same as above just log
print('cdf      :',dist.cdf((0,1,2)).numpy()) #Calculates the cummulative distributions
print('mean     :',dist.mean().numpy()) #Returns the mean of the distribution
print('stddev   :',dist.stddev().numpy())
Resuls: 

sample   : [0.95685613 1.0321676  1.1132953 ]
prob     : [7.6946093e-22 3.9894230e+00 7.6946093e-22]
log_prob : [-48.616352    1.3836466 -48.616352 ]
cdf      : [7.619853e-24 5.000000e-01 1.000000e+00]
mean     : 1.0
stddev   : 0.1

Thanks in advance to anyone that may found the error event!

The CDF seems lower than the PDF value

0

There are 0 best solutions below