An online learning approach to dynamic pricing for demand response