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

Read the full article See related articles

Discuss this preprint

Start a discussion What are Sciety discussions?

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

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.

Article activity feed