#include "header.h" void osum(char *filename) { const counter no_obs=10, no_sum=100, no_num=100; const real mean=.5*no_num, rstd=sqrt(12); counter i, j, k; real *x, *y, *p, *pv, tmp, sum, a, b; puts("\n\t|-------------------------------------------------------------|"); puts("\t| The OVERLAPPING SUMS test |"); puts("\t|Integers are floated to get a sequence U(1),U(2),... of uni- |"); puts("\t|form [0,1) variables. Then overlapping sums, |"); puts("\t| S(1)=U(1)+...+U(100), S2=U(2)+...+U(101),... are formed. |"); puts("\t|The S''s are virtually normal with a certain covariance mat- |"); puts("\t|rix. A linear transformation of the S''s converts them to a |"); puts("\t|sequence of independent standard normals, which are converted|"); puts("\t|to uniform variables for a KSTEST. |"); puts("\t|-------------------------------------------------------------|\n"); printf("\t\t\tResults of the OSUM test for %s\n\n", filename); printf("\t\t\tTest no\t\t\tp-value\n"); x=(real*)malloc(no_num*sizeof(real)); y=(real*)malloc(no_num*sizeof(real)); p=(real*)malloc(no_sum*sizeof(real)); pv=(real*)malloc(no_obs*sizeof(real)); for(i=1; i<=no_obs; ++i){ for(j=0; j