Generate value of $\Bbb R^n$ in convex shape with given distribution

57 Views Asked by At

I have a question, partly from computer science but mostly from math, I guess.

Denote $S$ to be a convex shape of $\Bbb R^n$ which is obtained by truncating predefined $n$-dimensional cube with (finite number of) hyperplanes (planes of dimension $n-1$). Another words, each hyperplane is defined by inequality $\lambda_1x_1 + \ldots + \lambda_nx_n + c \le 0$ that trims cube, where $\lambda_1, \ldots, \lambda_n, c \in \Bbb R$ - constants.

More than that, let us have a value distribution for each axis, i.e. $\forall i = \overline{1,n} \;\; F_i: \Bbb R \rightarrow [0, 1]$.

The question is: how to efficiently generate a random tuple $(x_1, \ldots, x_n)$ from convex shape $S$ with given axis distributions $F_i$? (Programmatically, with certain accuracy of floating point.)

Perhaps some parts of this question are classical objectives from the science, but I don't rather know where to start searching and solving this one. Sure to be open to any ideas.

Edit: it is nice to get the answer at least for the case of even distribution.

1

There are 1 best solutions below

0
On

I got an idea, but I don't know whether it really works.

  1. Simplexize cube into $n$-simplexes.
  2. Iteratively by each hyperplane cut all simplexes with it. If any simplex divides, then trimmed shape is either simplex or shape that can be split into simplexes.
  3. Assume we (somehow) have a probability measure function $\mu: S \supseteq X \rightarrow [0, 1]$ and we know (somehow) how to calculate probability measure of any simplex.
  4. Given resulted set of simplexes, firstly we calculate measure for every simplex.
  5. Chose a simplex from the set by the given probability distribution as discrete distribution on the set of simplexes.
  6. Given selected simplex, we can take any vertex and iteratively by its adjacent $n$ simplex edges make the following:
    $\qquad$ a) Chose edge from remaining set;
    $\qquad$ b) Create a function $f: x \mapsto [0, 1]$ which calculates measure of simplex dimension $n-i$ $(i=\overline{1,n})$, where $x$ is a fixed point of the current selected edge (i.e. we reduces to the case of simplex with dimension less by one, fixing a point of one edge);
    $\qquad$ c) Chose a point on the edge by the given probability function $f$, then go to the case (a).
  7. When iterations in (7) complete, we have $n$ values which are related to coordinates, but in system of simplex edges. Translating the system into standard coordinate system gives us required random point.

This method (if correct and I didn't miss anything) is pretty nice and with preprocessing metadata allows to generate tuples in time $O(k(n)n)$, where $O(k(n))$ is time for calculating measure of a simplex of dimension $n$. But the Achilles' heels are:

  1. I don't even know how to calculate probability measure for simplexes;
  2. The very large number of simplexes, not mention the increasing after splitting with hyperplanes. It influences on preprocessing time and memory, think cases started from $n\ge10$ are too rough.

What do you think about this method? May be any better ideas?