Financial Risk Modelling and Portfolio Optimization with R