tensorflow / tensorflow/probability
How to calculate quantile and variance for the tensorflow_probability output?
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I test the following code:
TFP Probabilistic Layers: Regression
In "Custom PSD Kernel" section, I got yhat as the prediction for the test data.
My purpose is to have a confidence interval for this prediction. If I want to calculate the variance or quantile for this prediction with the variance and quantile methods, respectively, I will get the following error:
NotImplementedError: variance is not implemented: TransformedDistribution
NotImplementedError: quantile is not implemented: Independent
Therefore my question is:
How can I obtain the confidence interval for this prediction?
I need something like the following picture [Confidence Interval for the prediction (yhat.mean())]:

Thanks for your help!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tensorflow_probability/examples/jupyter_notebooks/Probabilistic_Layers_Regression.ipynb, especially the "Custom PSD Kernel" section that produces yhat. Check the distribution methods used there and the reported TransformedDistribution and Independent errors. Done means documenting a supported way to obtain a confidence interval, or clearly explaining the limitation if no such method is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, tensorflow
- Domain
- machine-learning
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100