PDA

View Full Version : excel and chidist


readerea
04-22-2011, 01:29 PM
I hope someone can pass judgement on the following.
I have a large Excel file of flat races from the UK and Ireland. I run a number of VBA macros to simulate a variety of betting/laying strategies and then test the results. My most common test is use the chi-squared distribution to test that the number of successful betting or laying outcomes is significantly different from one that would be obtained by selecting a bet/lay at random.
Since the strategies do not choose races where no value is perceived, the number of selections made by the strategy differs from the random case where a random selection is made for each race in the data asset.
In order to use the Excel chitest function I need to have equal sized data sets. So I normalised the number of successes and failures by multiplying each by the ratio of number of selections made with the particular strategy to the number made by the random process. Any comments on that?
However, I couldn’t get WorksheetFunction.ChiTest to work but WorksheetFunction.ChiDist does. Has anyone ever got WorksheetFunction.ChiTest to work?
So I calculate the square of the difference between the observed results (successful outcomes from strategy) and the expected results (successful outcome from randomly selections) and divide it by the expected number of random successes..
To this I then add the square of the difference between the unsuccessful outcomes produced by the strategy loss ratio and the expected losses from random selections) and divided by the expected random losses.
I then call the Excel ChiDist function with that total and 2 degrees of freedom, in order to determine the probability that the success rate from the strategy is the sane as the success rate from a random selection strategy.
I choose 2 degrees of freedom as I have 4 pieces of data – success from strategy, number of selections from strategy, number of successes from random choice, number of random choices – that produce two statistics – number of unsuccessful outcomes from strategy and number of unsuccessful random outcomes. That gives me 4 - 2 , =2 degrees of freedom.
Would someone care to critique that approach?
Thanks in advance.