/// <summary> /// Sets this BernoulliIntegerSubset distribution to the weighted sum of two other such distributions /// </summary> /// <param name="weight1"></param> /// <param name="value1"></param> /// <param name="weight2"></param> /// <param name="value2"></param> /// <remarks>Not yet implemented</remarks> public void SetToSum(double weight1, BernoulliIntegerSubset value1, double weight2, BernoulliIntegerSubset value2) { if (weight1 + weight2 == 0) { SetToUniform(); } else { LogOddsVector.SetToFunction(value1.GetProbTrueVector(), value2.GetProbTrueVector(), (x, y) => MMath.Logit((weight1 * x + weight2 * y) / (weight1 + weight2))); } }
/// <summary> /// Gets a vector of P(true) values. /// </summary> /// <returns></returns> public void SetProbTrueVector(SparseVector probTrueVector) { LogOddsVector.SetToFunction(probTrueVector, MMath.Logit); }