Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 3 new columns ({'J', 'T', 'n_obs'}) and 7 missing columns ({'sigma_med', 'omega_cov', 'sigma_true', 'omega_med', 'med_fstat', 'omega_true', 'sigma_cov'}).

This happened while the csv dataset builder was generating data using

hf://datasets/impex-machina/trade-elasticities/validation/liml_validation_tier1b.csv (at revision f1916c5e65c9132b5f34a6b7cce336cd4dc21b24), [/tmp/hf-datasets-cache/medium/datasets/54484477455688-config-parquet-and-info-impex-machina-trade-elast-749d5e68/hub/datasets--impex-machina--trade-elasticities/snapshots/f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/liml_validation_tier1a.csv (origin=hf://datasets/impex-machina/trade-elasticities@f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/liml_validation_tier1a.csv), /tmp/hf-datasets-cache/medium/datasets/54484477455688-config-parquet-and-info-impex-machina-trade-elast-749d5e68/hub/datasets--impex-machina--trade-elasticities/snapshots/f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/liml_validation_tier1b.csv (origin=hf://datasets/impex-machina/trade-elasticities@f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/liml_validation_tier1b.csv), /tmp/hf-datasets-cache/medium/datasets/54484477455688-config-parquet-and-info-impex-machina-trade-elast-749d5e68/hub/datasets--impex-machina--trade-elasticities/snapshots/f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/se_calibration_mc_per_param.csv (origin=hf://datasets/impex-machina/trade-elasticities@f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/se_calibration_mc_per_param.csv), /tmp/hf-datasets-cache/medium/datasets/54484477455688-config-parquet-and-info-impex-machina-trade-elast-749d5e68/hub/datasets--impex-machina--trade-elasticities/snapshots/f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/se_calibration_mc_summary.csv (origin=hf://datasets/impex-machina/trade-elasticities@f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/se_calibration_mc_summary.csv)]

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1800, in _prepare_split_single
                  writer.write_table(table)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 765, in write_table
                  self._write_table(pa_table, writer_batch_size=writer_batch_size)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 773, in _write_table
                  pa_table = table_cast(pa_table, self._schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2321, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2249, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              J: int64
              T: int64
              n_obs: int64
              sigma_bias: double
              omega_bias: double
              success_rate: double
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 931
              to
              {'sigma_true': Value('int64'), 'omega_true': Value('float64'), 'success_rate': Value('float64'), 'sigma_med': Value('float64'), 'sigma_bias': Value('float64'), 'omega_med': Value('float64'), 'omega_bias': Value('float64'), 'sigma_cov': Value('float64'), 'omega_cov': Value('float64'), 'med_fstat': Value('float64')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1347, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 980, in convert_to_parquet
                  builder.download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 882, in download_and_prepare
                  self._download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 943, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1646, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1802, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 3 new columns ({'J', 'T', 'n_obs'}) and 7 missing columns ({'sigma_med', 'omega_cov', 'sigma_true', 'omega_med', 'med_fstat', 'omega_true', 'sigma_cov'}).
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/impex-machina/trade-elasticities/validation/liml_validation_tier1b.csv (at revision f1916c5e65c9132b5f34a6b7cce336cd4dc21b24), [/tmp/hf-datasets-cache/medium/datasets/54484477455688-config-parquet-and-info-impex-machina-trade-elast-749d5e68/hub/datasets--impex-machina--trade-elasticities/snapshots/f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/liml_validation_tier1a.csv (origin=hf://datasets/impex-machina/trade-elasticities@f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/liml_validation_tier1a.csv), /tmp/hf-datasets-cache/medium/datasets/54484477455688-config-parquet-and-info-impex-machina-trade-elast-749d5e68/hub/datasets--impex-machina--trade-elasticities/snapshots/f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/liml_validation_tier1b.csv (origin=hf://datasets/impex-machina/trade-elasticities@f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/liml_validation_tier1b.csv), /tmp/hf-datasets-cache/medium/datasets/54484477455688-config-parquet-and-info-impex-machina-trade-elast-749d5e68/hub/datasets--impex-machina--trade-elasticities/snapshots/f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/se_calibration_mc_per_param.csv (origin=hf://datasets/impex-machina/trade-elasticities@f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/se_calibration_mc_per_param.csv), /tmp/hf-datasets-cache/medium/datasets/54484477455688-config-parquet-and-info-impex-machina-trade-elast-749d5e68/hub/datasets--impex-machina--trade-elasticities/snapshots/f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/se_calibration_mc_summary.csv (origin=hf://datasets/impex-machina/trade-elasticities@f1916c5e65c9132b5f34a6b7cce336cd4dc21b24/validation/se_calibration_mc_summary.csv)]
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

sigma_true
int64
omega_true
float64
success_rate
float64
sigma_med
float64
sigma_bias
float64
omega_med
float64
omega_bias
float64
sigma_cov
float64
omega_cov
float64
med_fstat
float64
2
0.3
0.375
2.425192
0.212596
0.322124
0.073747
0.826667
0.96
11.402228
2
1
0.355
1.851557
-0.074221
0.137045
-0.862955
0.830986
0.943662
11.223189
2
3
0.385
1.484804
-0.257598
0.0001
-0.999967
0.805195
0.883117
11.576378
3
0.3
0.305
3.211673
0.070558
0.365313
0.217711
0.803279
0.983607
11.101091
3
1
0.36
2.54623
-0.151257
0.309946
-0.690054
0.777778
0.861111
11.662312
3
3
0.375
1.59789
-0.46737
0.0001
-0.999967
0.68
0.84
11.410508
5
0.3
0.325
4.151677
-0.169665
0.174471
-0.418428
0.707692
0.876923
9.369715
5
1
0.4
3.046694
-0.390661
0.243258
-0.756742
0.625
0.8125
10.6546
5
3
0.43
1.831476
-0.633705
0.0001
-0.999967
0.604651
0.813953
10.650667
8
0.3
0.32
5.703767
-0.287029
0.157139
-0.476203
0.609375
0.84127
9.934189
8
1
0.39
3.227009
-0.596624
0.335654
-0.664346
0.512821
0.692308
10.514899
8
3
0.58
2.011567
-0.748554
0.091379
-0.96954
0.508621
0.784483
10.823541
null
null
0.39
null
-0.221417
null
-0.384579
null
null
null
null
null
0.44
null
-0.046908
null
-0.542278
null
null
null
null
null
0.47
null
-0.17494
null
-0.581223
null
null
null
null
null
0.5
null
-0.020515
null
-0.789926
null
null
null
null
null
0.32
null
-0.034285
null
-0.543191
null
null
null
null
null
0.32
null
-0.182807
null
-0.487096
null
null
null
null
null
0.31
null
-0.322375
null
-0.670591
null
null
null
null
null
0.3
null
-0.359874
null
-0.809848
null
null
null
null
null
0.26
null
-0.374603
null
-0.913877
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null

Trade Elasticities — BACI HS92 V202601

Importer-product-exporter trade elasticity estimates: heterogeneous import-demand (sigma) and export-supply (gamma) elasticities estimated from CEPII BACI bilateral trade data, following Soderbery (2018) and Grant & Soderbery (2024).

This dataset holds the published outputs of the estimation pipeline. The code that produces them, full methodology, and replication instructions live in the GitHub repository:

https://github.com/impex-machina/trade-elasticities

License

Data in this dataset: CC BY 4.0. The pipeline code (in the GitHub repo) is licensed separately under MIT.

What's here

Outputs are organized by pillar. The authoritative index — including SHA-256 checksums and provenance — is data/manifest.csv in the GitHub repo; the table below mirrors its human-readable view.

Path Pillar Description
stage1/baci_hs92_v202601_elast_country_hs4_feenstra_sigma.rds 1 Stage 1 sigma estimates (HLIML primary, Step 2 fallback)
stage2a/baci_hs92_v202601_elast_regional_hs4_fixed_sigma.rds 1 Stage 2a regional gamma with fixed sigma
stage2b/baci_hs92_v202601_elast_country_hs4_fixed_sigma.rds 1 Stage 2b country-level gamma with shrinkage + SE
stage2b/..._fixed_sigma_summary.rds / .txt 1 Country-pair summary table (binary + human-readable)
validation/liml_validation_tier1a.csv 2 Synthetic recovery: Tier 1a sigma grid
validation/liml_validation_tier1b.csv 2 Synthetic recovery: Tier 1b sample-size convergence
validation/se_calibration_mc_summary.csv 3 SE calibration Monte Carlo (4 regimes x 3 formulas)
validation/se_calibration_mc_per_param.csv 3 Per-parameter calibration detail

The three pillars: (1) the BACI HS4 empirical core, (2) synthetic recovery of the estimator, (3) standard-error calibration. See the repo's docs/methodology/ for details.

Raw BACI data is NOT here

The raw CEPII BACI HS92 V202601 trade data is not redistributed in this dataset (it is CEPII's to distribute, and it is large). Download it directly from CEPII:

https://www.cepii.fr/CEPII/en/bdd_modele/bdd_modele_item.asp?id=37

Place it under data/raw/ in your clone of the repo. The pipeline reads it from there.

Loading the outputs in R

The recommended path is to clone the GitHub repo and use the bundled loader, which reads the manifest and verifies checksums:

# from the repo root, after renv::restore()
source("R/load_outputs.R")
load_outputs()                       # downloads all manifested files to data/derived/
x <- readRDS("data/derived/stage2b/baci_hs92_v202601_elast_country_hs4_fixed_sigma.rds")
head(x)

To pull a single file directly from this dataset without the repo:

url <- paste0("https://huggingface.co/datasets/impex-machina/",
              "trade-elasticities/resolve/main/",
              "stage2b/baci_hs92_v202601_elast_country_hs4_fixed_sigma.rds")
tmp <- tempfile(fileext = ".rds")
download.file(url, tmp, mode = "wb")
x <- readRDS(tmp)
head(x)

Citation

If you use these data, please cite the paper (DOI to be added on publication) and the underlying sources:

  • Soderbery, A. (2018). Trade elasticities, heterogeneity, and optimal tariffs. Journal of International Economics, 114, 44-62.
  • Grant, M. & Soderbery, A. (2024). Heteroskedastic supply and demand estimation: Analysis and testing. Journal of International Economics, 150, 1-23. https://doi.org/10.1016/j.jinteco.2023.103817
  • CEPII BACI World Trade Database, HS92 V202601.
Downloads last month
53