Back to Community
Lecture 30: CAPM and APT, efficiency frontier optimization

Hi all.
I have trouble understanding the following points in the above section of the above lecture:
1) I can't understand the reason for this:

    # Creating a list of returns to optimize the risk for  
    mus = [100**(5.0 * t/N - 1.0) for t in range(N)]  
    # Convert to cvxopt matrices  
    S = opt.matrix(np.cov(returns))  
    pbar = opt.matrix(np.mean(returns, axis=1))  
    .  
    .  
    .  
    #other code  
    .  
    .  
    portfolios = [solvers.qp(mu*S, -pbar, G, h, A, b)['x']  
                  for mu in mus]  

I'm baffled about this mu*S part while leaving pbar the same... How does that optimization produce weights that are relevant to our return series'? It seems like we are optimizing for a completely different returns set... Yet it does fit some portfolio that does exist as seen in the plot.
In summary: If we take the weights calculated by these optimizations and multiply our returns matrix by them, do we get the same mean and std? (mathematical derivations will be appreciated)

2) Why are all of std/returns portfolios bound inside this parabolic (or close to parabolic...) domain? I haven't done the math, do the constraints make it so that the highest return for a given risk is its square root?
Thanks!