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
0
votes
0 answers

Class implemenation for Monte Carlo Option Pricing in Python

I'm a math guy trying to self teach myself Python. Through some pointers here, I have this program working (without a class implementation) but being a math guy, my code is ugly. I'd like some help using classes to make it look cleaner. But I think…
DudeWah
  • 359
  • 3
  • 20
0
votes
1 answer

Monte Carlo simulator

I am having trouble creating my own Monte Carlo simulator with python 3... I am trying to predict the future price in the upcoming year. I am still learning how to program in python. My data: Price = np.array([29429,30426,32513,40605,52806,57581])…
Bob
  • 1
  • 1
0
votes
2 answers

For loop in R (Special Case: Wiener Process)

I'm dealing right now with a valuation of Option prices for my university thesis. We need to program some things in R. It's the first time I'm working with a programming software like R. I've been doing this for the last 2 weeks and this is where I…
Monte
  • 1
0
votes
1 answer

How to use the method of Monte Carlo to search for the limit probabilities

I want to understand how to use the method of Monte Carlo to search for the limit probabilities of the some system S. For example: S0 S1 S2 S3 S0 0.1 0.9 0 0 S1 0 0.2 0.3 0.5 S2 0.2 0.1 0.5 0.2 S3 0.5 0 0.4 0.1 As I understand the…
Ev_Hyper
  • 183
  • 8
0
votes
1 answer

Lognormally distributed samples using quasi monte carlo method

I want to generate lognormally distributed random samples using the quasi monte carlo method such as Halton sequence. I want the numbers within a certain bounds. I have the following code in matlab but it gives me numbers which are out of bounds how…
Sagar Masuti
  • 1,271
  • 2
  • 11
  • 30
0
votes
0 answers

Cannot figure out Reduce and Monte Carlo Simulations in R, calculating VaR

Apologies for the title. I could not think of how to title this... (Also, I know this is probably a shite question, but hoping someone out there can help.) I have the following mean vector and covariance matrix: > mu0 MSFT AAPL…
lukehawk
  • 1,423
  • 3
  • 22
  • 48
0
votes
0 answers

Code to calculate volume of hypersphere in n dimensions is consistently inaccurate

I'm trying to calculate the volume of a hypersphere in n dimensions with radius r. I'm using a Monte-Carlo method of generating points in a hypercube and then taking the ratio of points within a sphere embedded inside it (using the idea that a…
user193369
  • 17
  • 4
0
votes
1 answer

Taking out multiple values in VBA

I need to analyse 4 values. However, these 4 values change every time I run the code. I need to run the code 100 times and paste the 4 values in different cells. This is what I have come up with so far: Sub min() Dim i As Integer For i = 1 To 5 …
0
votes
0 answers

Unexpected deviation from absolute value in Monte Carlo N dimensional integration in c++

I have written a code in c++ for Monte Carlo in tegration, which worked fine with my other functions when I used 2 dimensional integration. I generalized the code for N dimensional integration , in this particular case, I am taking n = 10. I am…
bhjghjh
  • 889
  • 3
  • 16
  • 42
0
votes
1 answer

Calculating poker preflop equity efficient

I've read many articles about the Monte Carlo algorithm for approximating the preflop equity in NL holdem poker. Unfortunately, it iterates over only a few possible boards to see what happens. The good thing about this is that you can put in exact…
Bruno Zell
  • 7,761
  • 5
  • 38
  • 46
0
votes
2 answers

Probability from bivariate normal distribution

I am trying to find the probability that P(X̄+0.5 < Ybar) using a bivariate normal distribution. X has a mean of 9 and variance of 3, Y has a mean of 10, and a variance of 5, and their covariance is 2, with a trial of 50 independent measurements.…
Jamie Leigh
  • 359
  • 1
  • 4
  • 18
0
votes
1 answer

What is the concept of "Last Good Reply" and "Rapid Action Value Estimation" in Monte Carlo Simulation?

I have developed a simple hex player based on Monte Carlo Tree Search for the game of Hex. Now I want to extend the hex player using RAVE (Rapid Action Value Estimation) and LGP (last good reply). The articles are here and here. I was wondering if…
0
votes
1 answer

Fitting with monte carlo in python

I use a python package called emcee to fit a function to some data points. The fit looks great, but when I want to plot the value of each parameter at each step I get this: In their example (with a different function and data points) they get…
Silviu
  • 749
  • 3
  • 7
  • 17
0
votes
1 answer

Quasi-monte-carlo underperforms in path simulation of Brownian motion. Julia

I'm looking at using Sobol sequences as a variance reduction technique to speed up a simulation. However, the convergence of the QMC method seems very weak. Does anyone know how or why this is the case? Is the advantage of QMC lost on these high…
pdevar
  • 323
  • 2
  • 3
  • 11
0
votes
1 answer

discrete function by using VBA

I am trying to create Discrete function by using VBA code. It works sometime, but I also received "Subscript of range error" message. Anyone can figure out the reason? Function Discrete6() Dim value As Variant, prob As Variant, i As Integer …