tensorflow / probability

Probabilistic reasoning and statistical analysis in TensorFlow
https://www.tensorflow.org/probability/
Apache License 2.0
4.26k stars 1.1k forks source link

`cdf` in `distributions.NormalInverseGaussian` not implemented? #1398

Open Nishan-Pradhan opened 3 years ago

Nishan-Pradhan commented 3 years ago

Hi,

Is the cdf() function from distributions.NormalInverseGaussian currently working? or is it in the pipeline? as I seem to be getting the following error when attempting to use it:

NotImplementedError: cdf is not implemented: NormalInverseGaussian

I see it appears in the docs here: https://www.tensorflow.org/probability/api_docs/python/tfp/distributions/NormalInverseGaussian

emilyfertig commented 3 years ago

HI @Nishan-Pradhan -- The docs for cdf and other common Distribution methods are generally shared among all distributions (and pulled from the Distribution base class), so they appear even though some distributions don't implement them. NormalInverseGaussian.cdf isn't implemented, and currently we don't have plans to add it. It looks like there's no analytical form of the CDF, so you could approximate it via sampling or quadrature (we have tfp.math.trapz for trapezoidal numerical integration, or scipy has more quadrature grids that might give a better fit).