Brasil em Órbita: an index of how much a Brazilian municipality depends on others

statistics
data
public sector
opensource
More than four thousand Brazilian municipalities live in orbit of another city for hospitals, higher education and banking, and many depend on federal transfers more than on their own economy. The Municipal Dependency Index (IDM) joins urban function, fiscal dependence and services for 5,513 municipalities from open federal data, stays descriptive by design, and can be reproduced with one command.
Author

Pedro Carvalho Brom

Published

August 24, 2026

Code repositorypcbrom/indice-dependencia-municipal

If you grew up in a small Brazilian town, you know the drive. The hospital with an intensive care unit, the university and the bank branch are in another city, 30, 50 or 80 kilometres away, and that other city is where much of the town’s life actually happens. You may also have heard that the town hall spends more than the town produces. Both facts are in official data. They just live in different databases, and nobody had put them on the same page.

That is the gap behind Brasil em Órbita, the Municipal Dependency Index (IDM), which I built with Daniel Soares de Souza. It is an interactive observatory at idm.pcbrom.com that classifies every Brazilian municipality by its role in the urban network, crosses that role with fiscal dependence and with the concentration of services, and condenses the three into one index. Code, derived data and method documentation are open at github.com/pcbrom/indice-dependencia-municipal, archived on Zenodo under DOI 10.5281/zenodo.21431702. Every figure below comes from that documentation and from the published artifacts, as of version 0.2.3.

This post expands a LinkedIn post of 24 August 2026: linkedin.com/feed/update/urn:li:activity:7497738273272795136.

Two questions, three axes

The project starts from two plain questions about any municipality. Where does its life happen, meaning which city is its pole and what it consumes outside its own borders? And who pays for its town hall, meaning how much it depends on transfers rather than on its own economy?

The urban side comes from the IBGE study of the regions of influence of cities, REGIC 2018 (IBGE, 2020). Metropolises, regional capitals, sub-regional centres and zone centres add up to about 862 cities with real centrality. The remaining municipalities, more than four thousand of them, are local centres whose population depends on another city for medium and high complexity health care, higher education, banking and notary services. The IDM turns that hierarchy into three layers. A pole organizes flows and attracts people from outside, a semi-pole has intermediate centrality, and an orbiting municipality is a local centre whose economic life happens elsewhere. Each orbiting municipality is linked to its destination pole, a link that REGIC itself provides.

The fiscal side comes from the National Treasury (FINBRA and Siconfi) and from IBGE’s municipal GDP. Services come from the national registry of health establishments (CNES, DATASUS) and from the higher education census (INEP). All of them are joined on one key only, the seven-digit IBGE municipality code, never on names.

The index, written down

Every variable is normalized by its percentile rank among the N municipalities with valid data, with ties averaged.

r(x_i) = \frac{\operatorname{rank}(x_i) - 1}{N - 1} \in [0, 1]

The specification prefers the percentile rank to min-max scaling because it is less sensitive to extreme values, which are common in fiscal ratios. The orbit axis is O_i = r(d_i), where d_i is the distance in kilometres to the destination pole, zero for poles and semi-poles that do not orbit. That distance is not computed. It is read from the dist_km column of the REGIC links table, taking, among the links with a declared connection, the one with the smallest distance. A reimplementation that used straight-line or road distance would produce a different vector and therefore a different index.

The fiscal axis averages two ranks, the share of the Municipal Participation Fund (FPM) in total revenue and the ratio of total revenue to municipal GDP, a ratio that can exceed 1 when the town hall moves more money than the town produces.

F_i = \tfrac{1}{2}\left[\, r\!\left(f^{(1)}_i\right) + r\!\left(f^{(2)}_i\right) \right]

The services axis inverts self-sufficiency. With h_i and s_i indicating the presence of a hospital and of a higher education institution, S_i = 1 - (h_i + s_i)/2, so absence raises the index. The three axes enter with equal, declared weights.

\text{IDM}_i = \tfrac{1}{3} O_i + \tfrac{1}{3} F_i + \tfrac{1}{3} S_i

A high IDM marks a more dependent, more orbiting municipality, and a low one marks a self-sufficient pole. No axis is imputed. Municipalities without valid fiscal or GDP data leave the universe, which is why the index covers 5,513 of 5,570 municipalities, 98.98% of the country. The data vintages are asymmetric and declared as such, REGIC 2018, GDP 2023 and fiscal year 2024, a slow-moving urban hierarchy against a recent fiscal picture.

Checking the index against itself and against the world

Before publication the pipeline records its own checks, and the published validacao.json keeps them. The Spearman correlation between the IDM and the logarithm of population is −0.69. The specification set a rule in advance that above 0.8 in absolute value the ranking would be stratified by population size as the primary reading, to avoid measuring population twice, and the observed value stays below that line. The axes are not redundant. Orbit and fiscal dependence are close to uncorrelated (−0.09), orbit and services correlate at −0.29, and fiscal dependence and services correlate at 0.49, partially overlapping. Two kinds of control cases can be checked directly against the official sources, the 20 municipalities whose revenue exceeds their GDP and the 5,124 orbiting-to-pole links of REGIC.

The external check uses the 2010 Municipal Human Development Index (IDHM) as a development reference. The raw Spearman correlation with the IDM is −0.41 (95% interval −0.43 to −0.39), and controlling for the logarithm of population it is −0.48. By axis, the association concentrates in fiscal dependence (−0.52), while the services axis sits near zero (−0.10). These numbers are reported as descriptive association and never as an effect.

