From cb4dcd41badac52328da25f315f0d688841611bd Mon Sep 17 00:00:00 2001 From: mhjensen Date: Sun, 20 Dec 2020 23:06:10 +0100 Subject: [PATCH] update of file --- doc/src/Statistics/Statistics.dlog | 4 ++++ doc/src/Statistics/Statistics.do.txt | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/doc/src/Statistics/Statistics.dlog b/doc/src/Statistics/Statistics.dlog index ddfa3d0b5..0b45eb8ce 100644 --- a/doc/src/Statistics/Statistics.dlog +++ b/doc/src/Statistics/Statistics.dlog @@ -2,3 +2,7 @@ translating doconce text in Statistics.do.txt to ipynb Failed to remove ans_at_end environment Failed to remove sol_at_end environment output in Statistics.ipynb +translating doconce text in Statistics.do.txt to ipynb +Failed to remove ans_at_end environment +Failed to remove sol_at_end environment +output in Statistics.ipynb diff --git a/doc/src/Statistics/Statistics.do.txt b/doc/src/Statistics/Statistics.do.txt index db8d38f50..cdab9670e 100644 --- a/doc/src/Statistics/Statistics.do.txt +++ b/doc/src/Statistics/Statistics.do.txt @@ -1000,7 +1000,7 @@ print(Eigvals) !ec -======= Random Numbers ======= +===== Random Numbers ===== !bblock Uniform deviates are just random numbers that lie within a specified range @@ -1017,7 +1017,7 @@ or Monte Carlo computer work. -======= Random Numbers, better name: pseudo random numbers ======= +===== Random Numbers, better name: pseudo random numbers ===== !bblock A disclaimer is however appropriate. It should be fairly obvious that @@ -1037,7 +1037,7 @@ numbers, hopefully abiding to the following criteria: -======= Random number generator RNG ======= +===== Random number generator RNG ===== !bblock The most common random number generators are based on so-called Linear congruential relations of the type @@ -1064,7 +1064,7 @@ of the division $13/9$, namely $4$. !eblock -======= Random number generator RNG and periodic outputs ======= +===== Random number generator RNG and periodic outputs ===== !bblock The problem with such generators is that their outputs are periodic; @@ -1094,7 +1094,7 @@ just $2$. !eblock -======= Random number generator RNG and its period ======= +===== Random number generator RNG and its period ===== !bblock Typical periods for the random generators provided in the program library are of the order of $\sim 10^9$ or larger. Other random number generators which have @@ -1112,7 +1112,7 @@ number is the sum of the $l-i$th and $l-j$th values with modulo $M$, !eblock -======= Random number generator RNG, other examples ======= +===== Random number generator RNG, other examples ===== !bblock Such a generator again produces a sequence of pseudorandom numbers but this time with a period much larger than $M$. @@ -1138,7 +1138,7 @@ which according to the authors has a period larger than $2^{94}$. !eblock -======= Random number generator RNG, other examples ======= +===== Random number generator RNG, other examples ===== !bblock Instead of using modular addition, we could use the bitwise exclusive-OR ($\oplus$) operation so that @@ -1162,7 +1162,7 @@ it is given by $m\wedge n$. -======= Random number generator RNG, RAN0 ======= +===== Random number generator RNG, RAN0 ===== !bblock We show here how the linear congruential algorithm can be implemented, namely @@ -1200,7 +1200,7 @@ $q$ and $r$ are chosen so that $r < q$. -======= Random number generator RNG, RAN0 ======= +===== Random number generator RNG, RAN0 ===== !bblock To see how this works we note first that @@ -1217,7 +1217,7 @@ $[N_{i-1}/q]$ just yields a constant which is multiplied with $M$. -======= Random number generator RNG, RAN0 ======= +===== Random number generator RNG, RAN0 ===== !bblock We can now rewrite Eq. (ref{eq:rntrick1}) as @@ -1247,7 +1247,7 @@ label{eq:rntrick4} -======= Random number generator RNG, RAN0 ======= +===== Random number generator RNG, RAN0 ===== !bblock The term $[N_{i-1}/q]r$ is always smaller or equal $N_{i-1}(r/q)$ and with $r < q$ we obtain always a number smaller than $N_{i-1}$, which is smaller than $M$. @@ -1265,7 +1265,7 @@ set to $0$. -======= Random number generator RNG, RAN0 code ======= +===== Random number generator RNG, RAN0 code ===== !bblock !bc cppcod @@ -1552,7 +1552,7 @@ int main(int argc, char* argv[]) -======= Which RNG should I use? ======= +===== Which RNG should I use? ===== !bblock * C++ has a class called _random_. The "random class":"http://www.cplusplus.com/reference/random/" contains a large selection of RNGs and is highly recommended. Some of these RNGs have very large periods making it thereby very safe to use these RNGs in case one is performing large calculations. In particular, the "Mersenne twister random number engine":"http://www.cplusplus.com/reference/random/mersenne_twister_engine/" has a period of $2^{19937}$. * Add RNGs in Python