Aube.Tuesday, 24 November 2026Support us

Aube.

News of progress
Single source

Free software cuts one trade model's memory from 897 MB to under 1 MB

Languages for this article
Original · ENDEESFRITPT

Originally written in English. 6 languages available; yours is one click away.

Generated illustration for “Free software cuts one trade model's memory from 897 MB to under 1 MB”
AI-generated illustration — artist’s view, not documentary

“If a model needs more memory than your computer has, waiting longer will not solve the problem. You simply cannot run it.” Mauricio Vargas Sepulveda, a PhD researcher in economics at the University of Surrey, describes the wall that stops many trade analyses. His answer is a free package, Capybara 2.0, which in the largest benchmark of his study used less than 1 megabyte of memory, where the conventional base R approach needed approximately 897 megabytes. The tests ran on a standard Lenovo laptop.

Trade models ask how exports move between countries while accounting for differences between exporters, importers and trading partners. As those comparisons become more detailed, conventional calculations can exhaust the computer’s available memory. Capybara handles those differences without building the large tables of extra variables that conventional methods need, and it couples its memory-saving calculations with safeguards against misleading statistical estimates.

The study, a preprint posted on SSRN, compared Capybara with base R and with two specialist statistical packages, Fixest and Alpaca, using international trade models. Each test was repeated 100 times. In the largest benchmark, which contained 6,006 observations covering 1994 to 2006, Fixest needed approximately 6 megabytes and Alpaca 54 megabytes, so Capybara’s footprint was smaller than both. Speed is another matter: the study reports competitive performance, but the release gives no timings. The first Capybara paper, published in the journal PLOS ONE in September 2025, reported 1.6 seconds and 42 MB against 700 seconds and 12,261 MB for Base R, and noted that fixest may be faster in some cases.

The new version also flags cases where a model cannot yield valid finite estimates, which helps avoid distorted results. A second feature lets researchers look at patterns toward the lower and upper ends of trade flows, not only at the average. The memory figures, the study notes, apply to the one model tested, not to every possible use.

For a researcher with a modest machine, the change is practical and immediate: a model that could not be completed can be run on a laptop, and the software is already free to download. The documentation and the code needed to reproduce the analysis are available with it, so other economists can inspect the methods and apply them to their own data. “Reducing that demand can make the difference between being able to answer an economic question and having to leave it unanswered,” Vargas Sepulveda said.

less than 1 megabyteMemory on the largest trade benchmark, versus about 897 MB with base R (one model, laptop)

Sources — read the originals(Paris time)

Tech XploreEN

Pages consulted while writing

0000

Read next

Comments

Loading the thread…

Sign in to leave a comment. Sign in