Chronic pain is a common symptom of many long-term health conditions and is a key cause of years lived with disability. However, pain severity is variable and seemingly unpredictable. People with chronic pain report that pain variability creates feelings of uncertainty and impacts daily living. Being able to forecast future pain offers the opportunity to support people living with chronic pain in reducing this pain-related uncertainty. In this thesis, I aim to forecast pain severity using data from a mobile health study. The specific objectives are to (1) conduct work with patients to identify the desired outcome of a forecast, (2) to conduct cluster analysis of pain severity data to understand common pain patterns, (3) to explore pain variability on an individual level within each cluster, and (4) to forecast movement between clusters. To prioritise the outcomes of a pain forecast, I conducted a focus group and a survey (Chapter 3). People with chronic pain reported that a pain forecast could be used in planning daily tasks and social events. They prioritised outcomes related to pain flares and fluctuations in pain severity. However, concerns remained around data protection, and anxiety about predicted pain. To understand common patterns of pain severity, I conducted a cluster analysis of weekly pain trajectories (Chapter 4) and examined transitions between clusters in consecutive weeks. This study reported four clusters representing no/low pain, mild pain, moderate pain, and severe pain. It also showed that two thirds of consecutive weeks were assigned to the same cluster, with movement often to neighbouring clusters. Substantial within-cluster variability remained. This variability was quantified and associated factors were identified (Chapter 5). Trajectories within the no/low pain cluster were more likely to be stable (no day-to-day fluctuations) than in other clusters. When fluctuations were observed, they were often one-unit (of a possible 4), in all clusters. Fluctuations were associated with pain interference, fatigue, mood, morning stiffness, and participant wellbeing. To forecast pain, a model was developed for between-cluster movement on consecutive weeks (Chapter 6). Using an elastic net penalty term and different groups of candidate predictors, optimal models for each originating cluster were identified. Common predictors were measures of pain severity, pain interference, morning stiffness, fatigue, dewpoint temperature, and the number of pain conditions. Future work to forecast pain could explore different outcome measures (e.g., pain variability), use different measures of daily data (e.g., from wearable devices), and examine individual-level models.