

Introduction to Monte Carlo Methods - alexhwoods
http://alexhwoods.com/2015/07/25/introduction-to-monte-carlo-methods/

======
tunesmith
I used a basic Monte Carlo technique to help buy a new house. We wanted to
know what maximum price we could look at for the new house. But we didn't know
how much cash I'd clear from the old house to sell, how much cash my wife
would be able to contribute, what interest rate we'd lock at for the new
house, etc. But, I could reasonably estimate a normal distribution that each
of those scenarios would fall in, even if those distributions were pretty wide
(to be conservative). Then I just made a row in excel that picked a random
value from each, and calculated the maximum price we could afford for the new
house in that case, and then I dragged that row down 10,000 times, and then we
looked at what price we could afford in 95% of those cases. It helped our
confidence a lot in knowing what we could definitely afford.

------
yummyfajitas
The error most likely didn't stop converging - its just that n^{-1/2} is a
very slow convergence rate.

If you want actual control of the error, and to know how many samples you
need, you need to do some arithmetic with the central limit theorem or
hoeffdings inequality.

~~~
alexhwoods
Ya I didn't mean it literally. Thank you for reading!

------
learnstats2
One potential source of confusion is that "Monte Carlo method" and "Monte
Carlo algorithm" are not the same.

[https://en.wikipedia.org/wiki/Monte_Carlo_method](https://en.wikipedia.org/wiki/Monte_Carlo_method)
described here - any method using random numbers to generate data -
increasingly useful in many fields.

[https://en.wikipedia.org/wiki/Monte_Carlo_algorithm](https://en.wikipedia.org/wiki/Monte_Carlo_algorithm)
any algorithm with a chance of giving an incorrect result - most often
associated with testing for prime numbers.

------
lindig
> We then assess the distance d between a car and the car in front of it. If
> the car’s velocity is greater than or equal to the distance, we adjust it’s
> velocity to _d-1_.

I found this a little confusing as velocity and distance seem to have the same
units. Or did you mean to write _v-1_?

~~~
alexhwoods
Good question! Each iteration of the model occurs for one unit of time.
Because of this, we can directly compare distance and velocity.

Like if velocity was meters per second, and distance was meters, since the
velocity update occurs for one second, we can compare the two.

I'll clarify in the post, this confused me too when I first started reading
about the model.

~~~
lindig
If you adjust the velocity to _v-1_ it would be an incremental update, which
seems natural. But if you update the velocity to _d-1_ (as stated) I can
imagine this could be a jump and even could result in negative velocity for
_d=0_.

------
vvanders
Also great for performance profiling when you don't have fancy tools. Just
breaking 5-10 times to see where you land can provide some useful results(to
be verified of course).

------
mindcrime
I'm a big fan of Monte Carlo simulations, and highly encourage their use. But
is important to remember that there are a few cases where a Monte Carlo model
(or, as far as that goes, any simulation probably) can be pretty off, perhaps
to the point of being useless, or even misleading in a damaging way:

Off-hand, I can think of two big ones:

1\. Missing variables. Of course this doesn't matter if you're only working
with one variable, like estimating the value of pi. But if you have a multi-
variable model, and your model is missing one or more variables that affect -
in real life - the thing you're trying to simulate, then the model may be less
than worthless. This is why it's so crucial to be sure that you've identified
all the variables. Unfortunately, for complex real-world scenarios, that's
often very difficult.

2\. If the model (rather, the output from the model) itself affects the real-
world domain you're simulating.

That said, MC is a very powerful and useful technique and it's worthy of being
in everyone's tool-belt.

~~~
danieltillett
Aren’t these problems for every model?

~~~
mindcrime
> (or, as far as that goes, any simulation probably)

Yeah, truly. I think of this stuff first and foremost in the context of MC
models, as that's what I have the most experience with.

