Questions tagged [monte-carlo]

Questions on Monte Carlo methods, methods that require the repeated generation of (pseudo-, quasi-)random numbers for computing their results.

Filter by
Sorted by
Tagged with
2
votes
1answer
105 views

Monte Carlo Metropolis method - trial step algorithm

I'm working on a Magnetization simulation and writing an algorithm using the metropolis method. I am using a change in energy and a Boltzmann distribution, but, my question is about the trial step. ...
5
votes
1answer
848 views

Convergence of Monte Carlo integration

In my research, one of the steps is to choose a numerical method to estimate $\int_a^b f(t)dt$, where $f$ is Lipschitz continuous but not differentiable. For simplicity, I used midpoint rule but the ...
2
votes
2answers
804 views

How to choose the number of random points in Monte Carlo simulations?

I am struggling with convergence criteria when performing a Monte carlo simulation on a uniform distribution. Any help would be much appreciated ! Say I want to sample uniformly a 1D interval (for ...
0
votes
1answer
515 views

Variational Monte Carlo: Variational energy is lower than ground state energy

I'm writing a VMC simulation for hydrogen and helium atoms, but in both my codes my variational energy for certain wavefunctions is not only statistically different from my expectation value, but it ...
1
vote
0answers
182 views

Maxwellian distribution of velocities with Shake algorithm present

I am writing a code to perform hybrid monte carlo molecular dynamics. To do this, I need to have a code to initialize the velocities of all particles according to a maxwell distribution. The code is ...
1
vote
0answers
152 views

Variational Monte Carlo to calculate local energy of hydrogen like ions in python

I'm writing up a code to calculate the local energy for electrons in hydrogen like ions for a given wavefunction. My code is giving me weird results, which leads me to believe something is wrong. ...
5
votes
1answer
74 views

Optimal partitioning of a graph

Consider a planar graph, where each node is associated with a weight. I would like to partition the graph such that the sum of the node weights in each group satisfy a minimum requirement. However, I ...
1
vote
0answers
127 views

Monte Carlo simulation [closed]

I am wondering if I am thinking correctly about the following problem : Define the box of the dimensions $(a,a,H)$ in the $X$,$Y$, and $Z$ directions, respectively. Insert $n$ particles into the box ...
2
votes
1answer
384 views

Monte Carlo Double Integration Implementation

Am implementing a monte carlo integration routine to compute this double integral in eqn 0.3 of page 2 of this paper 'Mobius energy of knots and unknots', Annals of Mathematics, http://www.math.ucsb....
2
votes
1answer
223 views

Metropolis Monte Carlo integration of Area with unknown normalization

I probably miss something very basic. I don't see how to use Metropolis–Hastings algorithm for computation of integrals, if I don't know the volume of accessible phase space (i.e. proper normalization ...
10
votes
3answers
768 views

How to sample points in hyperbolic space?

Hyperbolic space in the Poincaré upper half space model looks like ordinary $\Bbb R^n$ but with the notion of angle and distance distorted in a relatively simple way. In Euclidean space I can sample a ...
1
vote
0answers
74 views

Monte Carlo sampling of particle system for velocity dependent potential

When sampling configurations of point particles in statistical mechanics by means of (Markov chain) Monte Carlo, we may work with a potential that only depends on the positions of the particles, and ...
8
votes
1answer
100 views

Choosing how many iterations to use in VEGAS

I'm using VEGAS integration, specifically the GSL implementation, for some QCD calculations, and I've been investigating the behavior of the algorithm for various numbers of iterations in an attempt ...
1
vote
0answers
302 views

Spin-spin correlation functions in the Ising Model Monte Carlo [closed]

I'm using the Metropolis algorithm for 2D up to 5D for the Ising Model and I want to compute the spin-spin correlation function. $$c(r)=<s_is_r>−〈s_i〉〈s_r 〉$$ but I'm not sure how to estimate $...
1
vote
1answer
28 views

Monte Carlo update based on sub-lattices

I would like to simulate a 2D classical spin system, whose interactions are only nearest neighbor, using Monte Carlo. I would like to use Metropolis for updating. I have seen that when updating one ...
1
vote
1answer
128 views

Parallel Monte Carlo simulation using PETSc

I am trying to do Monte Carlo simulation for a large problem which requires eigensolution of a matrix for each sample. The matrix itself is quite large so much so that I want the eigensolution itself ...
2
votes
1answer
129 views

What are the tradeoffs of using statically allocated arrays vs. pointers and dynamic allocation? [closed]

I am learning Monte Carlo simulation by C++. I begin with reading codes (from the internet and text books) of the 2D Ising model and the XY model. I find some people define spins simply by a two ...
2
votes
0answers
92 views

Tracking the speed of 2D oscillations on a lattice

I wrote a Monte Carlo simulation of the 2D Lotka-Volterra model on a discrete lattice (with periodic boundary conditions). A video that I produced (which images the system after some number of monte ...
3
votes
1answer
142 views

Monte Carlo Simulation - Random Number Motivation

For Monte Carlo simulations, or any other numerical methods that rely heavily on the quality of the pseudo-random numbers generated (i.e even/desired distribution on a certain domain) for that matter, ...
2
votes
1answer
331 views

Are there companies which create commercial molecular dynamics / monte carlo simulations? [closed]

I would like to know if there is a commercialization of simulations? Or is it only in academic usage?
0
votes
1answer
90 views

How to get values from the loop in MATLAB?

Could you tell me please how to obtain separate values of "pi" depending on the value of N (code below)? For example If I write "pi1" I will get a value of "pi" for N(1) where N(1)=100. If I write "...
3
votes
1answer
90 views

Extract the correlation matrix from Monte Carlo data

I am writing my undergrad thesis on the harmonic oscillator on a lattice. So far I have implemented the Metropolis Monte Carlo algorithm to generate trajectories $x_j$ for $0 \leq j < N$, where $N$ ...
1
vote
1answer
144 views

optimizing a discontinous function

I am trying to maximize the following function (variable: $\theta$, a vector ($\theta_1$,...,$\theta_K$). most likely $K\leq5$ $$ \begin{aligned} F(\theta, c_0, c_1) = &P_{\theta}(T_0 > c_0, \...
7
votes
1answer
3k views

Quasi Monte Carlo in Matlab

I want to use Quasi Monte Carlo to try and improve the convergence of a simulation I am running. The random numbers are simply to produce the observation errors for a standard linear regression model,...
12
votes
2answers
448 views

Regarding automatic differentiation, is source-code-transformation (STC) more efficient than operator-overloading (OO)?

We are working on a Bayesian model for a space-time process, and are using a No-U-Turn sampler (NUTS) that requires a model for the log-probability and it's gradient with respect to the model ...
7
votes
1answer
97 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 ...
9
votes
2answers
341 views

suggestion for managing simulation runs?

This questions may be a bit off-topic in comp-sci. if it is needed please suggest where does it fit with. The question is regarding on how to manage all the simulation runs efficiently. let's say, ...
7
votes
1answer
185 views

Generation of variable with given auto-correlation function

How can I generate realizations of random complex variable $x(t)$ with a given autocorrelation function $C(s)$, defined by $$C(s) = \langle x(s) x(0) \rangle$$ and obeying the condition $C(-s) = C^*(...
3
votes
3answers
306 views

Separation of degrees of freedom in Monte Carlo simulation

My question is probably very simple and deals with separation of degrees of freedom in a Monte Carlo Brownian dynamics simulation. Dealing with a particle in an external potential, I want to simulate ...
5
votes
3answers
1k views

How to sample numerically from an arbitrary smooth distribution?

I'm given a smooth probability density function via its values on a reasonable fine grid. I assume that cubic spline interpolation (or cubic spline interpolation of the logarithm of the density) will ...
3
votes
0answers
81 views

Stochastic Collocation for time evolving ODE

For an Stochastic Differential Equation, e.g., $$ \frac{du}{dt} = \alpha*\sin(u*t) $$ where $\alpha$ is normally distributed with nonzero mean, I am trying to use a stochastic collocation approach ...
11
votes
2answers
507 views

Numerical method for equation solving that works on stochastically computed functions

There are many well known numerical methods for solving equations of the type $$ f(x) = 0, \quad x \in \mathbb{R}^n,$$ e.g. bisection method, Newton's method, etc. In my application $f(x)$ is ...
0
votes
3answers
756 views

What is local Monte Carlo simulation?

"The traditional local Monte Carlo method is simple, extremely general, and versatile." -Wang Swendsen, 2002 What does 'local' Monte Carlo mean ? Is there anything called 'global' Monte Carlo?
5
votes
2answers
901 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 (...
10
votes
2answers
445 views

Confusion about Quantum Monte Carlo

My question is about extracting observables from QMC methods, as described in this reference. I understand the formal derivation of various QMC methods like Path Integral Monte Carlo. However, at the ...
5
votes
2answers
272 views

Convergence tests in Markov Chain Monte Carlo

For a relatively simple Markov chain Monte Carlo process, such as using Metropolis to find calculate thermal averages for an Ising model, how is it possible to determine whether quantities have ...
3
votes
1answer
214 views

Is using Monte Carlo method a good approach for solving Boltzmann equation?

I'm trying to solve for electron and hole distribution function using Boltzmann equation with various scattering mechanisms. Since I land up with an integro-differential equation, analytical solution ...
3
votes
2answers
268 views

What FCIQMC codes are out there?

Full configuration interaction quantum Monte Carlo seems like it is poised to overtake DFT in some applications pretty soon. I am curious if there is any freely available implementation of the method,...
1
vote
1answer
130 views

DIST strings - Monte Carlo Simulation

I recently read something that talks about DIST distribution strings. It appears to be a way to take a long string of previously generated numbers and somehow compress them into a string that can ...
5
votes
3answers
330 views

Monte Carlo approximation of PI

I'm trying to understand how to compute the value of Pi by means of the Monte Carlo simulation. I have a circle inside a square where the sides of the square are tangent to the circle. As data I have ...
12
votes
4answers
1k views

Parallel (GPU) algorithms for asynchronous cellular automata

I have a collection of computational models that could be described as asynchronous cellular automata. These models resemble the Ising model, but are slightly more complicated. It seems as if such ...
4
votes
3answers
162 views

nuclear reaction fluid modelling

I'm pretty ignorant regarding the dark arts of numerical codes and modelling, but i'm interested in trying to pursue it for a particular pet project. It regards modelling of nuclear reactions like ...
8
votes
2answers
166 views

Approximation of partial derivative of a function of stochastic variable

Let $X_t$ be an Ito process $$ dX_t=a(X_t,t)dt + b(X_t,t)dW_t $$ where $W_t$ is a Wiener process. A numerical approximations of the solution of this equations is proposed by Milstein: $$ X_T=X_t+...
5
votes
1answer
459 views

index representation of the diamond lattice

For a kinetic Monte Carlo simulation of solids that crystallize in the diamond lattice structure, I need some efficient representation of the diamond lattice as integer(s), to store it in some array-...
8
votes
1answer
262 views

Rebinning algorithm in VEGAS

I am trying to understand the rebinning algorithm of the VEGAS (original publication (preprint from LKlevin) and implementation notes) Monte Carlo integration. I will try to explain first what I think ...
3
votes
1answer
84 views

Randomly choose among N alternatives

I understand how to generate a random sequence of binary variables where 1 occurs with probability p and ...
10
votes
3answers
838 views

Maximizing unknown noisy function

I'm interested in maximizing a function $f(\mathbf \theta)$, where $\theta \in \mathbb R^p$. The problem is that I don't know the analytic form of the function, or of its derivatives. The only thing ...
11
votes
3answers
340 views

Under what circumstances is Monte Carlo integration better than quasi-Monte Carlo?

A simple enough question: to do a multidimensional integral, given that one has decided that some sort of Monte Carlo method is appropriate, is there any advantage that a regular MC integration using ...
12
votes
3answers
1k views

Numeric integration of multi-dimensional integral with known boundaries

I have a (2-dimensional) improper integral $$I=\int_A \frac{W(x,y)}{F(x,y)}\,\mbox{d}x\mbox{d}y$$ where the domain of integration $A$ is smaller than $x=[-1,1]$, $y=[-1,1]$ but further restricted by ...
7
votes
2answers
2k views

Minimum image convention for triclinic unit cell

The minimum image convention (MIC), see for example a short note of W. Smith, is often used in molecular dynamics or monte carlo simulations of periodic systems with an orthorhombic unit cell. For ...