Animal behaviourists are interested in the causal factors that determine behavioural sequences: when animals perform particular activities, and under what circumstances they switch to alternative activities. In this chapter, the authors describe a model that incorporates feedbacks, and they apply it in order to model observed feeding patterns of caterpillars. The combined physiological and perceptual state of the animal is termed the 'motivational state'. The application of Hidden Markov models (HMM) to animal behaviour was initially limited to behaviours whose consequences do not readily alter motivational state. The model provides an extension which can allow for the important class of behaviours that are feedback-regulated. Latent-state models, including HMMs, provide a means of grouping two or more behaviours, such as feeding and grooming, into 'activities'. The authors demonstrates the application of the model to data collected in an experiment in which eight caterpillars were observed at 1-minute intervals for almost 19 hours, and classified as feeding or not feeding.