Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Luis A. Afonso
Posts:
4,518
From:
LIsbon (Portugal)
Registered:
2/16/05


How Bootstrap is able to attain alpha
Posted:
Oct 3, 2012 11:53 AM


How Bootstrap is able to attain alpha
In order to have an idea how Bootstraps is able to get worthy confidence intervals for normal data I though to compare: ___[ U, V] ___U = mX  T * sd /sqrt(n) ___V = mX + T * sd /sqrt (n) ___ sd= sqrt [( sumsquares  n * mX^2 ) / (n1)] where ____ mX = sample nsize mean value
Procedure: ____We simulate, via BoxMuller algorithm, 10´000 N(0,1) samples each was one the ?source? of 100 Bootstrap pseudosamples: each mean value is checked it is outside [U, V] and counted. Because this interval was set alpha = 0.05 (2 tails) is expected that a total of 500 can be found outside it. The dependence on sample sizes were studied.
Results : Bootstrap N(0 , 1) samples ________________________________Student Test____ ________________outside [U, V]__ _____n=10___________ 1.6%________T=2.262 _____n=25___________ 3.5__________ = 2.064 _____n=50___________ 4.2__________ = 2.010 _____n=100__________ 4.6__________ = 1.984 _____n=200__________ 4.8__________ = 1.972 _____n=300__________ 4.9__________ = 1.968
Here is clearly shown that only for sample sizes greater than 300 the nominal 5% alpha can be attained.
Luis A. Afonso
REM "ONEdata" CLS : PRINT : PRINT "______ONEDATA____"; PRINT " Bootstrap and Student" PRINT " ONE SAMPLE for Normal data sources " REM SOURCE pi = 4 * ATN(1) INPUT " Sample size "; n0 INPUT " Student .975 size1 df "; T2 INPUT " Bootraps/ Source "; ali INPUT " how many sources "; hm DIM X(n0), XX(n0), W(8004) REM FOR source = 1 TO hm REM LOCATE 10, 50 PRINT USING "#########"; hm  source RANDOMIZE TIMER REM outbysource = 0 mX = 0: sq = 0 REM THE SOURCE outbysc = 0 FOR i = 1 TO n0 aa = RND X(i) = 0 + 1 * aa * COS(2 * pi * RND) mX = mX + X(i) / n0 sq = sq + X(i) * X(i) NEXT i sd = SQR((sq  n0 * mX * mX) / (n0  1)) U = mX  T2 * sd / SQR(n0) V = mX + T2 * sd / SQR(n0) REM [U,V] is the acceptance interval for means REM BOOTSTRAP FOR j = 1 TO ali mmean = 0 FOR ii = 1 TO n0 g = INT(RND * n0) + 1 mmean = mmean + X(g) / n0 NEXT ii IF mmean < U THEN below = below + 1 / ali IF mmean > V THEN above = above + 1 / ali NEXT j NEXT source a = below / hm: ab = above / hm LOCATE 10, 42: COLOR 14 PRINT USING "###.#% BOOTSTRAP alpha"; (a + ab) * 100 COLOR 7 END



