生成相关的标准正态(相关系数 )
Generate Correlated
题目详情
已能生成独立的标准正态 。如何生成两个相关系数为 的 随机变量?
LU: For an invertible matrix , with lower-triangular, upper-triangular. Then , solve then
Cholesky: If is symmetric PD, then where is upper-triangular with positive diagonal.
Singular Value Decomposition (SVD): For any matrix , there is a factorization
with orthogonal and diagonal of singular values.
Question: Using a standard normal generator (for ), how to generate two correlated variables with correlation ?
解析
取独立 ,令
则 且 。
Original Explanation
Let be i.i.d. Then define Check var and cov to confirm the correlation is
In higher dimensions for , do a Cholesky factor and set Or use etc.