When we optimize a portfolio, we don't have the real covariance matrix and the expected return vector (that are the inputs of the mean-variance model); we use observations to estimate them, so
r, and the output of the model are also random variables.
Without going into the details, we can say that this leads to surprisingly great uncertainty in the model. In spite of the strong law of large numbers, optimal portfolio weights sometimes vary between . Fortunately, if we have a few years' data (daily returns), the relative error of the measured risk is only 20-25 %.