# Matlab multivariate normal distribution parameters (mvnrnd)

I need to use the mvnrnd function in matlab to generate random monthly returns for a set of assets. However, I am a bit confused about how to use this function to do it since it asks me MU and SIGMA values. How should I pick these values ?

-
Parameters of multinormal distribution $\mu$ and $\Sigma$ related to expectation and covariance matrix of the multinormal random vector. Specifically $\mathsf{E}(X_i) = \mu_i$ and $\mathsf{Cov}(X_i,X_j) = \Sigma_{i,j}$. You would choose these parameters depending on the problem you are solving –  Sasha Feb 22 '12 at 13:25

MU and SIGMA are usually estimated from historical data. For example, you can take time series of returns on your asset and compute their sample means (which will be stacked in your MU vector) and their sample covariance matrix (your SIGMA matrix). If the returns to K assets observed over T periods are stored in a KxT matrix R, then the MATLAB commands are:

MU=mean(R)

SIGMA=var(R)

-
I think I understand now but I get negative values when I do like this (which later becomes a problem when I try to find optimal portfolios based on these values) –  Cemre Feb 22 '12 at 13:52
Well, yes. If a security has declined in price over the period you're looking at, you would expect to see negative values for $\mu$. Why is this a problem when finding optimal portfolios? –  Chris Taylor Feb 22 '12 at 18:24