Dynamic Asset Allocation: a Portfolio Decomposition Formula and Applications