The Analysis of Structured Securities: Precise Risk Measurement and Capital Allocation