COMEXT_NETWORK

Construct a directed, weighted international trade network from Eurostat COMEXT bilateral trade data. Analyze bilateral flows, dependence, concentration, centrality and changes between periods.

Syntax

G=COMEXT_NETWORK(PRODUCT,MEASURE,START,END,COUNTRY1,COUNTRY2,...)
G=COMEXT_NETWORK(27,VALUE,202501,202512,DE,FR,IT,NL,PL)
EXTRACT(G,"alluvial")
ArgumentMeaning
PRODUCTCOMEXT CN/HS product code, e.g. 27 for mineral fuels.
MEASURETrade measure, e.g. VALUE.
START, ENDInclusive YYYYMM range, e.g. 202501 and 202512.
COUNTRY1,...Country codes defining both the source and destination nodes, e.g. DE,FR,IT,NL,PL.

How the network is constructed

The command returns a GraphMatrixOperator with a square adjacency matrix and the original monthly bilateral series. Rows are exporters/sources; columns are importers/destinations. Each directed edge is based on the destination country's reported COMEXT imports from the source country. The diagonal is zero.

Tij = reported imports of destination j from source i

The current snapshot matrix takes the last finite observation in the requested period. Thus a January–December 2025 request ordinarily represents December 2025, not the sum of all months. The original monthly observations remain available through the series extracts.

Extracts

EXTRACT(G, ...)Returns
"matrix"Labeled adjacency matrix
"alluvial"Exporter-to-importer ribbon chart, allowing reciprocal flows
"dependence" / "import_dependence"Column-normalized import dependence matrix
"export_dependence" / "normalized"Row-normalized export destination shares
"pagerank"Weighted PageRank
"eigenvector"Regularized incoming eigenvector centrality
"betweenness"Weighted directed betweenness centrality
"hhi"Concentration of outgoing flows
"in_strength" / "out_strength"Total incoming / outgoing flow within the network
"series"DataListOperator of original bilateral series
"edge:NL:DE"Original Netherlands → Germany time series
"outgoing:NL"All outgoing series from the Netherlands
"incoming:DE"All incoming series to Germany
"timeseries"Historical flow charts by source country
"slideshow"Network overview, alluvial chart, matrices, centrality and historical flows

Measuring dependence

Import dependence

Dij = Tij / Σk Tkj

Column normalization: the share of destination j's imports from the selected countries supplied by source i. Each positive-inflow column sums to one.

EXTRACT(G,"dependence")

Export destination dependence

Eij = Tij / Σk Tik

Row normalization: the share of source i's exports sent to destination j among selected destinations. Each positive-outflow row sums to one.

EXTRACT(G,"export_dependence")
Interpretation: These shares describe dependence within the selected network, not a country's share of all worldwide energy imports, domestic energy consumption, or physical supply.

Compare 2021 and 2025

Build networks with identical product, measure and country ordering. Compare the latest observations in the two requested periods:

G2021=COMEXT_NETWORK(27,VALUE,202101,202112,DE,FR,IT,NL,PL)
G2025=COMEXT_NETWORK(27,VALUE,202501,202512,DE,FR,IT,NL,PL)
D2021=EXTRACT(G2021,"dependence")
D2025=EXTRACT(G2025,"dependence")
CHANGE=100*(D2025-D2021)
CHANGE

The change is expressed in percentage points. Positive entries indicate an increased share from that exporter among the selected suppliers. This script assumes the installed matrix evaluator supports subtraction and scalar multiplication.

Graph the original monthly series

G=COMEXT_NETWORK(27,VALUE,202501,202512,DE,FR,IT,NL,PL)
A=EXTRACT(G,"edge:NL:DE")
LINE_CHART(A)
EXTRACT(G,"timeseries")
EXTRACT(G,"outgoing:NL")

The original time series are retained independently of the snapshot matrix. The alluvial diagram uses distinct exporter and importer columns, so both NL → DE and DE → NL can appear without a circular Sankey path.

Interpreting network measures

MeasureInterpretation
PageRankImportance as a destination receiving flows from important sources
HHIConcentration of a source's outgoing flows among destinations
BetweennessImportance on weighted shortest paths, using inverse trade flow as distance
Incoming/outgoing strengthSum of bilateral flows within the selected network

Centrality is a mathematical property of the constructed network; it does not by itself establish causal economic dependency or input-output multipliers.

Data notes

Source: Eurostat COMEXT CN/HS merchandise trade series. The matrix uses destination-reported IMPORT observations. Confirm source units and reporting conventions before interpreting amounts. Missing or delayed observations may cause the latest finite value to precede the requested end month. Product definitions and country coverage should be held consistent across comparisons.

For N countries, the command may request N(N−1) bilateral series. Larger networks can require substantial data retrieval.

Related commands: COMEXT, EXTRACT, LINE_CHART, SLIDESHOW.