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

learn more… | top users | synonyms

6
votes
1answer
87 views

Generating random numbers for long molecular dynamics simulations

I've written a basic 2D Langevin dynamics simulator in C++, for a particle in a potential, solving the equation: $$M\ddot{X} = - \nabla U(X) - \gamma M \dot{X} + \sqrt{2 \gamma k_B T M} R(t)$$ This ...
0
votes
0answers
54 views

Monte Carlo simulation

I am wondering if I am thinking correct about the following problem : ...
1
vote
1answer
61 views

Shifting points in fortran

Hello I am trying to shift points which have been previously generated in the square area. I am having a trouble with some additional conditions how they should have been shifted. ...
0
votes
1answer
53 views

How do I generate maxwell-boltzmann variates using a uniform distribution random number generator?

I am doing a molecular dynamics simulation. I need to assign initial velocities to the atoms. I want to assign the initial velocities which follow the maxwell-boltzmann distribution. How do I ...
0
votes
1answer
23 views

Generating pseudorandom sequences based on measured sequences

I'm looking for an algorithm to generate discrete-time pseudorandom sequences based on other sequences I already have that would be used to train the algorithm. More specifically, I have some ...
0
votes
0answers
50 views

How to generate random points with 3d coordinates in octave

I am pretty new in octave. I am trying to generate random points with 3d coordinates. I have tried with randi(10,[3,3,3]) function and getting some values like following: points=randi(10,[3,3,3]) ...
2
votes
1answer
79 views

solving for unknown inside an expectation

I have a an equation that need to find its root. The function is the following $f(\theta) \equiv E[R(\theta;\eta)]=0$ for some unknown $\theta$ which is deterministic, while the expectation is taken ...
0
votes
0answers
93 views

Calculating Conditional Expectations

I would like to compute the conditional expectation of a particular function : $E_{t}\left[ R(A_{t+1}, \eta_{t+1})\right | A_t]$ where $A_{t+1}$ and $\eta_{t+1}$ are two rv correlated to each ...
1
vote
1answer
85 views

Computing expectations

I want to compute the following conditional expectation $E_{t}[\phi(A_{t+1}, \eta_{t+1})| A_t]$ where $\log A_{t}=\rho \log A_{t-1} + e_{t}$ and $e_{t}$ is IID $N~(0,\sigma_e)$ and $\eta_{t}$ is ...
0
votes
0answers
31 views

Solving a nonlinear equation with a Markov process and RVs

Assume that we have the following equation and the following assumption. The scope is to solve for some particular variables expressed later. Update $$E_{t}\left[ b(A_{t+1})^{1-\gamma} ...
2
votes
1answer
140 views

Solving a nonlinear equation with random variable

I would like to solve an equation that looks like this UPDATE $E[(R^{1-\gamma})(r_k+\theta-r_z)]=0$ , where $R=\phi r_z+(1-\phi)(r_k+\theta)$ and $\phi\in[0,1]$, $\theta$, is a random variable ...
0
votes
1answer
284 views

Calculating periodicity of a pseudo random number generator (Middle-square method) [closed]

Below is a Python code that calculates the periodicity of the middle-square method for a given 4 digit-numbers: ...
0
votes
1answer
226 views

Drunken Man in Matlab

I wrote a script that plots the results of the "drunken lamppost" problem in MATLAB. Now I need to create a road-width from -3 to +3, length from 0 to infinity but the drunk can walk just ahead. It ...
1
vote
1answer
94 views

What is the name of the optimization algorithm that uses random sampling?

I am generating random weight as per e.g. below. The I generate a set of 3 values say 100, 250, 300 and I multiple them with the weights below Initial population. ...
7
votes
1answer
85 views

Shall I derandomize a randomized algorithm in real application?

In general (and in real application), suppose I am using a randomized algorithm (e.g. Use MCMC to sample from a distribution and then compute $E(f(x))$ for some function $f$) Assume my algorithm will ...
5
votes
2answers
452 views

Hashing algorithms/implementations for Monte Carlo simulation

To summarise this question in advance, I'm looking for a good hash function that is suitable for generating pseudo-random numbers in Monte Carlo simulations. This means it should be reasonably fast ...
3
votes
0answers
243 views

Generating pseudo-random orthonormal bases for random projection

I am performing series of random projections i.e. projecting the input matrix onto randomly generated orthonormal bases (of much lower dimensionality). The projection is just a matrix multiplication ...
5
votes
1answer
57 views

Random access random permutations

I have a large number of parallel processes and a large integer $n$, and want to randomly partition the integers $[0,n)$ among the processes with only $O(1)$ communication. One nice way to do this ...
2
votes
1answer
77 views

Randomly choose among N alternatives

I understand how to generate a random sequence of binary variables where 1 occurs with probability p and ...
5
votes
4answers
848 views

Simulated Annealing proof of convergence

I implemented downhill simplex simulated annealing algorithm. Algorithm is very hard to tune, w.r.t. parameters including cooling schedule, starting temperature... My first question is about ...
1
vote
1answer
130 views

Random placement of euclidean points with constrained inter-point distances in a fixed area

I'd like to place as many random points as possible in a 2D square $S=[0,1]x[0,1]$ such that the euclidean distance $d$ between any two points $d$ is greater than a given value $b$ (b is small). I'm ...
11
votes
4answers
246 views

How to create a random 3D domain representing a plant's root structure?

I would like to model laminar flow of water from roots to the stem of a plant. At the very end of the roots, the tubes vary from millimeter to centimeter scale in diameter and length. As we get closer ...
4
votes
1answer
3k views

How can I determine the period of my pseudo-random number generator?

Suppose I'm using a linear congruential pseudo-random number generator (PRNG). Given a seed $x_0$, the multiplying factor (a), the shift factor (c) and the modulus factor (m), how can I determine the ...
3
votes
1answer
63 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 ...
6
votes
4answers
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 ...
6
votes
2answers
2k 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 ...
4
votes
1answer
479 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 ...
17
votes
4answers
2k views

Is Fortuna or Mersenne Twister preferable as an algorithmic RNG?

A recent answer mentioned the use of Fortuna or Mersenne Twister Random Number Generators (RNGs) to seed a Monte Carlo simulation. I hadn't heard of Fortuna before so I looked it up - looks like it is ...
6
votes
4answers
300 views

How do I know which low-discrepancy sequence to use?

Whenever one uses a quasi-Monte Carlo method for cubature or optimization, it seems that there's a wide variety of low-discrepancy sequences to choose from, associated with the names of van der ...