Comments (11)
I would prefer to use "scale" and "shape" instead of abbreviations in the definition of Gamma and s/c in the algorithm because that's conform to the paper!
from bayem.
So finally, what would be a proper choice (shape, scale) for a non-informative gamma distribution (which in the VB, represents the precision of the noise)? Maybe we should only select a proper "shape" for the general case, since "scale" is just a scale and can be chosen according to the magnitude of an individual entry of forward-model output.
from bayem.
Setting the shape (e.g. to 1 to have an exponential distribution) is what we tried (at least that was the idea). However, I think the challenge is howto choose the scale - if we model the precision of the noise the true value should always be included in the pdf - and be careful, since the precision is increasing for lower std.
from bayem.
Thanks. I actually think the challenge is a bit beyond, since we have no concrete idea about the precision of true noise for a real data-set. We can only have an estimate of a range for it. So, one approach would be:
Suppose:
- max_fw_group: an estimate of maximum magnitude of one group of forward-model output
, then we can say for example: - min_std_noise = 0.001 * max_fw_group # quite small
- max_std_noise = 0.5 * max_fw_group # quite big (conservative)
, which leads to: - max_precision_noise = 1 / (min_std_noise ^2)
- min_precision_noise = 1 / (max_std_noise ^2)
Now the question is how to set a properly-shaped gamma distribution, such that for example:
percentile( 5% ) = min_precision_noise
percentile(95% ) = max_precision_noise
from bayem.
Someone has provided a nice python code to extract this info:
https://www.codeproject.com/Articles/56371/Finding-Probability-Distribution-Parameters-from-P
I am going to use it.
from bayem.
The procedure you suggest seems useful. Even tough I would argue that we often should have some knowledge on the noise term - otherwise the Bayesian procedure should be questioned at all. If you have no idea, then just use a frequentist approach (the essential feature of Bayesian is actually to include prior - be it even very sparse e.g. knowing that some parameter such as the noise std is always positive).
from bayem.
Jörg suggested to remove the constructor Gamma.FromSD(some_sd, shape=1)
as it can hide the fact that it is actually built from a scape and a scale parameter.
A more explicit implementation could look like
shape, scale = GammaHelper.from_sd(42.)
noise_prior = Gamma(shape, scale)
and people (or at least I) will then use it as the one-liner
noise_prior = Gamma(*GammaHelper.from_sd(42.))
which also hides the shape and the scale.
So I would argue that we cannot prevent people to make errors or to use stuff, they to not understand. And, as this GammaHelper.from_sd
would only be used to actually construct a Gamma
, I would keep it as is. But I have no strong opinion about that and a change would be trivial. What do you think?
from bayem.
This separation is nice:
- first, get standard gamma parameters
- second, get the gamma distribution itself
It could make more sense IMO when we define the method 'from_sd' with two arguments (lower and upper sd):
shape, scale = GammaHelper.from_sd(lower_sd, upper_sd, percentile=0.05)
This is what I implemented here. Note that, the bound_scales and target_stds are finally leading to lower_sd and upper_sd .
from bayem.
I would also think that the separation is more straighforward, and maybe Abbas can then add his approach as an alternative.
from bayem.
I swapped shape and scale here, but there still is no real test. How to proceed here? Who is willing to invest some thoughts into a test case?
from bayem.
We try to derive a test case based on an analytical model #25
from bayem.
Related Issues (20)
- Remove sphinx from requirements HOT 2
- Proper VB scaling HOT 2
- Potential bug in our F formula HOT 6
- Prescribed correlation (in noise model) HOT 28
- Remove Gamma.Noninformative()? HOT 1
- Linearity check HOT 3
- Towards `bayem` HOT 6
- Failing visualization test
- Fancy readme
- Docstrings
- pre-commit hooks
- Check ARD implementation HOT 1
- VB `state` variable HOT 1
- VB_postprocess_per_iteration HOT 4
- VB_handle_diverging_ME HOT 4
- Sub-optimal control flow HOT 1
- Visualization of marginalized posteriors HOT 3
- Changes in visualization somehow break the CI HOT 1
- levels are not always computed correctly
- remove python 3.7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bayem.