将分布x i表示为一些独立基分布f j的线性组合:x i = a i1 f 1 + a i2 f 2 + ...。让我们将f j约束为均匀分布在 0..1 或 {0,1}(离散)中的自变量。现在让我们用矩阵形式表达我们所知道的一切:
Let X be the vector (x1, x2, .., xn)
Let A be the matrix (a_ij) of dimension (k,n) (n rows, k columns)
Let F be the vector (f1, f2, .., fk)
Let P be the vector (p1, p2, .., pn)
Let R be the matrix (E[x_i,x_j]) for i,j=1..n
Definition of the X distribution: X = A * F
Constraint on the mean of individual X variables: P = A * (1 ..k times.. 1)
Correlation constraint: AT*A = 3R or 2R in the discrete case (because E[x_i x_j] =
E[(a_i1*f_1 + a_i2*f_2 + ...)*(a_j1*f_1 + a_j2*f_2 + ...)] =
E[sum over p,q: a_ip*f_p*a_jq*f_q] = (since for p/=q holds E[f_p*f_q]=0)
E[sum over p: a_ip*a_jp*f_p^2] =
sum over p: a_ip*a_jp*E[f_p^2] = (since E[f_p^2] = 1/3 or 1/2 for the discrete case)
sum over p: 1/3 or 1/2*a_ip*a_jp
And the vector consisting of those sums over p: a_ip*a_jp is precisely AT*A.
现在你需要解两个方程:
AT*A = 3R (or 2R in the discrete case)
A*(1...1) = P
第一个方程的解对应于求矩阵 3R 或 2R 的平方根。参见例如http://en.wikipedia.org/wiki/Cholesky_factorization和一般http://en.wikipedia.org/wiki/Square_root_of_a_matrix。第二个也应该做点什么:)
我请周围的数学家纠正我,因为我很可能将 AT A 与 A AT 混为一谈,或者做错了什么。
要将x i的值生成为基分布的线性混合,请使用两步过程:1) 使用均匀随机变量选择一个基分布,以相应的概率加权,2) 使用选择的基础分布。