Share Your Experience: Take the 2024 Developer Survey

Questions tagged [monte-carlo]

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

139 questions
Filter by
Sorted by
Tagged with
9k views

How to add large exponential terms reliably without overflow errors?

A very common problem in Markov Chain Monte Carlo involves computing probabilities that are sum of large exponential terms, $e^{a_1} + e^{a_2} + ...$ where the components of $a$ can range from ...
• 758
809 views

PDEs in Many Dimensions

I know that most methods of finding approximate solutions to PDEs scale poorly with the number of dimensions, and that Monte Carlo is used for situations that call for ~100 dimensions. What are good ...
• 3,355
614 views

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 ...
• 2,076
6k views

How can I approximate an improper integral?

I have a function $f(x,y,z)$ such that $\int_{R^3} f(x,y,z)dV$ is finite, and I want to approximate this integral. I'm familiar with quadrature rules and monte carlo approximations of integrals, ...
• 12k
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 ...
• 1,119
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 ...
• 1,203
872 views

Replacing Mathematica's QuasiMonteCarlo integration in C++

I have a Mathematica program which performs some integrals in 3 or 4 dimensions using the QuasiMonteCarlo method. The problem is, it takes an annoyingly long time ...
• 3,383
457 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 ...
• 3,383
534 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 ...
• 2,600
909 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 ...
• 707
2k 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 ...
2k views

Drawing samples from a finite mixture of normal distributions?

After some Bayesian update steps, I am left with a posterior distribution of the form of a mixture of normal distributions,$$\Pr(\theta| \text{data} ) = \sum_{i=1}^k w_i N(\mu_i, \sigma^2).$$ That is, ...
2k views

Estimate information entropy through Monte Carlo sampling

I am looking for methods that allow estimating the information entropy of a distribution when the only practical ways of sampling from that distribution are Monte Carlo methods. My problem is not ...
1k 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 ...
• 593
512 views

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 ...
• 119
443 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, ...
865 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 Corput,...
• 3,135
3k 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 ...
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,...
• 181
183 views

• 61
2k 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 ...
• 2,141
1k 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 (...
• 1,203
96 views

What is the best method to do a MC Integration of a multidimensional integral where the integration limits depend upon other variables?

What is the best method to do a Monte Carlo Integration of a multidimensional integral where the integration limits depend upon other variables? I am interested in getting a numerical value of a 5 ...
• 91
1k views

Monte Carlo simulation of 3D X-Y model

I need to compute the helicity modulus as a function of temperature for a three-dimensional X-Y model (see N.K. Kultanov, Yu.E. Lozovik, "The critical behavior of the 3D X-Y model and its relation ...
• 247
483 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 ...
• 1,029
1k 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 ...
• 255
552 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-...
• 153
89 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 ...
• 51
321 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 ...
117 views

Probability approximation: monte carlo VS sde

I have a probability measure $\mu$ (say, in $\mathbb{R}^{d}$, with density) and I want to approximate it numerically. Today I noticed that my measure is ergotic for a certain Stochastic Differential ...
• 121
281 views

Convergence rate of Monte-Carlo variance estimate

What is the convergence rate for Monte-Carlo variance estimate for a random variable $X \in {L^q}(\Omega ,R),2 < q < 4$?
• 229
443 views

Mean-squared displacement in Monte Carlo studies

Is measuring mean-squared-displacement in Monte Carlo simulations uncommon? I'm very interested to find out if this has actually ever been tried. For instance, in the context of spheres, or ...
• 179
166 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 ...
• 249
499 views

Absence of Discontinuity in Specific Heat Plot Simulated by Ising Model

I am working on 2D Ising model, when I plot "specific heat vs temperature", I can't see any discontinuity at critical temperature around Tc ~ 2.7K. I am enclosing results of all other thermodynamic ...
• 276
231 views

Simple Monte Carlo in C++, result dependent from seed

I implemented as an exercise a program to sample the statistics of the escape time of a Brownian particle in a potential well. I used the Euler-Maruyama method to numerically integrate the ...
179 views

Efficient Quadrature Methods for Indicator Functions?

I am looking to numerically solve many different integrals where the integrand is simply the indicator function for a region (i.e. 1 on the region, 0 outside. This is for measuring areas). The ...
• 12.3k
74 views

How to use a web-embedded model in a computational workflow?

There is a model embedded in a web browser (Caprio 1998) that I would like to use in an MCMC algorithm. What is the best way to do this? I could implement the model in my favorite language but I ...
96 views

Sample Average Approximation vs. Numerical Integration

To calculate the expected value of objective functions, we have two choices: Sample Average Approximation (SAA): $$\frac{1}{N}\sum_{i=1}^N f(x,\xi^i).$$ Numerical Integration (e.g., Monte Carlo ...
• 41
136 views

How to stochastically estimate the trace of a matrix?

Specifically, the diagonal elements (can possibly both positive and negative) of the matrix can be computed efficiently but the total number is large ($\mathcal O(10^{18})$). My first thought about ...
2k views

Use Monte Carlo integration to compute the volume and centre of mass in Python

In particular, I want to focus on finding the volume $V$ because I will need it to start working on solving the centre of mass This $3D$ homogenous body (Torus section) is defined by x^2 + \left(\...
316 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 ...
• 33
I have a problem getting a sensible result for the Mean Square Displacement (MSD) for a simulation of $N$ particles under Brownian dynamics with Lennard-Jones interaction between them with or without ...