Descriptive on purpose

The easiest way to misuse an index like this is to read it as a grade for the mayor. The project’s decision on causality rules that out. The IDM measures structural position, not management quality. The documentation recalls that the transfer system designed by the 1988 Constitution makes small towns depend more on the FPM by design of the law. Comparisons are always made against municipalities of the same size, never against the national average, and the fiscal screen carries a fixed caption saying that it describes the size of the local economy, not the quality of the town hall. Money is never drawn as an arrow on the map either, because a transfer from the Union has no geographic origin, and an arrow of money flowing into a town with little revenue of its own reads as an accusation the data do not support.

The same discipline applies to the automatic reading the panel writes for each municipality. A deterministic harness computes every comparison, and the language model only places symbols that are then replaced by the canonical values, a design measured in another post.

The worked example, what merging towns would do

The most sensitive part of the panel is the tab called Brasil em Cenários, about municipal reorganization, and it starts from plain arithmetic of the current rule. As the project documentation describes the rules of the National Treasury and the Federal Court of Accounts (TCU), the FPM coefficient depends only on population, by band, with a floor of 0.6. Merge two municipalities that both sit in the lowest band and their combined coefficient falls from 1.2 to 0.6, so the merged town receives about half of what the two received together. As populations cross bands, the loss goes from half to zero. Cooperating without merging preserves the transfer. The transfer, in other words, rewards fragmentation.

The panel then runs a national aggregation exercise. REGIC partitions the country into 1,443 functional regions, an anchor plus the municipalities that orbit it, and 751 of those regions would actually aggregate more than one municipality. If every orbiting municipality were merged into its anchor under the current rule, BRL 115.5 billion a year of FPM, at 2024 values, would be redistributed among the remaining municipalities of each state. That is not a saving for the Union, because the pool of each state is fixed. The population-weighted mean IDM would fall from 0.29 to 0.23, and 423 of the 751 aggregating anchors have a consolidated service centre, with an intensive care unit, an in-person higher education course and a bank branch.

On the spending side, municipalities spend BRL 156.3 billion a year on the legislative and administration functions. The potential saving of the merger scenario lies between BRL 9.0 billion and BRL 52.8 billion a year. The floor is the cost of the city councils that would be suppressed, a deterministic number. The ceiling adds the administration of the absorbed municipalities, and since part of that administration is permanent work (tax collection, planning, procurement, staff management), the real figure sits below the ceiling. Even the ceiling is well below the FPM that would change hands, and the floor is an order of magnitude below it. The international evidence the project cites supports the reading that amalgamation rarely delivers the promised savings (BLOM-HANSEN et al., 2016), and a study of fifteen years of municipal consolidation found no reduction in spending (ALLERS; GEERTSEMA, 2016).

So the tab is built to keep the speculative from borrowing the authority of the measured. Measured, deterministic and speculative numbers sit in separate visual layers. The net effect of a consortium is never shown as a point, only as a band that crosses zero, because its sign depends on parameters that have not been calibrated against Brazilian data. Groupings must be contiguous and within one state. The whole exercise describes the incentive built into the transfer rule and does not recommend merging or cooperating.

Reproduce it before you believe it

A number about public money deserves to be checked by someone other than its authors. The repository is built for that. With Docker installed, docker compose up --build runs the formula tests, recomputes the IDM of the 5,513 municipalities with the published code, stops on any difference from the published value and then serves the full panel locally. The verification log shown in the documentation reports 21 tests passed and a largest absolute difference of 0.00e+00. Without Docker, three commands with uv do the same recomputation, and the same example recomputes the index with alternative weights or within a single state. For a reimplementation from scratch, the formal specification is in docs/IDM_SPEC.md.

Which brings the question back to your own town. Do you know which city it orbits, how far away that city is, and how much of every real the town hall spends comes from its own economy? The panel answers the first two in a click, and the third against towns of the same size, which is the only comparison that is fair to it.


Dataset and code. BROM, P. C.; SOUZA, D. S. de. Brasil em Órbita: Índice de Dependência Municipal (IDM). Version 0.2.3. Zenodo, 2026. DOI: 10.5281/zenodo.21431702. Code under MIT licence, derived data and documentation under CC BY 4.0. Panel: https://idm.pcbrom.com.

References.

ALLERS, M. A.; GEERTSEMA, J. B. The effects of local government amalgamation on public spending, taxation, and service levels: evidence from 15 years of municipal consolidation. Journal of Regional Science, v. 56, n. 4, p. 659-682, 2016. DOI: 10.1111/jors.12268.

BLOM-HANSEN, J.; HOULBERG, K.; SERRITZLEW, S.; TREISMAN, D. Jurisdiction size and local government policy expenditure: assessing the effect of municipal amalgamation. American Political Science Review, v. 110, n. 4, p. 812-831, 2016. DOI: 10.1017/S0003055416000320.

IBGE. Regiões de Influência das Cidades: 2018. Rio de Janeiro: IBGE, 2020.

The panel is at idm.pcbrom.com and the source is open on GitHub: github.com/pcbrom/indice-dependencia-municipal. I write about this kind of work, scientific method, statistics, and AI applied with rigor, on LinkedIn: linkedin.com/in/pcbrom.