Any Good PHP Statistics Libraries?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Grind-It-Out
    SBR Wise Guy
    • 05-04-10
    • 537

    #1
    Any Good PHP Statistics Libraries?
    Specifically, I'm looking for a good binomial distribution function to determine how good a particular handicapper is given a certain confidence level.

    Example:
    I have a handicapper who has made 20% ROI per game over 100 games.
    That's the equivalent of hitting at 60% on a +100 line. So that's the equivalent of a record of 60 - 40 over that 100 game stretch. Now, I want to calculate the winning % he will hit in the long run with a 90% confidence level.

    I can do it manually with a calculator like the one at http://stattrek.com/Tables/Binomial.aspx, entering

    Number of Trials: 100;
    Number of Success: 60;

    Now, with trial and error, I have to adjust Probability of success on a single trial until Cumulative Probability: P(X < 57) is .90

    In this scenario, I wind up with a probability of success of about 53.1%
    With a ton of handicappers to filter through, obviously I need an automated solution.

    Points will be given for a helpful answer!

    Since I know someone like mathdotcom will bring it up: the accuracy of the handicappers' records is not the point of this question, nor is the realism of the numbers in this example.
  • Ganchrow
    SBR Hall of Famer
    • 08-28-05
    • 5011

    #2
    I have a handicapper who has made 20% ROI per game over 100 games.
    That's the equivalent of hitting at 60% on a +100 line. So that's the equivalent of a record of 60 - 40 over that 100 game stretch
    This is most definitely NOT the way to perform this analysis. For each wager you'd need to consider bet size, betting odds, and theoretical hold. I discussed a simplified version of this from a strictly frequentist perspective in http://forum.sbrforum.com/players-ta...r-success.html.

    That very important issue aside for the sake of argument let's look at your hypothetical 60 winning picks out of 100 at even odds ...
    Probability of success on a single trial until Cumulative Probability: P(X < 57) is .90

    In this scenario, I wind up with a probability of success of about 53.1%
    I assume you meant P(X < 60), which is what would yield your 53.1% figure given the parameters you've supplied.

    To solve for that elusive 53.1% figure all you'd need is an implementation of the inverse Beta distribution, (which is the same as the inverse of the regularized incomplete beta function). Libraries for this abound in both C++ and Perl. Wrt PHP, I simply couldn't say, but Googling '+PHP +"Beta distribution"' could prove fruitful.

    Still what you're seeking is easily computed even with lowly Excel:
    Let N = number of trials = 100
    Let W = number of success = 60
    Let 1-α = confidence level = 90%

    Let q = single trial success probability that would yield fewer than W successes over N trials with probability of 1-α.

    q = 1-BETAINV(1 - α, N - W + 1, W)
    q = 1-BETAINV(0.9, 41, 60) ≈ 53.115%

    (If you don't have currently access to the BETAINV() function in Excel you'll need the check the Analysis Toolpak under the Add-Ins menu).

    What this tells us is that we can be ~90% confident that a bettor with a "true" 53.115% per-game win probability at +100 would correctly pick 59 or fewer games out of 100.

    I'll also mention for the benefit of anyone keeping score that this raw usage of the Beta ignores any prior knowledge we might have regarding the distribution of the binomial parameter. In other words ... like my post referenced above, there's absolutely nothing Bayesian about it.
    Comment
    • Grind-It-Out
      SBR Wise Guy
      • 05-04-10
      • 537

      #3
      Great stuff.

      I guess now my problem is choosing which method to follow. The Inverse Beta method here or the Z-Score method in your other article.

      It seems like you think Bayesian Inference is required, but I have no idea what that is. Strangely enough, I actually understand the other two.
      Comment
      SBR Contests
      Collapse
      Top-Rated US Sportsbooks
      Collapse
      Working...