Function with which to assign weights in place of -Infinity.
Function with which to assign weights in place of -Infinity. It is assumed that if chainValue == resultValue, the result is 0.0. Observe that setting this function to:
if(chainValue == resultValue) 0.0 else Double.NegativeInfinity
has the same effect as not using the DoubleWeight trait at all.
The pair containing the variables to sample and adjacent factors.
The pair containing the variables to sample and adjacent factors.
Get the factor from which to sample this block Returns a non-logarithmic factor
Get the factor from which to sample this block Returns a non-logarithmic factor
Normalize a factor so its weights sum to 1 Takes a logarithmic factor and returns a non-logarithmic factor
Normalize a factor so its weights sum to 1 Takes a logarithmic factor and returns a non-logarithmic factor
Sample this block once
Sample this block once
Select a set of indices in the factor according to the weights in the factor Works on a non-logarithmic factor
Select a set of indices in the factor according to the weights in the factor Works on a non-logarithmic factor
Specialized sampling for continuous (i.e. of type Double) elements in Chains. This differs from the default sampler in that it can override the zero probability states in ConditionalSelector factors. The idea here is that we allow a technically inconsistent state according to the factors when the value of the Chain and result element are close. This is needed for compound continuous elements because sampling will always produce disjoint ranges for each result element of the Chain, which creates determinism issues with the way we currently block variables. This solution has not been fully tested for accuracy of results.