calculation of weights and value at risk of portfolio