Optimal Residential Energy Consumption, Prediction, And Analysis