Data and code for "The Inverse Distance Weighted Median
收藏资源简介:
# Data Files Both files in this folder are **generated data**, not primary-source records. See the manuscript's Data Availability Statement and Appendix D for full context; this file summarizes the same information alongside the actual CSVs. ## `income_calibrated.csv` 500 rows, columns `household_id`, `income_pkr`. **This is not the original survey microdata.** The original 2023 socio-economic survey conducted in Sindh, Pakistan (n = 500 households, stratified random sampling) is only available to the author as two summary statistics reported in the source study: mean = 52,300 PKR, median = 37,200 PKR. Raw household-level records were not accessible. To enable genuine, reproducible bootstrap inference (rather than inventing standard errors), a synthetic lognormal sample was calibrated by root-finding so that its mean and median match those two reported values exactly: ``` target median = exp(mu) => mu = ln(37200) target mean = exp(mu + sigma^2/2) => sigma solved via scipy.optimize.brentq ``` Fitted parameters: mu = 10.524, sigma = 0.825. 500 i.i.d. draws were then taken from `LogNormal(mu, sigma)` with the seed documented in `supplementary/code/README_code.md`. All descriptive statistics, histograms, and estimator results reported in Section 7.1 of the manuscript are computed on this file, and are reproducible exactly from `applications.py`. ## `environment_simulated.csv` 300 rows, columns `reading_id`, `pm25_ug_m3`. **Fully synthetic**, disclosed as such throughout the manuscript (Section 7.2). Not a real sensor network. Generated as: - 92% of readings: `Gamma(shape=6, scale=35/6)` (right-skewed, centered near 35 µg/m³, typical of ambient PM2.5-style air-quality readings). - 8% of readings: `Uniform(150, 400)`, simulating faulty-sensor spikes -- a distance-separated contaminating cluster by construction, used to illustrate IDWM's target use case in a second application domain. Generated by `applications.py`; reproducible exactly from the documented seed.



