Generating 2D random matrix with desired features

42 Views Asked by At

I try to generate a random demand matrix (from/to) with several features for my research. The point is that the total amount of demand is in decreasing order for the demand points (1 to N). For any demand point, there would be three cases in which total inbound demand (TIB) may equal to total outbound demand (TOD), TIB may be larger than TOD, and TIB may be smaller than TOD. I would like to generate a matrix for each of these three cases. Suppose that for a 10x10 matrix, additional features should be as follows:

  • For any demand point, the sum of the random number in a row should give 1 (or about 1).
  • For any demand point, the amount of flow which is directed to other demand points should also be in decreasing or non-increasing order, in other words, demand from point 2 to point 3 should be larger than or equal to the demand from point 2 to point 4 and so on.

I do not know much about the statistical issues like correlation, so I do not care for those of issues. The only thing matters for me satisfying the conditions mentioned above and keeping the randomness as much as possible. By the way, I prefer to use VBA (or Excel spreadsheets, if it is sufficient to use for this matter).

Any ideas, suggestions and additional issues I did not consider, will be appreciated so much.