def loss(weights): return -portfolio(returns, weights)[0]
def loss(weights): return portfolio(returns, weights)[1] ** 2