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,617
From:
LIsbon (Portugal)
Registered:
2/16/05


Whatever the distribution, no matter the statistics
Posted:
Nov 6, 2013 3:22 PM


Whatever the distribution, no matter the statistics
Need not (perhaps) to insist: through simulation (Monte Carlo) we are able to find the EDF (Empirical DF) of a known parameter estimator being only enough that we have a way to simulate the source Distribution. Example: What is the 1tails confidence interval, alpha=0.05, for the sample means of 4 df Chisquared? The routine below, 1 million of chisquared size 10 samples, obtained each chi value by adding the squares of four N(0,1) values (BoxMuller formula) gave as 95% quantile: ____1st attempt_____2.068 ____2nd___________2.066 Therefore the 1tail confidence interval for the sample means is [0, 2.07].
Luis A. Afonso
REM "MCHI4" CLS PRINT : PRINT " <MCHI4> " REM DEFDBL AZ INPUT " sample size = "; n INPUT " all = "; all DIM chi(8001) pi = 4 * ATN(1) FOR j = 1 TO all LOCATE 5, 40: PRINT USING "#######"; all  j RANDOMIZE TIMER FOR i = 1 TO n xy = 0 FOR ii = 1 TO 4 aa = SQR(2 * LOG(RND)) u = aa + COS(2 * pi * RND) xy = xy + u * u / n NEXT ii x = INT(1000 * xy + .5) IF x > 8000 THEN x = 8000 NEXT i chi(x) = chi(x) + 1 / all NEXT j REM cc = .95 sum = 0 FOR t = 0 TO 8000 sum = sum + chi(t) IF sum > cc THEN GOTO 15 NEXT t 15 LOCATE 17, 50 PRINT USING "##.### "; t / 1000; sum END



