Data-Driven Approaches to Demand Response: Studies on Thermostatically Controlled Loads and Electric Vehicles