Advancing Forecasting in Psychology: A Tutorial and Illustration of a Novel Approach based on LSTM Neural Networks for Analyzing Longitudinal Data

preprint OA: closed CC-BY-4.0
🔓 Open OA copy View at publisher

Abstract

Machine learning has become an integral part of the psychological methods toolbox, particularly excelling in forecasting psychological variables through longitudinal data analysis. This tutorial demonstrates the use of the Long Short-Term Memory (LSTM) neural network, a model recognized for its effectiveness in various research fields. It provides a comprehensive introduction to neural networks, with a step-by-step guide on how to apply LSTM to a psychological forecasting scenario. Using an empirical dataset from clinical psychology, we walk through the process of training the LSTM to predict depression scores over time for multiple individuals. We explain how to prepare the data, configure the LSTM model, and evaluate its performance using metrics such as root mean square error (RMSE) and the determination coefficient (R²). Our results show how the LSTM can learn complex longitudinal relationships, producing predictions that closely follow the actual trajectories for some individuals in the dataset. We also provide fully runnable, annotated code to facilitate easy adoption by psychological researchers. This code helps users implement and customize the LSTM model for their specific forecasting needs, making advanced machine learning techniques accessible and practical for psychological research.

My notes (saved in your browser only)

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2026) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-28T02:00:01.590549+00:00
License: CC-BY-4.0