This thesis models consumer behavior in electricity markets from both a theoretical and practical perspective. The main underlying theme of this thesis is residential demand response, which is enabled by the development of smart grid technologies and the subsequent collection of large amounts of data. The work in this thesis touches on themes at the intersection of machine learning, economics, and game theory.In the first part of this thesis, we seek to analyze the interaction between different players in the modern smart grid. Topics discussed include the incentivization of residential users to elicit their private information, how peer effects affect residential energy consumption, as well as hedging strategies against quantity and price risks in the electric market. To support these expositions with even more fundamental analyses, a framework for budget-constrained and combinatorial multi-armed bandits is introduced. The motivation behind including this rather generic topic lies in the sequential and repetitive nature of interactions between different players in the smart grid, which - under certain assumptions - could be captured with this methodology.The second part of this thesis is concerned with the estimation of a residential Demand Response program carried out by OhmConnect, Inc. during a 14-month period. To evaluate the effects of monetary (and non-monetary) incentives on the reduction in electricity consumption, we first develop a short-term load forecasting method and compare various estimators. The estimation accuracy is further improved by incorporating mixtures of Gaussians and Hidden Markov Models into the estimators under consideration. Next, we develop a two-stage estimation framework to estimate individual treatment effects of Demand Response and compare the aggregated effect, namely the Average Treatment Effect, to the outcome of a randomized controlled trial. The ability to estimate individual treatment effects allows us to design an adaptive targeting framework, which seeks to maximize cost efficiency of this program. Lastly, the effect of moral suasion (non-monetary incentives) that only appeal to the environmental consciousness of users is explored.