Hostname: page-component-76d6cb85b7-7262s Total loading time: 0 Render date: 2026-07-13T07:42:20.425Z Has data issue: false hasContentIssue false

Estimating Multilevel Models on Data Streams

Published online by Cambridge University Press:  01 January 2025

L. Ippel*
Affiliation:
Maastricht University
M. C. Kaptein
Affiliation:
Tilburg University
J. K. Vermunt
Affiliation:
Tilburg University
*
Correspondence should be made to L. Ippel, Institute of Data Science, Maastricht University, Maastricht, The Netherlands. Email: lianne.ippel@maastrichtuniversity.nl
Rights & Permissions [Opens in a new window]

Abstract

Social scientists are often faced with data that have a nested structure: pupils are nested within schools, employees are nested within companies, or repeated measurements are nested within individuals. Nested data are typically analyzed using multilevel models. However, when data sets are extremely large or when new data continuously augment the data set, estimating multilevel models can be challenging: the current algorithms used to fit multilevel models repeatedly revisit all data points and end up consuming much time and computer memory. This is especially troublesome when predictions are needed in real time and observations keep streaming in. We address this problem by introducing the Streaming Expectation Maximization Approximation (SEMA) algorithm for fitting multilevel models online (or “row-by-row”). In an extensive simulation study, we demonstrate the performance of SEMA compared to traditional methods of fitting multilevel models. Next, SEMA is used to analyze an empirical data stream. The accuracy of SEMA is competitive to current state-of-the-art methods while being orders of magnitude faster.

Information

Type
Original Paper
Creative Commons
Creative Common License - CCCreative Common License - BY
This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
Copyright
Copyright © 2019 The Author(s)
Figure 0

Figure 1. Computational complexity of online versus offline algorithms to compute the sample mean.

Figure 1

Table 1. Average results of the estimates of two of the 15 fixed effects over 1000 simulation runs.

Figure 2

Table 2. Average results of the estimates of the variance of one (condition A) or two (conditions B–D) of the 5 random effects over 1000 simulation runs.

Figure 3

Table 3. Overview of results at the end of the data stream: mean absolute error (MAE), root-mean-squared error (RMSE), and the empirical 95% confidence interval.

Figure 4

Figure 2. Estimated residual variance, the true value is 5. The error bars indicate the 95% empirical interval of the 1000 simulation runs. The ‘×\documentclass[12pt]{minimal}\usepackage{amsmath}\usepackage{wasysym}\usepackage{amsfonts}\usepackage{amssymb}\usepackage{amsbsy}\usepackage{mathrsfs}\usepackage{upgreek}\setlength{\oddsidemargin}{-69pt}\begin{document}$$\times $$\end{document}’ is EM, triangle is SEMA Update, open circle is SEMA, and closed circle is Sliding Window EM.

Figure 5

Figure 3. Estimated residual variance, the true value is 5. The error bars indicate the 95% empirical interval of the 1000 simulation runs. The ‘×\documentclass[12pt]{minimal}\usepackage{amsmath}\usepackage{wasysym}\usepackage{amsfonts}\usepackage{amssymb}\usepackage{amsbsy}\usepackage{mathrsfs}\usepackage{upgreek}\setlength{\oddsidemargin}{-69pt}\begin{document}$$\times $$\end{document}’ is EM, triangle is SEMA Update, open circle is SEMA, and closed circle is Sliding Window EM.

Figure 6

Table 4. Average mean absolute error (MAE) and average root-mean-squared error (RMSE) of the 1000 simulation runs.

Figure 7

Table 5. Fitted model to the smart-scale data stream.

Figure 8

Figure 4. The estimated Monday effect and its standard deviation. The ‘×\documentclass[12pt]{minimal}\usepackage{amsmath}\usepackage{wasysym}\usepackage{amsfonts}\usepackage{amssymb}\usepackage{amsbsy}\usepackage{mathrsfs}\usepackage{upgreek}\setlength{\oddsidemargin}{-69pt}\begin{document}$$\times $$\end{document}’ is EM, triangle is SEMA Update, open circle is SEMA, and closed circle is Sliding Window EM, the most right ‘×\documentclass[12pt]{minimal}\usepackage{amsmath}\usepackage{wasysym}\usepackage{amsfonts}\usepackage{amssymb}\usepackage{amsbsy}\usepackage{mathrsfs}\usepackage{upgreek}\setlength{\oddsidemargin}{-69pt}\begin{document}$$\times $$\end{document}’ is EM using all data and 2000 iterations.

Figure 9

Figure 5. Mean absolute error (MAE), a moving average of 1000 data points, shifting with 500 data points at a time.

Supplementary material: File

Ippel et al. supplementary material

Supplementary Material of Estimating Multilevel Models on Data Streams
Download Ippel et al. supplementary material(File)
File 3.8 MB