Problems of Dynamic Optimization under Risky Factors