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
Should BCConstantPrior enforce that a range be provided? Currently it just returns a constant value regardless of the parameter. Since a constant prior can only truly be defined for a finite region, we should perhaps have lower and upper limits and return -inf for the log prior if the parameter is outside the range.
It makes sense to me to define the range. Can you provide a little snippet where the range would help? I'm positive to making this change and we can probably do this automatically in the background for SetPriorConstant because we know the ranges.
A clear separation between BCParameter, the range, and the BCPrior becomes blurred, unfortunately :(
This blurring already exists, since BCConstantPrior at the moment has two constructors: one which takes the upper and lower limits and one which takes the range size. Both are used merely to store 1/range-size in the class. It would be a minor change to also store the actual limits---it would mean removing the constructor that takes the range size, though. (I do not think it's actually necessary or even used.)
Not a snippet, but an example: BCPrior's need not only be used in the automatic way BAT uses them. I use them such for complex parameters:
Define parameters for real an imaginary components of my complex parameter.
Define BCPrior's (in my case BCConstantPrior) for the abs and arg of the complex parameter
In LogAPrioriPrior, call the BCPrior objects with the abs and arg of my complex parameter.
Since at the moment the only range checking happens in BCEngineMCMC, the range checking is only applied to the real and imaginary components, not to the abs and arg.
Also, it would be a step in the right direction, since for a future release (perhaps BAT 1.1), I would like to remove parameter ranges and have them entirely dictated by the priors.
Activity
fredRos commentedon Oct 11, 2016
It makes sense to me to define the range. Can you provide a little snippet where the range would help? I'm positive to making this change and we can probably do this automatically in the background for
SetPriorConstantbecause we know the ranges.A clear separation between
BCParameter, the range, and theBCPriorbecomes blurred, unfortunately :(greenwald commentedon Oct 11, 2016
This blurring already exists, since
BCConstantPriorat the moment has two constructors: one which takes the upper and lower limits and one which takes the range size. Both are used merely to store 1/range-size in the class. It would be a minor change to also store the actual limits---it would mean removing the constructor that takes the range size, though. (I do not think it's actually necessary or even used.)Not a snippet, but an example:
BCPrior's need not only be used in the automatic way BAT uses them. I use them such for complex parameters:BCPrior's (in my caseBCConstantPrior) for theabsandargof the complex parameterLogAPrioriPrior, call theBCPriorobjects with theabsandargof my complex parameter.Since at the moment the only range checking happens in
BCEngineMCMC, the range checking is only applied to the real and imaginary components, not to theabsandarg.greenwald commentedon Oct 11, 2016
Also, it would be a step in the right direction, since for a future release (perhaps BAT 1.1), I would like to remove parameter ranges and have them entirely dictated by the priors.