From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id EBCD57F9BB for ; Wed, 2 Jul 2014 21:42:22 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.01,590,1400018400"; d="scan'208";a="83362745" Received: from cac94-1-81-57-150-173.fbx.proxad.net (HELO [192.168.0.22]) ([81.57.150.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 02 Jul 2014 21:42:22 +0200 Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Damien Doligez In-Reply-To: Date: Wed, 2 Jul 2014 21:42:22 +0200 Cc: OCaml Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Dan Stark X-Mailer: Apple Mail (2.1283) Subject: Re: [Caml-list] How does OCaml std test Random Hi, > I am looking at the source of Random module=20 >=20 > https://github.com/ocaml/ocaml/blob/master/stdlib/random.ml >=20 > I found that it is tested via chi-square test, here is the test code insi= de: [...] > From my knowledge, if I get a chi-square value, I should check it against= a table with the degree of freedom and then decide whether the null hypoth= esis fails or not. >=20 > Why (r -. sr, (r *. t /. n) -. n, r +. sr) can be used to check? What= 's the theory behind?=20 You'll have to ask someone who knows about statistics and random numbers. I= IRC, we implemented this chisquare test by copying from some book (possibly= Sedgewick's "Algorithms") and the criterion was taken from the same source. In fact, I'm almost sure the test results included in the comments were not= updated with the latest changes to the code. You should also pay attention to the comment about the Diehard tests at the= beginning of the file: these tests are much more thorough than chisquare, = and the current version passes them all. -- Damien