Let ${\bf X}=(X_1,...,X_n)$ be an $n$-dimensional log-normal random variable.
I want to $force$ my random variables to be such that $Cov(X_i,X_j)=\Sigma_{i,j}$ and $E(X_i)=\mu_i$ where $\Sigma_{i,j}$ and $\mu_i$ are given for $i,j=1,...,n$.
I assume that the matrix $\bf \Sigma$ is symmetric and positive definite.
I want to generate the random variables using $${\bf X}=(e^{Y_1},...,e^{Y_n})$$ where ${\bf Y}=({Y_1},...,{Y_n})\sim N(\tilde{\bf\mu},\tilde{\bf \Sigma}) $
- How do we find $\tilde{\bf\mu},\tilde{\bf \Sigma}$
- Are we guaranteed to find valid $\tilde{\bf\mu},\tilde{\bf \Sigma}$ ?
I tried to solve (numerically in R) the following equations for $\tilde{\bf\mu},\tilde{\bf \Sigma}$
$Cov(X_i,X_i)=\Sigma_{ij}=\mu_i\mu_j(e^{\tilde{\Sigma}_{ij}}-1) $
$E(X_i)=\mu_i=e^{\tilde{\mu_i}+\tilde{\Sigma}_{ii}/2}$
using
- $\tilde{\Sigma}_{ij}=\ln(\frac{{\Sigma}_{ij}}{\mu_j\mu_i}+1)$
- $\tilde{\mu}_i=\ln(\mu_i)-\tilde{\Sigma}_{ii}/2$
The resulting matrix $\bf \tilde{\Sigma}$ was not positive definite. Is it my code that is buggy ? or am I trying to solve something that is not possible?
Thanks.