PDA

View Full Version : Rand Var, CI problem


jon_1van
12-21-2005, 12:07 PM
So I'm trying to make a program similar to pokerstove, but for stud instead.


Assume my program generates a string of numbers like : -2, -2, -2, 10, -2, 10..... (ie lose 2 bets with some frequency and gain 10 bets with some frequency)



What I'd like to do is report the expected value of that stream within a certain confidence interval that the user specifies (say within .05 big bets)



Is the following approach valid ::

-Compute sample varience = 1/(n-1) * SUM( Xi - XBAR)
-Sample SD = sqrt(sample varience)

Lets assume the CI is 5 standard deviations big (2.5 SD on either side of the true E[x])

Now all I have to do is generate random number from the stream until the Sample SD = .02 BB.

Is this valid? Is it close enough?

jon_1van
12-21-2005, 06:09 PM
anybody?

alThor
12-21-2005, 11:12 PM
Close enough.

1. In principle, you shouldn't decide on an interval size first, and determine n later, on the fly. Instead, determine a (large) sample size first, then construct the interval. But this isn't a biggie. Technically it would induce a bias, but it'd be so small you'd never notice.

2. If you know the output only takes on two possible values, you should use a slightly different sample variance formula. (In effect, divide by n instead of n-1.) Again, this isn't a biggie. When n is large, it is roughly equal to n-1.

alThor

AaronBrown
12-21-2005, 11:27 PM
I don't understand the problem.

If your program generates the stream, then you can compute the expected value unless the program is extremely complex.

If that's impossible, you can use something like your approach, but your formulae are wrong.

If you assume that the individual values are independent and there are enough values that the Normal approximation is value (at least 30, unless you have some extreme values that show up very rarely), then the standard deviation of Xbar is approximately:

{Sum[(Xi - Xbar)^2]}^0.5/n