Tagged Questions

Questions on the algorithms for and uses of (pseudo)random number generators in scientific computing.

170 views

Constructing random divergence-free velocity fields

I am trying to simulate decaying homogeneous isotropic turbulence. As initial condition I want a divergence-free vector-field, i.e, $\mathrm{div} U = 0$. How do I initialize random velocity field in ...
60 views

Pseudo random numbers

I am learning how to use pseudo random number generators but the instructor just told us how they work without explaining why they work. For example, can one prove that the numbers generated by LCG ...
230 views

Parallel Mersenne Twister for Monte Carlo

Recently, I came across a comment claiming that almost all researchers doing Monte Carlo methods are doing it wrong. It went on to elaborate that merely choosing different seeds for different ...
98 views

Difference between true & pseudo random numbers

I recently heard that in Linux, /dev/random and /dev/urandom are pseudo random number generators but not true random number ...
46 views

PETCs - How should one initialize PetscRandom?

The documentation of PETSc shows an example of usage: ...
36 views

PETSc - how computing a random number between 0 and 1?

In PETSc, I need to generate a random number between 1 and 0. With the include cstdlib, the classical trick is: ...
50 views

Generating Random Numbers in Fortran for Metropolis method

I am having a really hard time getting any kind of reliable / consistent result from my Metropolis code. I have torn it apart and am now examining just the randomness in my random number generator. I ...
48 views

64 views

Adding deliberate imperfection to RNG output - toolkits?

Are there any existing software toolkits, libraries, frameworks or whatever for studying the quality of pseudorandom number generators that allow one to add a known amount of imperfection - e.g ...
1k views

How can I seed a parallel linear congruential pseudo-random number generator for maximal period?

Normally when I seed a sequential random number generator in C, I use the call srand(time(NULL)) then use rand() mod N ...
3k views

Looking for C/C++ implementations of sampling from multinomial and Dirichlet distributions

I'm looking for C/C++ implementations of functions that return random variates multinomial and Dirichlet distributions. This is in the context of a calculation for posterior predictive p-values, part ...
598 views

Sampling from posterior predictive distribution

First post. I'm working on this problem using Bayesian methods. In desperation I'm considering using p-values (shock horror), specifically posterior predictive p-values. So I need to simulate from the ...