Behaviors and cognitions arise from an interplay between neural activity driven by external stimuli and internal activity patterns or “brain states” that reflect motivation, intention, and experience. Historically, neuroscience research has focused almost exclusively on stimulus-driven activity, ignoring the impact of internal state. Clearly, to develop robust computational theories of cognitive function and to understand how computations may fail in psychiatric disease, we must develop a new neuroscience that measures and models both externally and internally generated neural activity and seeks to reveal the interactions between them. On the data side, we must be able to detect transitions between internal states and analyze stimulus-evoked responses within the context of the state in which they occur. On the theory side, we must develop models for how internal states are generated, changed during behavior, and affect sensory responses. These are the goals of my research.