Abstract: We develop an analytical solution to the dynamic portfolio choice problem of an investor with power utility defined over wealth at a finite horizon who faces an investment opportunity set with time-varying risk premia, real interest rates and inflation. The variation in investment opportunities is captured by a flexible vector autoregressive parameterization, which readily accommodates a large number of assets and state variables. We find that the optimal dynamic portfolio strategy is an affine function of the vector of state variables describing investment opportunities, with coefficients that are a function of the investment horizon. We apply our method to the optimal portfolio choice problem of an investor who can choose between value and growth stock portfolios, and among these equity portfolios plus bills and bonds. For equity-only investors, the optimal mean allocation of short-horizon investors is heavily tilted away from growth stocks regardless of their risk aversion. However, the mean allocation to growth stocks increases dramatically with the investment horizon, implying that growth is less risky than value at long horizons for equity-only investors. By contrast, long-horizon conservative investors who have access to bills and bonds do not hold equities in their portfolio. These investors are concerned with interest rate risk, and empirically growth stocks are not particularly good hedges for bond returns. We also explore the welfare implications of adopting the optimal dynamic rebalancing strategy vis a vis other intuitive, but suboptimal, portfolio choice schemes and find significant welfare gains for all long-horizon investors.