/// <summary> /// Sets the parameters to represent the list of sparse Betas raised to some power. /// </summary> /// <param name="betaList">The list of Betas</param> /// <param name="exponent">The exponent</param> public void SetToPower(SparseBetaList betaList, double exponent) { // TODO: handle point masses TrueCounts.SetToFunction(betaList.TrueCounts, x => exponent * (x - 1) + 1); FalseCounts.SetToFunction(betaList.FalseCounts, x => exponent * (x - 1) + 1); }
/// <summary> /// Sets to the product of two sparse lists of Betas. /// </summary> /// <param name="a">The first sparse list of Betas</param> /// <param name="b">The second sparse list of Betas</param> /// <remarks> /// The result may not be proper, i.e. its parameters may be negative. /// For example, if you multiply Beta(0.1,0.1) by itself you get Beta(-0.8, -0.8). /// No error is thrown in this case. /// </remarks> public void SetToProduct(SparseBetaList a, SparseBetaList b) { // TODO: handle point masses TrueCounts.SetToFunction(a.TrueCounts, b.TrueCounts, (x, y) => x + y - 1); FalseCounts.SetToFunction(a.FalseCounts, b.FalseCounts, (x, y) => x + y - 1); }