1

As far as I understand the Monte Carlo methods from a non-rigourous point of view because unfortunately I didn't study mathematics formally.

For example to find a minimum value of a function $f(x)$ in a given interval $[a,b]$:

  • Generate $N$ uniform random numbers in the interval $a\le x_i\lt b\,$ for $i=1, \cdots N$ .
  • Evaluate $f(x_i)$ for $i=1, \cdots N$.
  • The minimum value, $m$, of $f(x)$ in the given interval is: $m= \text{min}(f(x_1),f(x_2), \cdots, f(x_N))$.

For $N$ sufficiently large we get the approximate value of $m$. if we fix $N$ and run the algorithm $n$ times the values $m_k$ tend to follow a normal distribution for $k = 1, \cdots, n$

But in the following example I get only half of the normal distribution $$f(x) = (x-3)^2+5$$ in the interval $[1, 8]$, with $N=1000$ and $n=10000$ I get something like this: histogram of m

Could you tell me mathematically which cases we do not get normal distribution of $m_k$ values but only the half normal distribution as shown in the histogram above? (By the halves, I mean the the two parts of the histogram/normal distribution graph symmetric about the mean value.

Edit: Please notice that $n \neq N$. $N$ is the number of random numbers while $n$ is the number of times running the algorithm for a fixed $N$.

Thank you

copper.hat
  • 172,524
  • Broadly, Monte Carlo methods are for estimating the value of expectations. It is not clear how this would be adapted to find a $\min$, nor why $m$ would have a normal distribution. Clearly all values must be $\ge$ the actual $\min$. – copper.hat Jan 22 '19 at 17:19
  • The distribution will depend on the shape of $f$. – user121049 Jan 22 '19 at 17:55
  • @copper.hat Why it is not clear? it's clear that it gives the minimum if the appropriate interval $[a,b]$ is chosen. – IamNotaMathematician Jan 22 '19 at 18:48
  • @user121049 Could you give more details? could you explain why I do get that shape of distribution for the given example? – IamNotaMathematician Jan 22 '19 at 18:49
  • 1
    It is nothing to do with Monte Carlo. You are just looking at the distribution of $\min_{k\le N} x_k$. Why would you expect this to be normal? – copper.hat Jan 22 '19 at 18:55
  • @copper.hat In my question $N$ and $n$ are different things. – IamNotaMathematician Jan 22 '19 at 18:57
  • Why bother with randomness? You are just evaluating the function at many points you hope fill the interval densely and taking the minimum value. You can do that by evaluating at $N$ equally spaced points. – Ethan Bolker Jan 22 '19 at 19:01
  • I understand that $n$ and $N$ are different things, I still don't know why you expect a normal distribution. There is no average here. The function $\min$ places a hard bound on the distribution of the sample $\min$. – copper.hat Jan 22 '19 at 19:04
  • @copper.hat Yes but you wrote $\text{min}{k\le {\color{red} N}}x_k$ instead of $\text{min}{k\le {\color{green}n}}x_k$ – IamNotaMathematician Jan 22 '19 at 19:07
  • @copper.hat: in other Monte carlo methods for example for integral calculation, $I=\int_a^b f(x) dx $, the $I_k$ for $k=1,\cdots, n$ (n is the number of times running the algorithm for fixed $N$) tends to be a normal distribution about the mean. – IamNotaMathematician Jan 22 '19 at 19:12
  • I meant $\min_{k \le N} f(x_k)$. You have fixed $N$ above and are running the experiment $n$ times. It makes no sense to take the average of the results, as the $\min$ of the experiments is clearly a better estimate of the result you are looking for. – copper.hat Jan 22 '19 at 19:12
  • You are not computing ${1 \over N} (m_1+\cdots+m_n)$, I presume (hope). – copper.hat Jan 22 '19 at 19:13
  • @IamNotaMathematician Your question asks for the minimum on a one dimensional interval .... In high dimensions there are montecarlo numerical methods but they don't just sprinkle points. See https://en.wikipedia.org/wiki/Markov_chain_Monte_Carlo (although this is not simply finding a minimum). – Ethan Bolker Jan 22 '19 at 19:14
  • @copper.hat: Yes, I use $N$ only to choose how many random numbers to generate for my vectors, then I am intersted on the behaviour of the obtained result with $n$ (number of experiments) – IamNotaMathematician Jan 22 '19 at 19:16
  • @EthanBolker: In fact I am dealing with multi-variables function $f(x)$, In my question I introduced only a one dimensional function just to be as simple as possible and to avoid the high level abstraction that might follow in the discussion – IamNotaMathematician Jan 22 '19 at 19:29
  • Sorry, I meant to write $\bar{m}={1 \over n} (m_1+...+m_n)$. It does not make sense to use Monte Carlo here, you are not computing an expectation. If you are using $\bar{m}$ then you can expect it to have some normal characteristics in a limiting distribution. But it makes no sense to do this really. $\min(m_1,...,m_n)$ is a much better estimate. – copper.hat Jan 22 '19 at 19:30
  • You may be asking an xy problem. Consider deleting this question and asking about what you really want to do or know. https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem – Ethan Bolker Jan 22 '19 at 19:35
  • @copper.hat: from wikipedia Another powerful and very popular application for random numbers in numerical simulation is in numerical optimization. The problem is to minimize (or maximize) functions of some vector that often has a large number of dimensions – IamNotaMathematician Jan 22 '19 at 19:53
  • What is from Wikipedia? – copper.hat Jan 22 '19 at 19:54
  • @copper.hat In short, I know that using random number for calculating the min value of a function would be the best estimate but I am looking for a mathemical rigourous way. In other MC method I use that fact (the normal distribution) to ensure that the obtained result is what I am looking for, but in the case of optimisation cases( min/max) we can see a half distribution how can I prove that mathematically otherwise could you disprove it? – IamNotaMathematician Jan 22 '19 at 20:00
  • We are going in circles here. Please read the following. Monte Carlo is used for estimating expectations and, in general, you can expect the result to follow (in the limit) a normal distribution in the sense that the average will be roughly distributed normally with some expectation $\mu$ and and variance ${1 \over n} \sigma^2$. To apply Monte Carlo to your situation, you need some expectation, and $\bar{m}$ (as in my 2nd last comment) is a typical one, and you can expect that for large $n$ that the distribution will approximate a normal one with expectation $E[\min_{k \le N} f(x_k)]$ and... – copper.hat Jan 22 '19 at 20:12
  • the corresponding variance divided by $n^2$. Note that the expectation is usually greater than the $\min$ value, so the Monte Carlo method will not converge to the correct result. – copper.hat Jan 22 '19 at 20:14
  • @copper.hat what is expectation? – IamNotaMathematician Jan 22 '19 at 20:14
  • @copper.hat In my histogram the value is tending to 5. Why it follows some distribution behaviour – IamNotaMathematician Jan 22 '19 at 20:16
  • It is difficult to address this question without some mathematical formality, and expectation is a usual term for average. I am not sure how to help you. Monte Carlo is an inappropriate approach that will not even give the correct answer. If you are asking about the distribution of $\min_{k \le N} f(x_k)$ then that is a different question, and there is no reason to expect that the distribution will be normal or symmetric. In fact, it is highly likely to be asymmetric because the values must be $\ge $ the $\min$. Look at https://math.stackexchange.com/q/786392/27978, for an example. – copper.hat Jan 22 '19 at 20:21
  • @copper.hat I am not saying it must be symmetric, I want a mathematical foundation to prove that in min/max problems when I follow the appoach in my question I should always get the same histogram shown in my figure. – IamNotaMathematician Jan 22 '19 at 20:24
  • @copper.hat Here is my conjecture, I want you to prove/disprove it: In optimisation problems (min/max) using random numbers, the sequence $m_k$ for $k=1,\cdots,n$ where $n$ is the number of experiments tends to something like half normal distribution (see the figure). – IamNotaMathematician Jan 22 '19 at 20:29
  • The distribution depends on the distribution of $f(X)$. Since $P[\min_{k \le N} f(X_k) \le \alpha ] = 1 - P[\min_{k \le N} f(X_k) > \alpha] = 1-P[f(X_1) > \alpha]^n = 1-(1-P[f(X_1) \le \alpha])^n$, the distribution of the $\min$ can be computed in terms of the distribution of $f(X)$. In general, the distribution will not be half a normal distribution. – copper.hat Jan 22 '19 at 21:22
  • @copper.hat why in your notation you are using $k\le N$ ? while $k = 1,\cdots, n$ in other words $k$ has nothing to do with $N$ – IamNotaMathematician Jan 22 '19 at 21:26
  • People make mistakes sometimes. The $n$ should be $N$. Since this is the theoretical distribution, the $n$ is not relevant. – copper.hat Jan 22 '19 at 21:30
  • @copper.hat I think I am misunderstanding the MC, is the algorithm that I described is actullay a Monte Carlo method? because first I saw this here – IamNotaMathematician Jan 22 '19 at 21:30
  • I have only so much time to spend on a question, I have a day job :-). – copper.hat Jan 22 '19 at 21:31
  • @copper.hat Thank you very much for your time I appreciate it – IamNotaMathematician Jan 22 '19 at 21:32

1 Answers1

1

This is not Monte Carlo, you do not compute any expectation. What you are doing is throwing darts randomly and hoping you will get (close to) the minimum. Let us assume that you are ok with finding a point that yields something within a threshold of the minimum. Now let the set corresponding to anything below this threshold have 'volume' $V$, and let the domain in which you throw your (uniformly distributed) samples have 'volume' $M$. Then the probability that a sample will fall within that threshold is $V/M$. You can compute how many samples (on average) you need before the first success which is the expectation of the geometric distribution, in this case $M/V$.

lightxbulb
  • 2,047