diff --git a/App/Program.cs b/App/Program.cs index d309a65..bf2b69f 100644 --- a/App/Program.cs +++ b/App/Program.cs @@ -1,6 +1,6 @@ using Overround; -double[] fairPrices = [1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4]; +double[] fairPrices = [1 / 0.01, 1 / 0.29, 1 / 0.3, 1 / 0.4]; double fairBooksum = Booksum.FromPrices(fairPrices); Console.WriteLine("fair prices: [{0}]", string.Join(", ", fairPrices)); Console.WriteLine("fair booksum: {0}", fairBooksum); diff --git a/Overround/OddsRatio.cs b/Overround/OddsRatio.cs index d8e5786..3fcd0b6 100644 --- a/Overround/OddsRatio.cs +++ b/Overround/OddsRatio.cs @@ -6,7 +6,7 @@ public class OddsRatio : IOverroundMethod private const double ErrorThreshold = 1e-6; private const int MaxIterations = 100; - static double[] ComputeOdds(double[] fairPrices, double g) + private static double[] ComputeOdds(double[] fairPrices, double g) { double[] odds = new double[fairPrices.Length]; for (int i = 0; i < fairPrices.Length; i++) diff --git a/Overround/Power.cs b/Overround/Power.cs index a8c35d5..03b0b51 100644 --- a/Overround/Power.cs +++ b/Overround/Power.cs @@ -6,12 +6,12 @@ public class Power : IOverroundMethod private const double ErrorThreshold = 1e-6; private const int MaxIterations = 100; - static double GetInitEstimate(double overround, int numOutcomes) + private static double GetInitEstimate(double overround, int numOutcomes) { return 1 + Math.Log(1 / overround) / Math.Log(numOutcomes); } - static double[] ComputeOdds(double[] fairPrices, double k) + private static double[] ComputeOdds(double[] fairPrices, double k) { double[] odds = new double[fairPrices.Length]; for (int i = 0; i < fairPrices.Length; i++) diff --git a/Overround/Solver.cs b/Overround/Solver.cs index 9735f10..e01d567 100644 --- a/Overround/Solver.cs +++ b/Overround/Solver.cs @@ -21,12 +21,12 @@ public static Solution Solve(double initEstimate, double initStep, double errorT double lastError = lossFunc(initEstimate); if (lastError < errorThreshold) { - return new Solution(initEstimate, errorThreshold, 1); + return new Solution(initEstimate, lastError, 1); } double lastEstimate = initEstimate; double step = initStep; - int iteration = 1; + int iteration = 2; while (true) { double estimate = lastEstimate + step; diff --git a/README.md b/README.md index 6a8dd7f..109c326 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ === [![Build Status](https://img.shields.io/github/actions/workflow/status/kindredgroup/overround-methods/dotnet.yml?branch=master&style=flat-square&logo=github)](https://github.com/kindredgroup/overround-methods/actions/workflows/dotnet.yml) -A collection of overround application methods: Multiplicative, Additive, Power and Odds-Ratio. +A collection of overround application methods: _Multiplicative_, _Additive_, _Power_ and _Odds-Ratio_. # Examples ```csharp