Questions tagged [montecarlo]

Monte Carlo methods are stochastic (probabilistic) systems that use many random samples to derive properties of a complex system.

Monte Carlo methods are stochastic methods that use large sample sizes to gather information about a complex system. The outcomes of these trials can then be used to draw generalizations about the system as a whole, without first needing a proper solution.

Monte Carlo methods are especially useful when a numeric solution is available, but which is too complex to solve for directly. They are general enough that their use is widespread; Wikipedia provides a list too exhaustive to reproduce here.

1260 questions
9
votes
2 answers

Difference between C++ random number generation and Python

I am trying to translate some python code to C++. What the code does is to run a monte carlo simulation. I thought the results from Python and C++ could be very close, but seems something funny happened. Here is what I do in Python: self.__length =…
ChangeMyName
  • 7,018
  • 14
  • 56
  • 93
9
votes
2 answers

What are the differences between Monte Carlo and Markov chains techniques?

I want to develop RISK board game, which will include an AI for computer players. Moreovor, I read two articles, this and this, about it, and I realised that I must learn about Monte Carlo simulation and Markov chains techniques. And I thought that…
quartaela
  • 2,579
  • 16
  • 63
  • 99
9
votes
3 answers

Monte Carlo Method in Python

I've been attempting to use Python to create a script that lets me generate large numbers of points for use in the Monte Carlo method to calculate an estimate to Pi. The script I have so far is this: import math import random random.seed() n =…
Matt Johnson
  • 91
  • 1
  • 1
  • 2
9
votes
2 answers

How to use multicores in OCaml to do Monte Carlo simulations?

OCaml process can use just one core and in order to use multiple cores I have to run several processes. Are there any OCaml frameworks to use to parallelize Monte Carlo simulations?
Alfa07
  • 3,314
  • 3
  • 26
  • 39
9
votes
5 answers

C# Mersenne Twister random integer generator implementation (SFMT) monte carlo simulation

So far I've been using the C# Mersenne Twister found here to generate random numbers: http://www.centerspace.net/resources.php I just discovered SFMT which is supposed to be twice as fast…
m3ntat
  • 3,635
  • 11
  • 38
  • 50
8
votes
1 answer

Randomizing network using pymc in Python

There are two columns in the dataset, user_id, and site_name respectively. It records every site name that every user browsed. toy_dict = {'site_name': {0: u'\u4eac\u4e1c\u7f51\u4e0a\u5546\u57ce', 1: u'\u963f\u91cc\u4e91', 2:…
Swimming
  • 91
  • 4
8
votes
8 answers

Where can I learn more about "ant colony" optimizations?

I've been reading things here and there for a while now about using an "ant colony" model as a heuristic approach to optimizing various types of algorithms. However, I have yet to find an article or book that discusses ant colony optimizations in…
MattK
  • 10,195
  • 1
  • 32
  • 41
8
votes
2 answers

Monte Carlo Tree Search: Tree Policy for two player games

I am a little confused about how the MCTS "Tree Policy" is implemented. Every paper or article I read talks about going down the tree from the current game state(in MCTS teminology: the root for the player about to make a move). My question is how…
CS101
  • 444
  • 1
  • 6
  • 21
8
votes
1 answer

Making a custom probability distribution to draw random samples from in SciPy

I'm looking to sum up an arbitrary number of probabilistic distributions of things using a montecarlo type simulation. I'd like to randomly sample continuous distributions of something and add them to other random samples of other continuous…
Alex S
  • 4,726
  • 7
  • 39
  • 67
8
votes
4 answers

Python Uniform distribution of points on 4 dimensional sphere

I need a uniform distribution of points on a 4 dimensional sphere. I know this is not as trivial as picking 3 angles and using polar coordinates. In 3 dimensions I use from random import random u=random() costheta = 2*u -1 #for distribution between…
8
votes
3 answers

Ant colony optimization using .NET

I'm looking for a .NET-Class library or .NET-Framework which implements ant colony optimization. Can you give me any links, resources, etc. about this topic.
AndreyAkinshin
  • 18,603
  • 29
  • 96
  • 155
8
votes
4 answers

C# Monte Carlo Incremental Risk Calculation optimisation, random numbers, parallel execution

My current task is to optimise a Monte Carlo Simulation that calculates Capital Adequacy figures by region for a set of Obligors. It is running about 10 x too slow for where it will need to be in production and number or daily runs required.…
m3ntat
  • 3,635
  • 11
  • 38
  • 50
7
votes
3 answers

Testing the quality of PRNGs

I am playing around with PRNGs (like Mersenne Twister and rand() function of stdlib) and I would want a good test that would help me ascertain the quality of random data produced by the PRNGs. I have calculated the value of Pi using random numbers…
Sayan
  • 2,662
  • 10
  • 41
  • 56
7
votes
3 answers

Algorithm for computing the plausibility of a function / Monte Carlo Method

I am writing a program that attempts to duplicate the algorithm discussed at the beginning of this article, http://www-stat.stanford.edu/~cgates/PERSI/papers/MCMCRev.pdf F is a function from char to char. Assume that Pl(f) is a 'plausibility'…
Sean Thoman
  • 7,429
  • 6
  • 56
  • 103
7
votes
1 answer

How to use Monte Carlo for ARIMA Simulation Function in R

Here is the algorithm of what I want to do with R: Simulate 10 time series data set from ARIMA model through arima.sim() function Split the series into sub-series of possible 2s, 3s, 4s, 5s, 6s, 7s, 8s, and 9s. For each size take a resample the…
Daniel James
  • 1,381
  • 1
  • 10
  • 28
1 2
3
83 84