View Single Post
Old 02-15-2008, 11:06 AM   #8 (permalink)
Ganchrow
Moderator
 
Ganchrow's Avatar
 
Join Date: 08-28-05
Location: Forest Hills, NY, Home of the Blitzkrieg Bop
Posts: 4,749
Ganchrow is offline
Default

Quote:
Originally Posted by VideoReview View Post
I would also be interested in the randomizing code you wrote about.
After the line "use warnings;" add the following code:
Code:
use Math::Random::MT;

my $rand_gen;
BEGIN {
	warn "Seeding random number generator.\n";
	require LWP::Simple;
	use constant RAND_URL => 'http://random.org/integers/?num=1248&min=0&max=65535&col=2&base=10&format=plain&rnd=new';
	my (@seed);
	foreach (split(/\n/, LWP::Simple::get(RAND_URL))) {
		m/^([0-9]+)\s+([0-9]+)$/;
		push @seed, $1 + $2*2**16;
	}
	$rand_gen = Math::Random::MT->new(@seed);
	warn "Random number generator seeded.\n";
}
and then replace the line "my $r = rand();" with:
Code:
my $r = $rand_gen->rand();
This utilizes the Mersenne Twister algorithm with a 19,968-bit truly-random seed obtained from random.org. It's not cryptographically secure but it's more than adequate for Monte Carlo purposes.

Quote:
Originally Posted by VideoReview View Post
Regarding your simplest suggestion, there seems to be one parenthesis missing and I can not make the equation work.
The entire clause "betting to win n unit at decimal odds d and edge E, variance would be (1+E)*(d-E-1) * n^2 / (d-1)^2" is in parentheses, so you can ignore the final paren mathematics-wise.

Quote:
Originally Posted by VideoReview View Post
If I have:
d=.6 (American Odds of +150)
+150 in decimal odds would be 2.5. See my odds converter. This yields variance of (1+0)*(2.5-1) * 1^2 / (2.5-0-1)^2 = 2/3.

Quote:
Originally Posted by VideoReview View Post
From my understanding, I assume I would calculate the results of the above equation for each of the 55 independent samples and take the square root which will give me the standard deviation. I believe the above example of +150 would evaluate to 3.75 if I ignore the last parenthesis. The square root of many such large numbers will not come close to 15.48%, so I am lost.
The sum of the variances evaluates to 41.7669 which, not coincidentally, is also the total amount wagered. (As I noted previously, when betting to win 1 unit at 0 expectation, the variance of a bet equals the units risked.) The square root of the variance (6.4627 units) is the standard deviation. Since your final results were +6.5659 units, your z-score is 6.5659 / 6.4627 ≈ 1.0160, implying a p-value of about 15.482%. That the p-value is so close to the standard deviation is mere coincidence.

Quote:
Originally Posted by VideoReview View Post
I do have a question for you about adhering to the Central Limit Theorem. Not so much from this post but from other posts you have made. I get the feeling that when you say things like "as long as your comfortable appealing to the Central Limit Theorem" --> (not a direct quote as I am going from memory on this) that maybe I shouldn't be appealing to it and maybe I should be thinking along the lines of Bayesian. Here are 2 simple questions that I have often wondered. Relevant to sports betting, do you personally appeal to the Central Limit Theorem for calculating probabilities and significance? Are there situations that you do not?
I'm just covering my ass -- I don't want some smart-alec screaming the distribution of outcomes isn't actually normal. In your example the CLT provides for a very decent approximate answer. If you had many fewer data points or had a number of big dogs or favorites then your skewed distribution of possible outcomes would not be so-well served by asserting normality.

For example, if you change were to change the odds on the 1st bet to +1000 (but keep it as a win) then your units won wouldn't change but your CLT p-value would be 11.768%. A 10,000,000-trial Monte Carlo simulation of same yields a p-value of about 15.95%.

Quote:
Originally Posted by VideoReview View Post
IAlso, if it were you and you had the choice of running 100,000,000 Monte Carlo simulations (with the better randomizer in place of course) or using the Central Limit Theorem example you proposed, which would you choose?
It really depends upon the data you're analyzing. As long as you have a let's say 30 or more data points with odds fairly close to even you'll get acceptably close results using the CLT. If you're concerned you can of course always verify your results with a quick Monte Carlo sim (couple million trials or so). If the results are comparable you can rest easy.

Quote:
Originally Posted by VideoReview View Post
Finally, the following equation did not work in Excel as it is missing parameters for the function. I am sure that they are probably assumed numbers like 1's and 0's but it would be helpful if you could fill them in for me.

15.48% (=1-NORMSDIST(1.016))
Are you sure you entered it as =1-NORMSDIST(1.016) and didn't omit the 'S'? That would give you the "too few arguments for this function" error message in Excel.
__________________
Reply With Quote