You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To compute a Bayes bound (#174 / Robert's slides) , we do the same computation as in _compute, but with a size-1 out-axis (e.g. quanta produced) and an enormous in-axis (e.g. quanta detected). That yields an (unnormalized) posterior on the in-variable, from which we extract quantiles to get the desired bounds. A figure might help explain it better:
We calculate P(out|in) along the blue and red bands in the figure below, located at the bounds on the out-variable calculated in earlier steps. (For the outer blocks, there is only one band since the out variable is observed.) That gives us two posterior curves, from which we calculate quantiles, e.g. -3 sigma for blue and +3 sigma for red. These set the bounds for the actual block flamedisx uses, drawn as a solid black box.
At the moment, the implementation in #174 essentially re-implements _compute in a numpy-compatible way. That works but is not very maintainable / generalizable. Instead, we could leverage _compute itself to get a simpler Bayes bound routine that works for all blocks, at least 1d and 2d. Something like:
In BlockSource.annotate, set _min and _max in the dataframe to the huge proto-bounds (by calling some '_pre_annotate' method on each block perhaps), stepsize to 1, then call Source._populate_tensor_cache to initialize self.data_tensor.
In Block.annotate, call Source.ptensor_from_kwargs to get ptensor, and Source.domain for both self.dimensions to get 1d tensors representing the band coordinates. Reshape / add a size-one axis to make those 2d arrays. Then call compute, result.numpy(), find quantiles, set new _min and _max in the dataframe.
(Finally, Source._set_data proceeds as usual with _calculate_dimsizes and _populate_tensor_cache as usual, which updates self.data_tensor to one with correct _min, _max, and stepsize)
The text was updated successfully, but these errors were encountered:
To compute a Bayes bound (#174 / Robert's slides) , we do the same computation as in _compute, but with a size-1 out-axis (e.g. quanta produced) and an enormous in-axis (e.g. quanta detected). That yields an (unnormalized) posterior on the in-variable, from which we extract quantiles to get the desired bounds. A figure might help explain it better:
We calculate P(out|in) along the blue and red bands in the figure below, located at the bounds on the out-variable calculated in earlier steps. (For the outer blocks, there is only one band since the out variable is observed.) That gives us two posterior curves, from which we calculate quantiles, e.g. -3 sigma for blue and +3 sigma for red. These set the bounds for the actual block flamedisx uses, drawn as a solid black box.
At the moment, the implementation in #174 essentially re-implements _compute in a numpy-compatible way. That works but is not very maintainable / generalizable. Instead, we could leverage _compute itself to get a simpler Bayes bound routine that works for all blocks, at least 1d and 2d. Something like:
(Finally, Source._set_data proceeds as usual with _calculate_dimsizes and _populate_tensor_cache as usual, which updates self.data_tensor to one with correct _min, _max, and stepsize)
The text was updated successfully, but these errors were encountered: