/// <summary> /// Sets the log probability of the binary variable being true /// </summary> public void SetLogProbTrue(double logProbTrue) { if (logProbTrue > 0) { throw new ArgumentOutOfRangeException(nameof(logProbTrue), $"{nameof(logProbTrue)} = {logProbTrue} > 0"); } LogOdds = MMath.LogitFromLog(logProbTrue); //-MMath.LogExpMinus1(-logProbTrue); }
/// <summary> /// Sets the log probability of the binary variable being true /// </summary> public void SetLogProbTrue(double logProbTrue) { if (logProbTrue > 0) { throw new ArgumentException(String.Format("logProbTrue = {0} is not <= 0", logProbTrue), "logProbTrue"); } LogOdds = MMath.LogitFromLog(logProbTrue); //-MMath.LogExpMinus1(-logProbTrue); }
/// <summary> /// Sets the log probability of the binary variable being true /// </summary> public void SetLogProbTrue(double logProbTrue) { if (logProbTrue > 0) { throw new ArgumentOutOfRangeException("logProbTrue", String.Format("logProbTrue = {0} > 0", logProbTrue)); } LogOdds = MMath.LogitFromLog(logProbTrue); //-MMath.LogExpMinus1(-logProbTrue); }
/// <include file='FactorDocs.xml' path='factor_docs/message_op_class[@name="StringsAreEqualOp"]/message_doc[@name="AreEqualAverageConditional(StringDistribution, StringDistribution)"]/*'/> public static Bernoulli AreEqualAverageConditional(StringDistribution str1, StringDistribution str2) { return(Bernoulli.FromLogOdds(MMath.LogitFromLog(str1.GetLogAverageOf(str2)))); }