Construct a directed, weighted international trade network from Eurostat COMEXT bilateral trade data. Analyze bilateral flows, dependence, concentration, centrality and changes between periods.
G=COMEXT_NETWORK(PRODUCT,MEASURE,START,END,COUNTRY1,COUNTRY2,...)
G=COMEXT_NETWORK(27,VALUE,202501,202512,DE,FR,IT,NL,PL) EXTRACT(G,"alluvial")
| Argument | Meaning |
|---|---|
| PRODUCT | COMEXT CN/HS product code, e.g. 27 for mineral fuels. |
| MEASURE | Trade measure, e.g. VALUE. |
| START, END | Inclusive YYYYMM range, e.g. 202501 and 202512. |
| COUNTRY1,... | Country codes defining both the source and destination nodes, e.g. DE,FR,IT,NL,PL. |
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.
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.
| 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 |
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")
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")
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.
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.
| Measure | Interpretation |
|---|---|
| PageRank | Importance as a destination receiving flows from important sources |
| HHI | Concentration of a source's outgoing flows among destinations |
| Betweenness | Importance on weighted shortest paths, using inverse trade flow as distance |
| Incoming/outgoing strength | Sum 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.
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.