1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| new;
output file = f:\visitors\jl10v\paper\skpss\asr.out reset;
print timestr(0);
t=1000;
rep=100000;
seed=345645;
res=zeros(rep,1);
perc={0.9,0.95,0.975,0.99};
root=2;
i=1;do while i<=rep;
if ( i % 10000 == 0 );
print i timestr(0);
endif;
e=rndns(t,1,seed);
s=cumsumc(e);
res[i]=sumc(s^2)/t^2;
if root==2;
e=rndns(t,1,seed);
s=cumsumc(e);
res[i]=res[i]+sumc(s^2)/t^2;
res[i]=res[i]/2;
endif;
i=i+1;endo;
q=quantile(res,perc);
print timestr(0);
if root==1;
print "percentiles of non-seasonal distribution";
else;
print "percentiles of seasonal distribution";
endif;
perc~q;
end; |