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

MCMC Sampling / Gibbs Sampling

Had a midterm in my Artificial Intelligence class on MCMC sampling (is it the same as Gibbs sampling?). I was looking over the solution which I found online (in my midterm it was called MCMC liklihood weighting sampler, but in the attached solution…
0
votes
1 answer

Matlab unique function

I'm struggling with determining the probability of occurrence of unique elements in thresh_strain matrix (which can be seen below as a 100 x 16). I was trying to use the code at the bottom to do this, but I get an equal probability of occurrence…
Jojo
  • 1,117
  • 2
  • 15
  • 28
0
votes
1 answer

Switch-statement issue (Matlab)

I have to run a large number of iterations (10^6) for a particular function which calls several other functions. One of the functions it calls which has a switch case statement as there are two parts to the code. I obviously don't want the prompt to…
Jojo
  • 1,117
  • 2
  • 15
  • 28
0
votes
3 answers

How to structure an easily extensible Monte Carlo model in R

I have a simple model for a company with two farms, growing two crops (apples and pears) on each farm. The first step is just to multiply the number of trees by the amount of fruit on each tree. The amount of fruit on each tree is simulated (across…
Racing Tadpole
  • 4,270
  • 6
  • 37
  • 56
0
votes
1 answer

Create a cluster with random number

I am coding to simulate the growth of a sphere in a solution environment. I am doing in this way. Create of space and put a cell in the center as a seed. pSpace = new char[nXRange * nYRange * nZRange]; for (int i = 0; i < nZRange; i++) for (int j…
HXGuo
  • 45
  • 1
  • 1
  • 6
0
votes
0 answers

Calculating Variance of Monte Carlo Estimate

I want to estimate the variance of R_LW, this is the ratio of the mean square error (MSE) of the estimator LW to the standard OLS estimator (R stands for ratio). Each MSE is calculated over 5000 sims to give one R_LW. I want to know what the…
Bazman
  • 2,058
  • 9
  • 45
  • 65
0
votes
0 answers

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. Which is then estimated using a number of…
Bazman
  • 2,058
  • 9
  • 45
  • 65
0
votes
1 answer

Monte-Carlo localization for mobile-robot

I'm implementing Monte-Carlo localization for my robot that is given a map of the enviroment and its starting location and orientation. My approach is as follows: Uniformly create 500 particles around the given position Then at each step: motion…
Andrei Ivanov
  • 651
  • 1
  • 9
  • 23
0
votes
0 answers

Matlab: generating a monte carlo sample from a defined model

I am trying to generate a Monte Carlo sample of the following model: y=20/sqrt(x1)*10^((x2-x3)/20)*x4*10^((x5-x6)/20). In Matlab, am using the following code to generate a random sample of N size for the k variables. The input variables are…
0
votes
3 answers

Calculating mean of sample in monte carlo simulation

I did a Monte Carlo simulation of n samples. For each sample i, I need to calculate the value Xi so probably, the results that I will obtain is: X = [X1, X2, ..., Xn] (Here Xi can be a matrix or number). Now I want to calculate the mean of theses…
user2863620
  • 635
  • 3
  • 10
  • 17
0
votes
1 answer

Distributing particles over a volume starting from a couple of density functions

Essentially, what i want to do is set up the initial conditions for an n-body simulation of a galaxy. The paper i tried to go by is found here http://arxiv.org/abs/1204.0513 . The paper describes two density functions: a surface density function of…
andrei
  • 339
  • 3
  • 12
0
votes
1 answer

Generating random reals uniformly using Boost

I am trying to generate some uniform real numbers for a Monte Carlo integration but the routine I build was returning some really strange values. Upon closer inspection I notices that Boost was returning some crazy looking random numbers e.g.: …
JMzance
  • 1,704
  • 4
  • 30
  • 49
0
votes
0 answers

MC algorithm for a non-conjugate model

The model is Poisson likelihood and Gaussian prior. I worked out the posterior for the model and I think that I have it coded correctly but I'm having a lot of trouble trying to implement the algorithm. I know that it's just a simple matter of not…
0
votes
0 answers

how can i get the while loop to terminate when all matrix values are <0 and create a vector based on each iteration? in python 3

***I have edited the infect function and included a vaccinate function which both run and produce new matrices. However, for i==n and j==m, the infect function says that it is improperly indexed and it wont write to the right and bottom boundary of…
0
votes
2 answers

Monte Carlo Simulation in matlab for finding mean and variance

A robot Randomly searches a target. at each time step it makes the decision of going straight, left or right with a probability of 0.8,0.1,0.1 with a constant speed. I have defined random variables(two dimensonal) to all of the 7 outcomes for 2…
happyme
  • 233
  • 2
  • 5
  • 16