2
$\begingroup$

This question is about a magic square generator, "relaxed" because

  • it's only about one vector (row) in the square independent of all other rows;
  • the individual elements are continuous and not integral.

Constraints are

$$0 \le i < n, i \in \mathbb{I}, n \in \mathbb{I} $$

$$0 \le v_i \le u_i, v_i \in \mathbb{R}, u_i \in \mathbb{R} $$

$$ \sum_{i=0}^{n-1} v_i = 100 $$

with $\mathbb{I}$ and $\mathbb{R}$ as the set of all integers and the set of all reals respectively. $n$ and $u$ are known and fixed. $v_i$ are the random variables.

I want to define a single random distribution that satisfies the above constraints. Naive uniform distribution up to each known, fixed bound $u_i$ will not satisfy the sum constraint, and something like naive uniform for all but $v_{n-1}$ where that's left as a degree of freedom to satisfy the sum constraint will (a) not produce a uniform distribution for that one variable, and (b) will not always be satisfiable for choices of other $v$.

Ideally I would like to know which random distribution has one unchanging form over all $v$ that is parameterised based on individual $u_i$. Beyond the distribution, it would be nice to hear if there is a typical algorithm for this situation that is statistically sound.

I realise that there are multiple solutions. At the risk of sounding subjective, I would be interested in hearing one or two that are not mathematically complex and that are easy to code for in Python, and that produce means of each $v$ that over several experiments would tend to land between the bounds but not on them.

$\endgroup$
4
  • 1
    $\begingroup$ Please add clarifications as an edit to the post, comments onthis site are often seen by few, and can be deleted $\endgroup$ Commented Mar 9, 2023 at 15:08
  • 2
    $\begingroup$ Although your description is vague, it sounds like $n$ and the $u_i$ are specified fixed numbers and the $v_i$ are the random variables. If not, please clarify. There is a huge number of solutions. The vector $(v_0,\cdots,v_{n-1})$ lies on a simplex. It is a region of dimension $n-1.$ Choose any distribution on the simplex you like. $\endgroup$ Commented Mar 9, 2023 at 15:13
  • $\begingroup$ @whuber correct on all counts; I've edited for clarity. I do not know where to begin when defining distributions on a polytope. $\endgroup$ Commented Mar 9, 2023 at 15:24
  • 1
    $\begingroup$ A standard family of distributions on simplices is the Dirichlet distribution. Whether or not it would be appropriate depends on your application. Perhaps you could explain what you hope the definition of this distribution will accomplish and what you intend it to model. That could help narrow the possibilities. $\endgroup$ Commented Mar 9, 2023 at 17:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.