0
$\begingroup$

The law of iterated logarithm asserts that if $x_1,x_2,\dots$ are i.i.d $\cal N(0,1)$ random variables and $S_n=x_1+x_2+\cdots+x_n$, then $$\limsup_{n \to \infty} S_n/\sqrt {n \log \log n} = \sqrt 2, $$ almost surely.

Question: how to make numerical experiment to "confirm/illustrate " this law ?

It seems it is obvious how to make such numeric check, however when I am doing it I do not see theoretical result, it might be I am doing some mistake or there is some subtlety in choosing the numbers "n", size of sample, size of "cutoff", etc...

(Motivation look at some real-world data and look whether they satisfy similar laws.)


Here is how I am doing:

$lim sup$ is $lim_n sup_{m: n <= m < Inf } $ numerically we cannot analyze infinite data set $m: n <= m < Inf$, so we must choose some "cutoff": $sup_{m: n<= m <= cutoff }$.

Question: What should be the right choice for "cutoff" ?

I have tried to choose cutoff = 2n, 3n, 4n, 10n 100n , 1000n that does not seem to work. It seems when I increase cutoff result comes close to theory, however how big to take it ?

For example n = 1e5, cutOff = 2*n; sampleNum = 1e3 I get .38 instead of sqrt(2)

for n = 1e5, cutOff = 3*n; sampleNum = 1e3 I get .49

for n = 1e5, cutOff = 4*n; sampleNum = 1e3 I get .56

for n = 1e5, cutOff = 5*n; sampleNum = 1e3 I get .58

for n = 1e5, cutOff = 10*n; sampleNum = 1e3 I get .67

for n = 1e4 cutOff = 100*n sampleNum = 1e3 I get .94

for n = 1e4 cutOff = 1000*n sampleNum = 1e2 I get 1

The code in matlab:

n = 1e5
cutOff = 5*n;
sampleNum = 1e3
for k=1:sampleNum
    vecRandomN01 = randn(1,cutOff); % generate N(0,1) Y_i
    vecSummation = cumsum(vecRandomN01); % generate S_n = sum_{i<=n} Yi
    vecNormalizer = sqrt(n:cutOff).*sqrt(log(log(n:cutOff))); % Calculate denominator sqrt(n*log(log(n))) %
    vecNormalizedData = vecSummation(n:cutOff) ./ vecNormalizer; % divide S_n /  sqrt(n*log(log(n)))
    vecStoreMax(k) = max(vecNormalizedData); % take maximum of S_m  for  "m: n<= m <= cutOff "  %

    % plot(vecNormalizedData); hold on;

end;

mean(vecStoreMax)
median(vecStoreMax)
$\endgroup$
5
  • 1
    $\begingroup$ (I) I don't think that in most cases the law of the iterated logarithm (LIL) is the best tool to analyze real data (even really big data). (I)(i) For one thing, the factor $b_n:=\sqrt{\ln\ln n}$ grows very slowly. E.g., to get $b_n>2$, you need $n>5\times10^{23}$, almost as large as the Avogadro number; for $b_n>3$, you need $n>10^{3519}$ (the number of the elementary particles in the observale universe is about $10^{80}$, if I recall correctly). (I)(ii). The LIL should be very sensitive to the i.i.d. assumption, especially its independence part. $\endgroup$ Feb 3, 2016 at 15:08
  • $\begingroup$ Continued: (I)(iii) Because of the possible high sensitivity to the independence, the quality of the pseudorandom number generator may be very important. Do you know if it has been tested for the LIL? (II) Anyhow, I think that insight into the magnitude of the appropriate cutoff could be gained by following the lines of the proof of the LIL. $\endgroup$ Feb 3, 2016 at 15:08
  • $\begingroup$ (III) Also, real data distributions usually have much heavier tails than normal (because heavy tails are preserved by mixing and convolution). It is natural to expect that heavier tails will need lower cutoffs; cf. e.g. arxiv.org/abs/math/0610519. $\endgroup$ Feb 3, 2016 at 15:33
  • $\begingroup$ @IosifPinelis Thank you for your comments. Still I am curious can one numerically test LIL ? $\endgroup$ Feb 3, 2016 at 17:16
  • 1
    $\begingroup$ @AlexanderChervov I have the same problem here math.stackexchange.com/questions/1637989/… and here math.stackexchange.com/questions/1637233/… and $\endgroup$
    – Basj
    Feb 4, 2016 at 9:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.