A Framework for Remaining Useful Life Prediction and Optimization for Complex Engineering Systems