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
-2
votes
1 answer

Monte Carlo Python Question: Simulation of three dice in which the sum > 10, returns True, otherwise return False

This is a Monte Carlo Simulation question. Here is my code. def simulate(): """ Simulate three dice and return true if sum is > 10 """ die_1 = randint(1,6) die_2 = randint(1, 6) die_3 = randint(1,6) sum = die_1 + die_2 +…
roTenshi2
  • 57
  • 6
-2
votes
1 answer

AnyLogic: Monte Carlo Simulation for total delay time in a Discrete Event Simulation

I plan to do a Monte Carlo Simulation, but the introduction on the AnyLogic page does not really help me. I want to vary one parameter via uniform(0,1) and run the model 1000 times and save the results in a excel sheet. My idea was to have a…
DynamiX
  • 63
  • 4
-2
votes
1 answer

How do I generate monteCarlopi function in a given circle/square?

Write a function monteCarloPi(n, radius) that takes two arguments, the number of simulations n and the radius of the circle, and returns a float, which is the estimated value for pi. This radius should be the same radius that you used to draw your…
-2
votes
1 answer

Generating uniform random numbers between two large integers in fortran90/95 or Python

I want to generate some uniform random numbers between [2E16, 5E20] in fortran90/95 or Python. I know that if "R" is a random number between zero and one (0
-2
votes
1 answer

R - Probability of a number on multiple variable number of die

I am trying to write an r script of modeling rolling the top number on a die (in this case a 6) on at least one die for a cumulative set of die (1,2,3,4,5,6 dice) on an arbitrary die (in this case a d6; the code should be easily adjustable to other…
Englishman Bob
  • 377
  • 2
  • 13
-2
votes
1 answer

MatLab regression in Python

I have some Matlab code on using Monte Carlo Simulation and then OLS regression to estimate some coefficients. How is it possible to do this in Python? see screenshot of code, or below Define the true DGP parameters and distributions % Set the…
-2
votes
1 answer

SAS simulate with random variable

Table1 has Col1 and Col2 Table2 is distinct Col1 as Col3 and generated random variable Col4 Simulate a function Col2*2 + Col4 where Col4 is based on Table1.Col1 = Table2.Col3 Col4 is diff for each trial I don't really know how to do this but…
-2
votes
2 answers

Beginner python and montecarlo

I have been having trouble following all the montecarlo tutorials as they are seem to start to advanced for me to follow. I have a few months of python experience. So far I have been unable to find any on the basics. Any tips or links to the…
Drive
  • 1
  • 1
-2
votes
1 answer

Integral approximation python

I saw this formula: http://tutorial.math.lamar.edu/Classes/CalcI/ProofIntProp.aspx#Extras_IntPf_AvgVal and tried to implement python algorithm to approximate integrals. It kinda works, but does not make sense to me, so if any1 can explain why, it…
Peter
  • 59
  • 1
  • 9
-2
votes
1 answer

stuck in use of monte-carlo integration method?

I wanna use monte-carlo integration method, and my code is below. As u can see i determined the interval integration but the result is wrong ! Whats wrong with this code ? any help will be appreciated . #include #include…
Elia
  • 31
  • 5
-2
votes
1 answer

Machine Learning: What is the best algorithm to select best 3 variable combinations?

I have 10 variables as like below V1=1, V2=2, V3=3, V4=4, V5=5, V6=6, V7=7, V8=8, V9=9 and V10=10 Note : Each variable can have any value Now I want to select the best 3 variables combination as like below V1V3V4 or V10V1V7 or V5V3V9 etc. The…
-2
votes
1 answer

What is a real life example of The Las Vegas Algorithm?

I understand the Algorithm but can't seem to find how it's implemented in real life? Anyone have any examples for a better understanding?
TomD
  • 9
  • 1
  • 7
-2
votes
1 answer

How to define an exact number of samples in the Monte Carlo method

I am developing a simulation of the integration of montecarlo (dx) and I find myself wondering which is the best way to determine the exact number of samples (N) in the Monte Carlo method to approximate the solution to a definite integral. This is a…
-2
votes
2 answers

Writing a monte carlo integration program and I don't why im getting certain errors

I am writing a monte carlo program to do a 10D integral. But what I have started off with is trying to get the full method to work in a lower dimension before moving up to the higher level. Anyways I have this program and it is using the the struct…
Robert
  • 153
  • 7
-2
votes
1 answer

MCMC(Markove Chain MOnteCarlo) in python

Could anyone help me about MCMC in python? I want to fit a model with 5 or 6 parameters using this tool(MCMC). I have searched a lot but there are no learning ways to check how to do that! Please some help I use the chi square equation but for 5…
Bob
  • 39
  • 1
  • 10
1 2 3
83
84