Research Question

This report tests one spatial hypothesis:

Dynamic Demand Augmentation Hypothesis. OD-derived dynamic demand components and functional corridor exposure add explanatory power beyond static residential demand in grid-discretised active service-premise intensity models, with fixed-theta negative-binomial fits used as the main overdispersion-sensitive comparison.

The hypothesis is tested descriptively, not causally. The observed point pattern is the location of active service premises. The line pattern is a set of high-flow OD desire-line corridors derived from hourly MITMS mobility flows. The main statistical comparison is between static population-income intensity, dynamic OD intensity, dynamic OD plus corridor exposure, and a full static plus dynamic plus corridor specification.

The report also maps two diagnostic surfaces derived from the same pipeline:

Statistical Test Design

The empirical object is a marked spatial point pattern of active service premises inside each municipal window. The line object is a set of high-flow OD desire-line corridors. The report separates five statistical questions:

Statistical test design and null hypotheses
block null methods
First-order intensity Premise intensity is homogeneous or independent of the tested covariate. kernel intensity/bandwidth sensitivity; quadrat tests; rhohat; Berman Z1/Z2; KS, Cramer-von Mises and Anderson-Darling CDF tests
Point-line corridor distance Active premises are no closer to top-10 percent corridors than benchmark random points in the same city window. Monte Carlo point-line distance tests against uniform grid area-weighted and static-demand-weighted grid benchmarks with the same number of points as the observed test sample
Grid-discretised intensity models The reduced intensity model is sufficient; added static/dynamic/corridor covariates do not improve fit. 500m grid-cell Poisson counts and fixed-theta negative-binomial counts with log-area offset, optional full spatstat ppm models, AIC/BIC, likelihood-ratio tests, Wald-style coefficient diagnostics and residual maps
Second-order functions The point pattern follows CSR or the stated inhomogeneous Poisson intensity with no residual second-order dependence. K, L, pair-correlation, F, G and J functions; default global envelopes and MAD/DCLF tests for K/L/F; optional extended G/J envelopes; Clark-Evans and Hopkins-Skellam nearest-neighbour tests
Marked pattern diagnostics Sector marks are randomly labelled over fixed locations, or sector-specific subpatterns are independent. grid sector relative-concentration surfaces, segregation, nearest-neighbour mark tables/correlation, marked Poisson LR tests, cross K/L/pcf/G/J functions

All K/L/F/G/J results are interpreted as spatial association diagnostics. They do not identify causal interaction or spending behaviour.

Data Used

The analysis uses official Madrid and Barcelona premise data, official municipal boundaries, INE ADRH 2023 income, INE Censo 2024 population, and MITMS/spanishoddata OD data for one complete Monday-Sunday week.

Geometry validity and projection audit
city layer n_features epsg n_empty_geometry n_invalid_geometry n_inside_boundary n_duplicate_point_coordinates note
madrid municipal_boundary 1 25830 0 0 NA NA Geometry validity and projection audit before point-pattern interpretation
madrid active_premises 106136 25830 0 0 106136 12300 Geometry validity and projection audit before point-pattern interpretation
madrid corridors_top10 168 25830 0 0 NA NA Geometry validity and projection audit before point-pattern interpretation
madrid grid_500m 3003 25830 0 0 NA NA Geometry validity and projection audit before point-pattern interpretation
barcelona municipal_boundary 1 25831 0 0 NA NA Geometry validity and projection audit before point-pattern interpretation
barcelona active_premises 61875 25831 0 0 61875 2935 Geometry validity and projection audit before point-pattern interpretation
barcelona corridors_top10 36 25831 0 0 NA NA Geometry validity and projection audit before point-pattern interpretation
barcelona grid_500m 586 25831 0 0 NA NA Geometry validity and projection audit before point-pattern interpretation

The OD analysis week is:

## 2024-10-07 to 2024-10-13

Premise Point Patterns

Premises are harmonised into common city, status and sector fields. The point-pattern analysis uses active premises as the main pattern and keeps sector marks for marked diagnostics.

Premise counts by city, harmonised sector and status. Percentages state the denominator used in the adjacent total column
city sector_group status_group n total_city_premises pct_city_premises total_city_status pct_within_status total_city_sector pct_within_sector
madrid culture_leisure active 3264 152473 2.1% 106136 3.1% 3645 89.5%
madrid culture_leisure closed_or_inactive 334 152473 0.2% 33811 1.0% 3645 9.2%
madrid culture_leisure unknown 31 152473 0.0% 9911 0.3% 3645 0.9%
madrid culture_leisure vacant_or_without_activity 16 152473 0.0% 2615 0.6% 3645 0.4%
madrid health active 4962 152473 3.3% 106136 4.7% 5297 93.7%
madrid health closed_or_inactive 255 152473 0.2% 33811 0.8% 5297 4.8%
madrid health unknown 53 152473 0.0% 9911 0.5% 5297 1.0%
madrid health vacant_or_without_activity 27 152473 0.0% 2615 1.0% 5297 0.5%
madrid hospitality active 20275 152473 13.3% 106136 19.1% 22274 91.0%
madrid hospitality closed_or_inactive 1692 152473 1.1% 33811 5.0% 22274 7.6%
madrid hospitality unknown 146 152473 0.1% 9911 1.5% 22274 0.7%
madrid hospitality vacant_or_without_activity 161 152473 0.1% 2615 6.2% 22274 0.7%
madrid office_business active 13811 152473 9.1% 106136 13.0% 15286 90.4%
madrid office_business closed_or_inactive 1171 152473 0.8% 33811 3.5% 15286 7.7%
madrid office_business unknown 266 152473 0.2% 9911 2.7% 15286 1.7%
madrid office_business vacant_or_without_activity 38 152473 0.0% 2615 1.5% 15286 0.2%
madrid other active 10975 152473 7.2% 106136 10.3% 14782 74.2%
madrid other closed_or_inactive 1608 152473 1.1% 33811 4.8% 14782 10.9%
madrid other unknown 207 152473 0.1% 9911 2.1% 14782 1.4%
madrid other vacant_or_without_activity 1992 152473 1.3% 2615 76.2% 14782 13.5%
madrid personal_services active 7504 152473 4.9% 106136 7.1% 8536 87.9%
madrid personal_services closed_or_inactive 900 152473 0.6% 33811 2.7% 8536 10.5%
madrid personal_services unknown 48 152473 0.0% 9911 0.5% 8536 0.6%
madrid personal_services vacant_or_without_activity 84 152473 0.1% 2615 3.2% 8536 1.0%
madrid retail_food active 10672 152473 7.0% 106136 10.1% 13286 80.3%
madrid retail_food closed_or_inactive 2326 152473 1.5% 33811 6.9% 13286 17.5%
madrid retail_food unknown 73 152473 0.0% 9911 0.7% 13286 0.5%
madrid retail_food vacant_or_without_activity 215 152473 0.1% 2615 8.2% 13286 1.6%
madrid retail_nonfood active 28125 152473 18.4% 106136 26.5% 31294 89.9%
madrid retail_nonfood closed_or_inactive 2882 152473 1.9% 33811 8.5% 31294 9.2%
madrid retail_nonfood unknown 205 152473 0.1% 9911 2.1% 31294 0.7%
madrid retail_nonfood vacant_or_without_activity 82 152473 0.1% 2615 3.1% 31294 0.3%
madrid unknown active 6548 152473 4.3% 106136 6.2% 38073 17.2%
madrid unknown closed_or_inactive 22643 152473 14.9% 33811 67.0% 38073 59.5%
madrid unknown unknown 8882 152473 5.8% 9911 89.6% 38073 23.3%
barcelona culture_leisure active 1600 68024 2.4% 61875 2.6% 1600 100.0%
barcelona health active 3212 68024 4.7% 61875 5.2% 3212 100.0%
barcelona hospitality active 11136 68024 16.4% 61875 18.0% 11136 100.0%
barcelona office_business active 5518 68024 8.1% 61875 8.9% 5518 100.0%
barcelona other active 14063 68024 20.7% 61875 22.7% 20212 69.6%
barcelona other vacant_or_without_activity 6149 68024 9.0% 6149 100.0% 20212 30.4%
barcelona personal_services active 5451 68024 8.0% 61875 8.8% 5451 100.0%
barcelona retail_food active 10358 68024 15.2% 61875 16.7% 10358 100.0%
barcelona retail_nonfood active 10537 68024 15.5% 61875 17.0% 10537 100.0%
Spatstat point-pattern object construction summary
city pattern n_points window_area_km2 intensity_per_km2 has_marks n_mark_levels largest_mark largest_mark_share duplicate_points_after_jitter note
madrid all_active 106136 604.0394 175.7104 FALSE NA NA NA 0 Spatstat point pattern uses kilometre coordinates inside the municipal window
madrid marked_sector 106136 604.0394 175.7104 TRUE 9 retail_nonfood 0.2649902 9377 Spatstat point pattern uses kilometre coordinates inside the municipal window
barcelona all_active 61875 101.7022 608.3941 FALSE NA NA NA 0 Spatstat point pattern uses kilometre coordinates inside the municipal window
barcelona marked_sector 61875 101.7022 608.3941 TRUE 8 other 0.2272808 2812 Spatstat point pattern uses kilometre coordinates inside the municipal window
Municipal study windows and active service-premise points in Madrid and Barcelona
Municipal study windows and active service-premise points in Madrid and Barcelona

Functional Demand Corridors

MITMS OD flows are aggregated into AM peak, midday, PM peak and evening buckets. City-core mobility zones are selected using municipality-code prefix, centroid containment or at least 50 percent municipal overlap. OD records are tagged as internal, inbound or outbound relative to those city-core zones. The flow values in this report are average OD movement weights from the selected Monday-Sunday week after hour-bucket aggregation. They are used as relative mobility intensity weights for line exposure and grid allocation; they are not observed sales, spending, or individual trajectories.

Functional corridors are centroid-to-centroid desire lines from internal city-core OD flows. The corridor layer keeps top 10 percent, top 5 percent and top 1 percent flow corridors. The report visualises top 10 percent corridors because that threshold shows the full high-flow structure instead of only the most extreme OD lines. The model surface uses top 10 percent corridor exposure with 250m, 500m and 1000m distance-decay variants, after log1p() transformation.

Mobility corridor summary by city, hour bucket and quantile
city hour_bucket corridor_quantile n_corridors mean_flow max_flow
madrid am_peak 0.90 42 11.56372 16.12549
madrid am_peak 0.95 21 12.63097 16.12549
madrid am_peak 0.99 5 14.72714 16.12549
madrid evening 0.90 42 12.57987 18.88956
madrid evening 0.95 21 14.09877 18.88956
madrid evening 0.99 5 16.51005 18.88956
madrid midday 0.90 42 11.44651 17.39488
madrid midday 0.95 21 12.84958 17.39488
madrid midday 0.99 5 15.01133 17.39488
madrid pm_peak 0.90 42 12.30466 18.83590
madrid pm_peak 0.95 21 13.82335 18.83590
madrid pm_peak 0.99 5 16.23815 18.83590
barcelona am_peak 0.90 9 12.54281 15.01500
barcelona am_peak 0.95 5 13.11709 15.01500
barcelona am_peak 0.99 1 15.01500 15.01500
barcelona evening 0.90 9 13.98833 16.99550
barcelona evening 0.95 5 14.58942 16.99550
barcelona evening 0.99 1 16.99550 16.99550
barcelona midday 0.90 9 12.46854 14.08580
barcelona midday 0.95 5 13.04866 14.08580
barcelona midday 0.99 1 14.08580 14.08580
barcelona pm_peak 0.90 9 14.04806 15.43829
barcelona pm_peak 0.95 5 14.55349 15.43829
barcelona pm_peak 0.99 1 15.43829 15.43829
Madrid functional demand corridors by hour bucket
Madrid functional demand corridors by hour bucket
Barcelona functional demand corridors by hour bucket
Barcelona functional demand corridors by hour bucket
Observed premise distance to corridors versus simulated grid benchmarks
Observed premise distance to corridors versus simulated grid benchmarks

The corridor-distance benchmark is simulated in two ways. The uniform grid benchmark draws the same number of jittered grid-cell points with probability proportional to 500m cell area. The static-demand-weighted benchmark draws the same number of jittered grid-cell points with probability proportional to cell area and static residential demand. A significant result against the static-demand-weighted grid benchmark is stronger evidence that active premises are closer to OD corridors than expected from the residential benchmark alone.

Monte Carlo point-line distance tests. Each benchmark uses n_observed_test simulated points per iteration and is compared with the same observed active-premise sample
city benchmark n_observed_full n_observed_test observed_mean_m simulated_mean_interval_m observed_median_m simulated_median_interval_m p_mean_closer p_median_closer note
madrid uniform_grid_area_weighted 106136 3000 550.8 2,938.5 - 3,153.7 294.2 1,910.8 - 2,137.2 0.010 0.010 One-sided Monte Carlo test for shorter observed distances; benchmark=uniform_grid_area_weighted; grid-cell weighted benchmark with jittered cell-centroid points; nsim=100; random patterns condition on n=3000 sampled from full n=106136
madrid static_demand_weighted_grid 106136 3000 550.8 1,021.2 - 1,161.2 294.2 325.8 - 385.1 0.010 0.010 One-sided Monte Carlo test for shorter observed distances; benchmark=static_demand_weighted_grid; grid-cell weighted benchmark with jittered cell-centroid points; nsim=100; random patterns condition on n=3000 sampled from full n=106136
barcelona uniform_grid_area_weighted 61875 3000 755.4 1,153.4 - 1,227.7 603.1 916.9 - 994.4 0.010 0.010 One-sided Monte Carlo test for shorter observed distances; benchmark=uniform_grid_area_weighted; grid-cell weighted benchmark with jittered cell-centroid points; nsim=100; random patterns condition on n=3000 sampled from full n=61875
barcelona static_demand_weighted_grid 61875 3000 755.4 864.3 - 915.4 603.1 658.8 - 717.0 0.010 0.010 One-sided Monte Carlo test for shorter observed distances; benchmark=static_demand_weighted_grid; grid-cell weighted benchmark with jittered cell-centroid points; nsim=100; random patterns condition on n=3000 sampled from full n=61875

With 100 simulations, the smallest possible one-sided Monte Carlo p-value is 1 / 101 = 0.0099. Results displayed at that lower bound mean that no simulated benchmark pattern had a mean or median corridor distance as small as the observed premise sample; they should be read as p <= 0.0099, not as a more precise tail probability.

Static And Dynamic Surfaces

Static demand is an official residential benchmark: INE Censo 2024 population and INE ADRH 2023 income are area-weighted from census sections to grid cells and combined as:

static_demand = 0.70 * z(population) + 0.30 * z(income).

The static weights are a transparent residential benchmark rather than an estimated consumption model. They give population the dominant role and add income as purchasing-power context.

Dynamic demand is an OD-derived grid surface. MITMS mobility-zone flows are area-allocated to 500m cells after computing hourly inbound, outbound, internal, destination-total and nonresident-inbound components. The final dynamic index used for maps, StaticBias and OpportunityGap is:

dynamic_demand = 0.40*z(destination_total) + 0.25*z(inbound) + 0.15*z(nonresident_inbound) + 0.10*z(evening_inbound) + 0.10*z(weekend_inbound).

Net presence and throughflow are computed for diagnostics and model covariates, but they are not the final dynamic-demand index. Corridor exposure is kept as a distinct line-pattern covariate and enters the dynamic-corridor and full models through nonlinear log1p() top-10 corridor exposure terms at 250m, 500m and 1000m decay radii, plus a dynamic-corridor interaction. To avoid internal collinearity, the regression models do not include the composite dynamic_demand together with the OD components used to construct it.

Madrid raw active-service intensity
Madrid raw active-service intensity
Barcelona raw active-service intensity
Barcelona raw active-service intensity
Madrid static and dynamic demand surfaces
Madrid static and dynamic demand surfaces
Barcelona static and dynamic demand surfaces
Barcelona static and dynamic demand surfaces
Kernel intensity bandwidth sensitivity
Kernel intensity bandwidth sensitivity
Kernel intensity bandwidth sensitivity values
city method bandwidth_km null_hypothesis note
madrid bw.diggle 0.0013170 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
madrid bw.scott_x 0.4898013 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
madrid bw.scott_y 0.5629381 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
madrid fixed_250m 0.2500000 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
madrid fixed_500m 0.5000000 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
barcelona bw.diggle 0.0007078 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
barcelona bw.scott_x 0.2893049 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
barcelona bw.scott_y 0.3535844 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
barcelona fixed_250m 0.2500000 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales
barcelona fixed_500m 0.5000000 NA Kernel intensity bandwidth sensitivity; fixed values match the grid/corridor exposure scales

The fixed 250m and 500m bandwidths are the substantive comparison scales. The bw.diggle values are reported as diagnostics only; with many duplicated or near-duplicated premise coordinates they can become unrealistically small and should not be treated as the main smoothing scale.

Interactive Maps

The interactive maps are Leaflet widgets generated inside this report from the processed GeoPackage layers. They contain embedded vector layers: municipal boundary, StaticBias hexes, OpportunityGap hexes, top 10 percent mobility corridors and sampled active-premise points. They intentionally do not call external basemap tiles, so the rendered HTML remains reader-safe as a single-file report.

Madrid interactive map

Madrid map is generated inside the report from processed GeoPackage layers and embedded by the self-contained HTML renderer.

Barcelona interactive map

Barcelona map is generated inside the report from processed GeoPackage layers and embedded by the self-contained HTML renderer.

First-Order Tests

The first-order tests compare the premise point pattern with spatial quadrats and grid covariates. Quadrat tests evaluate spatial intensity heterogeneity. Berman Z1/Z2 and CDF tests evaluate whether points are non-random with respect to static demand, dynamic demand, OD-flow components, distance to corridor and corridor exposure.

First-order point-pattern tests
city test covariate statistic p_value null_hypothesis
madrid quadrat_4x4 NA 1.752274e+05 <0.001 homogeneous CSR intensity over quadrats
madrid quadrat_8x8 NA 2.676636e+05 <0.001 homogeneous CSR intensity over quadrats
madrid berman_Z1 static_demand 6.150979e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid berman_Z2 static_demand 4.369452e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid cdf_KS static_demand 6.588094e-01 <0.001 point locations are independent of the covariate distribution
madrid cdf_CvM static_demand 2.050839e+04 <0.001 point locations are independent of the covariate distribution
madrid cdf_AD static_demand 1.296266e+05 <0.001 point locations are independent of the covariate distribution
madrid berman_Z1 dynamic_demand 5.703177e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid berman_Z2 dynamic_demand 3.913293e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid cdf_KS dynamic_demand 5.640104e-01 <0.001 point locations are independent of the covariate distribution
madrid cdf_CvM dynamic_demand 1.585772e+04 <0.001 point locations are independent of the covariate distribution
madrid cdf_AD dynamic_demand Inf <0.001 point locations are independent of the covariate distribution
madrid berman_Z1 dynamic_inbound 5.711777e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid berman_Z2 dynamic_inbound 3.911371e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid cdf_KS dynamic_inbound 5.643110e-01 <0.001 point locations are independent of the covariate distribution
madrid cdf_CvM dynamic_inbound 1.585106e+04 <0.001 point locations are independent of the covariate distribution
madrid cdf_AD dynamic_inbound Inf <0.001 point locations are independent of the covariate distribution
madrid berman_Z1 dynamic_destination_total 5.710849e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid berman_Z2 dynamic_destination_total 3.912449e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid cdf_KS dynamic_destination_total 5.641485e-01 <0.001 point locations are independent of the covariate distribution
madrid cdf_CvM dynamic_destination_total 1.586802e+04 <0.001 point locations are independent of the covariate distribution
madrid cdf_AD dynamic_destination_total Inf <0.001 point locations are independent of the covariate distribution
madrid berman_Z1 distance_to_corridor -1.893637e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid berman_Z2 distance_to_corridor -3.600287e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid cdf_KS distance_to_corridor 5.278541e-01 <0.001 point locations are independent of the covariate distribution
madrid cdf_CvM distance_to_corridor 1.385967e+04 <0.001 point locations are independent of the covariate distribution
madrid cdf_AD distance_to_corridor Inf <0.001 point locations are independent of the covariate distribution
madrid berman_Z1 log_corridor_exposure 3.096694e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid berman_Z2 log_corridor_exposure 3.476385e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
madrid cdf_KS log_corridor_exposure 5.255882e-01 <0.001 point locations are independent of the covariate distribution
madrid cdf_CvM log_corridor_exposure 1.292688e+04 <0.001 point locations are independent of the covariate distribution
madrid cdf_AD log_corridor_exposure 6.465996e+04 <0.001 point locations are independent of the covariate distribution
barcelona quadrat_4x4 NA 3.795513e+04 <0.001 homogeneous CSR intensity over quadrats
barcelona quadrat_8x8 NA 7.416618e+04 <0.001 homogeneous CSR intensity over quadrats
barcelona berman_Z1 static_demand 2.528984e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona berman_Z2 static_demand 2.470513e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona cdf_KS static_demand 4.820153e-01 <0.001 point locations are independent of the covariate distribution
barcelona cdf_CvM static_demand 6.432169e+03 <0.001 point locations are independent of the covariate distribution
barcelona cdf_AD static_demand Inf <0.001 point locations are independent of the covariate distribution
barcelona berman_Z1 dynamic_demand 1.871232e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona berman_Z2 dynamic_demand 1.813880e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona cdf_KS dynamic_demand 3.342623e-01 <0.001 point locations are independent of the covariate distribution
barcelona cdf_CvM dynamic_demand 3.305602e+03 <0.001 point locations are independent of the covariate distribution
barcelona cdf_AD dynamic_demand Inf <0.001 point locations are independent of the covariate distribution
barcelona berman_Z1 dynamic_inbound 1.872784e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona berman_Z2 dynamic_inbound 1.819328e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona cdf_KS dynamic_inbound 3.344274e-01 <0.001 point locations are independent of the covariate distribution
barcelona cdf_CvM dynamic_inbound 3.307961e+03 <0.001 point locations are independent of the covariate distribution
barcelona cdf_AD dynamic_inbound Inf <0.001 point locations are independent of the covariate distribution
barcelona berman_Z1 dynamic_destination_total 1.872598e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona berman_Z2 dynamic_destination_total 1.818713e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona cdf_KS dynamic_destination_total 3.342266e-01 <0.001 point locations are independent of the covariate distribution
barcelona cdf_CvM dynamic_destination_total 3.306219e+03 <0.001 point locations are independent of the covariate distribution
barcelona cdf_AD dynamic_destination_total Inf <0.001 point locations are independent of the covariate distribution
barcelona berman_Z1 distance_to_corridor -7.368865e+01 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona berman_Z2 distance_to_corridor -1.221206e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona cdf_KS distance_to_corridor 2.456395e-01 <0.001 point locations are independent of the covariate distribution
barcelona cdf_CvM distance_to_corridor 1.587154e+03 <0.001 point locations are independent of the covariate distribution
barcelona cdf_AD distance_to_corridor 7.678331e+03 <0.001 point locations are independent of the covariate distribution
barcelona berman_Z1 log_corridor_exposure 8.374571e+01 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona berman_Z2 log_corridor_exposure 1.276607e+02 <0.001 intensity is proportional to baseline and does not depend on the covariate
barcelona cdf_KS log_corridor_exposure 2.396421e-01 <0.001 point locations are independent of the covariate distribution
barcelona cdf_CvM log_corridor_exposure 1.652524e+03 <0.001 point locations are independent of the covariate distribution
barcelona cdf_AD log_corridor_exposure Inf <0.001 point locations are independent of the covariate distribution
First-order effect sizes. The window benchmark is the area-weighted 500m municipal grid distribution
city covariate n_points point_mean window_area_weighted_mean mean_difference standardized_mean_difference point_median window_median note
madrid static_demand 106136 1.573 0.032 1.541 1.935 1.598 -0.382 active premises are located in higher covariate cells than the area-weighted grid expectation
madrid dynamic_demand 106136 1.832 0.044 1.787 1.748 1.278 -0.252 active premises are located in higher covariate cells than the area-weighted grid expectation
madrid dynamic_inbound 106136 1.829 0.044 1.785 1.751 1.259 -0.251 active premises are located in higher covariate cells than the area-weighted grid expectation
madrid dynamic_destination_total 106136 1.829 0.044 1.785 1.751 1.263 -0.252 active premises are located in higher covariate cells than the area-weighted grid expectation
madrid distance_to_corridor 106136 545.437 3,024.102 -2,478.665 -0.819 283.763 2,017.052 active premises are closer than the area-weighted grid expectation
madrid log_corridor_exposure 106136 2.632 0.981 1.651 1.156 2.813 0.040 active premises are located in higher covariate cells than the area-weighted grid expectation
barcelona static_demand 61875 0.957 0.143 0.814 1.038 1.016 0.015 active premises are located in higher covariate cells than the area-weighted grid expectation
barcelona dynamic_demand 61875 0.960 0.263 0.697 0.757 0.931 -0.086 active premises are located in higher covariate cells than the area-weighted grid expectation
barcelona dynamic_inbound 61875 0.960 0.263 0.697 0.758 0.923 -0.094 active premises are located in higher covariate cells than the area-weighted grid expectation
barcelona dynamic_destination_total 61875 0.960 0.263 0.697 0.758 0.924 -0.092 active premises are located in higher covariate cells than the area-weighted grid expectation
barcelona distance_to_corridor 61875 739.285 1,182.855 -443.569 -0.472 582.411 959.656 active premises are closer than the area-weighted grid expectation
barcelona log_corridor_exposure 61875 1.861 1.259 0.602 0.463 1.708 0.826 active premises are located in higher covariate cells than the area-weighted grid expectation

The first-order block tests whether active premises are spatially homogeneous and whether their locations are independent of the demand and corridor covariates. The CDF variants are distributional tests; Berman Z1 is more sensitive to mean differences and Berman Z2 is more sensitive to broader distributional departures. Because both cities contain tens of thousands of active premises, very small p-values mainly establish that the pattern is not random with respect to the covariate. Substantive interpretation depends on effect direction, map geography and model comparison, not p-values alone.

Rhohat covariate-intensity diagnostics
Rhohat covariate-intensity diagnostics

Main Model Comparison

Five grid-discretised intensity models are compared per city. The reproducible default starts with 500m grid-cell Poisson counts with a log-area offset, which is a discretised approximation to the point-process intensity model. Full continuous spatstat::ppm fitting can be run separately with FDC_MODEL_ENGINE=ppm, but it is not the default because the full point pattern is large. Because the grid counts are overdispersed, the same formulas are also attempted as negative-binomial grid-count models. A negative-binomial status of poisson_limit means the estimated theta is extremely large and the attempted NB fit has collapsed to a Poisson-limit model; those rows are not used as overdispersion-corrected NB evidence. A fixed-theta NB sensitivity is therefore also reported: each city uses the finite theta from its full ML NB model for every nested specification, which gives a complete static-versus-dynamic comparison for Barcelona.

Lower AIC is better.

Grid-discretised Poisson intensity model comparison. Pearson dispersion greater than 1 indicates overdispersed grid counts
city model aic bic log_likelihood grid_count_correlation residual_df pearson_dispersion model_status model_type
madrid M0 348,978.9 348,984.9 -174,488.4 0.127 3002 213.0 poisson grid_glm
madrid M1_static 117,037.4 117,049.4 -58,516.7 0.661 3001 57.0 poisson grid_glm
madrid M2_dynamic 164,535.0 164,583.1 -82,259.5 0.727 2995 94.2 poisson grid_glm
madrid M2_dynamic_corridor 128,050.0 128,122.1 -64,013.0 0.773 2991 76.3 poisson grid_glm
madrid M3_full 82,855.3 82,933.4 -41,414.7 0.805 2990 45.7 poisson grid_glm
barcelona M0 102,189.7 102,194.1 -51,093.8 0.371 585 178.5 poisson grid_glm
barcelona M1_static 37,787.3 37,796.0 -18,891.6 0.786 584 69.8 poisson grid_glm
barcelona M2_dynamic 66,414.7 66,449.7 -33,199.3 0.693 578 143.6 poisson grid_glm
barcelona M2_dynamic_corridor 40,180.4 40,232.9 -20,078.2 0.792 574 78.7 poisson grid_glm
barcelona M3_full 22,672.7 22,729.6 -11,323.4 0.867 573 40.4 poisson grid_glm
AIC differences. Positive gain means the compared richer model has lower AIC; percentages are relative to the static-only AIC in the same city
city M0 M1_static M2_dynamic M2_dynamic_corridor M3_full dynamic_gain_vs_static dynamic_corridor_gain_vs_static dynamic_corridor_gain_pct_of_static_aic full_gain_vs_static full_gain_pct_of_static_aic static_gain_vs_null
barcelona 102,189.7 37,787.3 66,414.7 40,180.4 22,672.7 -28,627.4 -2,393.1 -6.3% 15,114.6 40.0% 64,402.4
madrid 348,978.9 117,037.4 164,535.0 128,050.0 82,855.3 -47,497.6 -11,012.5 -9.4% 34,182.1 29.2% 231,941.4
Valid negative-binomial grid-count fits. These rows estimate finite overdispersion; rows where NB collapsed to the Poisson limit are excluded from this comparison
city model aic bic log_likelihood theta grid_count_correlation pearson_dispersion model_status model_type
madrid M0 16,779.2 16,791.2 -8,387.6 0.10 0.127 0.62 negative_binomial grid_negative_binomial
madrid M1_static 15,787.9 15,805.9 -7,891.0 0.17 0.377 3.21 negative_binomial grid_negative_binomial
madrid M2_dynamic 16,180.1 16,234.2 -8,081.1 0.13 0.520 1.37 negative_binomial grid_negative_binomial
madrid M2_dynamic_corridor 15,519.4 15,597.5 -7,746.7 0.19 0.333 2.60 negative_binomial grid_negative_binomial
madrid M3_full 15,110.1 15,194.2 -7,541.1 0.25 0.516 4.48 negative_binomial grid_negative_binomial
barcelona M2_dynamic 5,002.5 5,041.9 -2,492.3 0.25 0.632 1.27 negative_binomial grid_negative_binomial
barcelona M2_dynamic_corridor 4,758.6 4,815.5 -2,366.3 0.40 0.625 1.58 negative_binomial grid_negative_binomial
barcelona M3_full 4,561.0 4,622.2 -2,266.5 0.64 0.592 2.02 negative_binomial grid_negative_binomial
Poisson-limit negative-binomial attempts. These rows are diagnostics, not valid overdispersion-corrected NB comparisons
city model aic bic log_likelihood theta grid_count_correlation pearson_dispersion model_status note
barcelona M0 761,860.0 761,868.7 -380,928.0 600,032,947,344,045,056 0.371 178.53 poisson_limit Negative-binomial grid count model with log-area offset; used as overdispersion robustness for the Poisson intensity comparison; NB theta is very large, so the fitted model is effectively the Poisson-limit case rather than a failed run
barcelona M1_static 37,789.1 37,802.2 -18,891.5 81,557,309,469 0.786 69.76 poisson_limit Negative-binomial grid count model with log-area offset; used as overdispersion robustness for the Poisson intensity comparison; NB theta is very large, so the fitted model is effectively the Poisson-limit case rather than a failed run
Negative-binomial fit status by city. Barcelona static/null rows collapse to the Poisson limit in the unconstrained ML NB attempts; the complete Barcelona overdispersion-sensitive ranking is therefore reported in the fixed-theta NB table below
city n_models finite_nb_models poisson_limit_models failed_models
madrid 5 5 0 0
barcelona 5 3 2 0
Fixed-theta negative-binomial sensitivity. Each city uses the finite full-model NB theta for all nested grid-count models, so Barcelona static, dynamic and full specifications are directly comparable under the same overdispersion assumption
city model aic bic log_likelihood theta grid_count_correlation pearson_dispersion model_status model_type
madrid M0 17,838.9 17,844.9 -8,918.4 0.25 0.127 1.56 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
madrid M1_static 15,914.1 15,926.1 -7,955.0 0.25 0.378 4.56 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
madrid M2_dynamic 16,544.5 16,592.6 -8,264.3 0.25 0.526 2.42 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
madrid M2_dynamic_corridor 15,574.2 15,646.3 -7,775.1 0.25 0.367 3.18 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
madrid M3_full 15,108.1 15,186.2 -7,541.1 0.25 0.516 4.47 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
barcelona M0 5,581.3 5,585.7 -2,789.6 0.64 0.371 1.35 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
barcelona M1_static 4,889.2 4,898.0 -2,442.6 0.64 0.666 1.94 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
barcelona M2_dynamic 5,266.7 5,301.7 -2,625.3 0.64 0.638 2.83 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
barcelona M2_dynamic_corridor 4,806.5 4,859.0 -2,391.3 0.64 0.638 2.36 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
barcelona M3_full 4,559.0 4,615.9 -2,266.5 0.64 0.592 2.02 fixed_theta_negative_binomial grid_negative_binomial_fixed_theta
Fixed-theta NB AIC differences. Positive gain means the richer model has lower AIC than the static-only model in the same city
city M0 M1_static M2_dynamic M2_dynamic_corridor M3_full dynamic_gain_vs_static dynamic_corridor_gain_vs_static full_gain_vs_static
barcelona 5,581.3 4,889.2 5,266.7 4,806.5 4,559.0 -377.5 82.7 330.2
madrid 17,838.9 15,914.1 16,544.5 15,574.2 15,108.1 -630.4 339.9 806.0
Nested model tests. The reported p-value is overdispersion-adjusted when Pearson dispersion is available; the naive Poisson LR p-value is retained as a diagnostic
city comparison reduced_model full_model statistic df overdispersion_adjusted_f full_model_pearson_dispersion p_value poisson_lr_p_value_naive null_hypothesis
madrid M0_vs_M1_static M0 M1_static 110,752.7 1 1,942.32 57.0 <0.001 <0.001 reduced model is sufficient; added spatial covariates do not improve intensity fit
madrid M0_vs_M2_dynamic_corridor M0 M2_dynamic_corridor 121,745.3 11 145.02 76.3 <0.001 <0.001 reduced model is sufficient; added spatial covariates do not improve intensity fit
madrid M1_static_vs_M3_full M1_static M3_full 76,548.6 11 152.21 45.7 <0.001 <0.001 reduced model is sufficient; added spatial covariates do not improve intensity fit
madrid M2_dynamic_corridor_vs_M3_full M2_dynamic_corridor M3_full 76,548.6 1 1,674.30 45.7 <0.001 <0.001 reduced model is sufficient; added spatial covariates do not improve intensity fit
barcelona M0_vs_M1_static M0 M1_static 35,609.4 1 510.48 69.8 <0.001 <0.001 reduced model is sufficient; added spatial covariates do not improve intensity fit
barcelona M0_vs_M2_dynamic_corridor M0 M2_dynamic_corridor 37,982.5 11 43.85 78.7 <0.001 <0.001 reduced model is sufficient; added spatial covariates do not improve intensity fit
barcelona M1_static_vs_M3_full M1_static M3_full 20,472.8 11 46.06 40.4 <0.001 <0.001 reduced model is sufficient; added spatial covariates do not improve intensity fit
barcelona M2_dynamic_corridor_vs_M3_full M2_dynamic_corridor M3_full 20,472.8 1 506.69 40.4 <0.001 <0.001 reduced model is sufficient; added spatial covariates do not improve intensity fit
Full-model coefficient diagnostics. The composite dynamic index is not included with its components; component signs and p-values remain descriptive because OD components and corridor exposures are spatially correlated
city model term estimate std_error statistic p_value
madrid M3_full static_demand 0.8369119 0.0261315 32.0269159 <0.001
madrid M3_full dynamic_destination_total 14.3848170 13.3445262 1.0779564 0.281
madrid M3_full dynamic_inbound -25.4386699 14.6180988 -1.7402174 0.082
madrid M3_full dynamic_nonresident_inbound 10.8286884 4.7324624 2.2881721 0.022
madrid M3_full dynamic_throughflow -0.6838256 0.1137378 -6.0122965 <0.001
madrid M3_full dynamic_midday_inbound 2.3957390 1.0676441 2.2439490 0.025
madrid M3_full dynamic_evening_inbound 0.7754897 0.5910183 1.3121246 0.189
madrid M3_full dynamic_weekend_inbound -2.1356361 0.6625857 -3.2231846 0.001
madrid M3_full log_corridor_exposure 0.2781768 0.0885178 3.1426088 0.002
madrid M3_full log_corridor_exposure_q90_tau500 -1.1967927 0.2185136 -5.4769704 <0.001
madrid M3_full log_corridor_exposure_q90_tau1000 2.3243913 0.2258156 10.2933154 <0.001
madrid M3_full dynamic_corridor_interaction -0.0642958 0.0161295 -3.9862367 <0.001
barcelona M3_full static_demand 0.8889873 0.0437824 20.3046867 <0.001
barcelona M3_full dynamic_destination_total 18.7215142 19.2127611 0.9744312 0.330
barcelona M3_full dynamic_inbound -43.9686543 20.4193307 -2.1532858 0.031
barcelona M3_full dynamic_nonresident_inbound 45.0286684 11.1021188 4.0558626 <0.001
barcelona M3_full dynamic_throughflow -3.1702953 0.8074850 -3.9261352 <0.001
barcelona M3_full dynamic_midday_inbound -5.8190638 2.3430959 -2.4834936 0.013
barcelona M3_full dynamic_evening_inbound -6.7101654 2.3370631 -2.8711956 0.004
barcelona M3_full dynamic_weekend_inbound -4.1610928 1.3555934 -3.0695730 0.002
barcelona M3_full log_corridor_exposure 0.1652787 0.1166984 1.4162894 0.157
barcelona M3_full log_corridor_exposure_q90_tau500 -1.5606261 0.2980994 -5.2352535 <0.001
barcelona M3_full log_corridor_exposure_q90_tau1000 2.7186663 0.2861464 9.5009633 <0.001
barcelona M3_full dynamic_corridor_interaction 0.0742140 0.0359950 2.0617877 0.039
Main result. Madrid: static-only is lower than dynamic-only by 630.4 AIC; dynamic plus corridor is lower than static-only by 339.9 AIC (2.1% of static-only AIC); the full model is lower than static-only by 806 AIC (5.1% of static-only AIC). Barcelona: static-only is lower than dynamic-only by 377.5 AIC; dynamic plus corridor is lower than static-only by 82.7 AIC (1.7% of static-only AIC); the full model is lower than static-only by 330.2 AIC (6.8% of static-only AIC). These statements use fixed-theta negative-binomial AIC. The hypothesis is supported in augmentation form when the full model improves on the static-only benchmark and when dynamic plus corridor exposure improves over static-only. The dynamic-only specification is evaluated separately and should not be read as a replacement model unless its AIC is lower than the static-only model.
Grid-level residual diagnostics for fitted intensity models
city model observed_total expected_total mean_abs_pearson rmse_count max_abs_pearson cells_abs_pearson_gt_2 residual_df pearson_dispersion grid_count_correlation null_hypothesis
madrid M1_static 106136 106136 4.299829 83.47309 84.31859 2536 3001 57.02071 0.6609116 fitted model explains grid-level point intensity without systematic residual concentration
madrid M2_dynamic_corridor 106136 106136 4.367094 57.45046 125.19900 1701 2991 76.31859 0.7729574 fitted model explains grid-level point intensity without systematic residual concentration
madrid M3_full 106136 106136 3.370059 57.97333 89.07356 1567 2990 45.71975 0.8050392 fitted model explains grid-level point intensity without systematic residual concentration
barcelona M1_static 61875 61875 5.718472 102.01705 63.85506 461 584 69.75714 0.7863603 fitted model explains grid-level point intensity without systematic residual concentration
barcelona M2_dynamic_corridor 61875 61875 5.728632 98.71033 55.58497 397 574 78.74227 0.7916808 fitted model explains grid-level point intensity without systematic residual concentration
barcelona M3_full 61875 61875 4.203080 82.66696 41.79517 389 573 40.40472 0.8674372 fitted model explains grid-level point intensity without systematic residual concentration
Fixed-theta negative-binomial residual diagnostics. These diagnostics use the same city-specific overdispersion assumption as the fixed-theta model comparison; Pearson residuals are interpreted through the NB variance function
city model observed_total mean_abs_pearson rmse_count max_abs_pearson cells_abs_pearson_gt_2 residual_df pearson_dispersion theta grid_count_correlation null_hypothesis
madrid M1_static 106136 0.6655081 824.4134 40.39264 96 3001 4.563779 0.2455383 0.3779330 fitted fixed-theta NB model explains grid-level point intensity without systematic residual concentration
madrid M2_dynamic_corridor 106136 0.6224965 522.9846 50.40543 100 2991 3.176219 0.2455383 0.3666559 fitted fixed-theta NB model explains grid-level point intensity without systematic residual concentration
madrid M3_full 106136 0.6014359 818.8848 68.70968 95 2990 4.474801 0.2455383 0.5158123 fitted fixed-theta NB model explains grid-level point intensity without systematic residual concentration
barcelona M1_static 61875 0.8278946 309.0255 13.11605 35 584 1.942041 0.6397702 0.6661115 fitted fixed-theta NB model explains grid-level point intensity without systematic residual concentration
barcelona M2_dynamic_corridor 61875 0.7286880 159.9256 22.83368 28 574 2.363991 0.6397702 0.6375537 fitted fixed-theta NB model explains grid-level point intensity without systematic residual concentration
barcelona M3_full 61875 0.6849635 478.1834 19.54507 23 573 2.018991 0.6397702 0.5921251 fitted fixed-theta NB model explains grid-level point intensity without systematic residual concentration
Full-model residual K/G second-order diagnostics
city model function_name max_positive_deviation max_negative_deviation peak_abs_r_km null_hypothesis note
madrid M3_full Kres NA NA NA full fitted model leaves no residual second-order clustering Residual K/G computed only for fitted spatstat ppm models
madrid M3_full Gres NA NA NA full fitted model leaves no residual second-order clustering Residual K/G computed only for fitted spatstat ppm models
barcelona M3_full Kres NA NA NA full fitted model leaves no residual second-order clustering Residual K/G computed only for fitted spatstat ppm models
barcelona M3_full Gres NA NA NA full fitted model leaves no residual second-order clustering Residual K/G computed only for fitted spatstat ppm models
Full-model fixed-theta negative-binomial Pearson residual maps
Full-model fixed-theta negative-binomial Pearson residual maps

Second-Order K, L, Pair-Correlation, F, G And J Functions

Raw second-order functions describe clustering, nearest-neighbour structure and empty-space structure. Inhomogeneous K, L and pair-correlation summaries repeat the same logic after allowing intensity to vary with static or dynamic-corridor surfaces. The homogeneous Poisson/CSR reference level for the plotted L function is the dashed L(r)-r = 0 line. The F function describes distances from arbitrary empty locations to the nearest premise. The G function describes nearest-neighbour distances between observed premises. The J function compares F and G.

The current report uses fixed-seed samples for computational tractability. In final mode the default second-order sample size is 1,000 points and the default Monte Carlo simulation count is 100. It computes global Monte Carlo envelopes for raw K, L and F functions; G and J are shown against CSR baselines, with extended G/J envelopes available by running the pipeline with FDC_EXTENDED_ENVELOPES=true. The reported global-envelope p-value is a Monte Carlo maximum-absolute-deviation p-value computed from the saved simulated functions, not a rank-envelope crossing count.

Raw and inhomogeneous L-function summary
city sector max_positive_deviation_raw_L max_positive_deviation_static_controlled_L max_positive_deviation_dynamic_controlled_L first_significant_r_km_raw_L first_significant_r_km_static_controlled_L first_significant_r_km_dynamic_controlled_L peak_r_km_raw_L peak_r_km_static_controlled_L peak_r_km_dynamic_controlled_L note_raw_L note_static_controlled_L note_dynamic_controlled_L dynamic_reduction_in_clustering static_reduction_in_clustering
madrid all 5.421683 3.5833155 3.4954697 0.0152723 0.0152723 0 6.750345 7.315419 7.819404 NA NA NA 1.9262132 1.8383675
barcelona all 1.281195 0.4103258 0.8323541 0.0071620 0.0071620 0 3.158460 3.645479 3.036705 NA NA NA 0.4488406 0.8708688
Global Monte Carlo CSR envelope summary for second-order functions
city function_name envelope_nsim envelope_n_points outside_high outside_low first_outside_r_km max_upper_excess max_lower_excess note
madrid L 100 1000 492 0 0.3207177 4.8973588 -0.5243241 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid K 100 1000 415 0 1.4966828 299.4200720 -26.6414469 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid F 100 1000 0 23 0.1832673 -0.0379834 0.4727425 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid G 100 NA NA NA NA NA NA G envelope skipped by default; set FDC_EXTENDED_ENVELOPES=true to run
madrid J 100 NA NA NA NA NA NA J envelope skipped by default; set FDC_EXTENDED_ENVELOPES=true to run
barcelona L 100 1000 459 0 0.3867502 1.0428502 -0.2383444 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona K 100 1000 361 0 1.0886302 27.9879547 -4.6755436 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona F 100 1000 0 19 0.1145926 -0.0432429 0.3006086 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona G 100 NA NA NA NA NA NA G envelope skipped by default; set FDC_EXTENDED_ENVELOPES=true to run
barcelona J 100 NA NA NA NA NA NA J envelope skipped by default; set FDC_EXTENDED_ENVELOPES=true to run
Raw CSR and inhomogeneous K/L/pair-correlation summaries. Inhomogeneous F/G/J rows are omitted when not validly estimated
city function_name model null_hypothesis n_points max_positive_deviation max_negative_deviation first_positive_r_km peak_abs_r_km note
madrid K raw_CSR_sample homogeneous CSR 1000 326.0615188 0.0000000 0.0152723 7.1779684 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid L raw_CSR_sample homogeneous CSR 1000 5.4216830 0.0000000 0.0152723 6.7503447 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid F raw_CSR_sample homogeneous CSR 1000 0.0000000 -0.5107259 NA 0.7941582 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid G raw_CSR_sample homogeneous CSR 1000 0.5287149 -0.0079837 0.0029059 0.2121307 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid J raw_CSR_sample homogeneous CSR 1000 -0.0210000 -0.9854556 NA 1.2756898 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid pcf raw_CSR_sample homogeneous CSR 1000 19.9603481 0.5031882 0.0152723 0.0152723 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid K static_inhomogeneous_sample inhomogeneous Poisson with static intensity 1000 213.2430669 0.0000000 0.0152723 7.8194039 Inhomogeneous summary computed on fixed-seed envelope sample
madrid K dynamic_inhomogeneous_sample inhomogeneous Poisson with dynamic-corridor intensity 1000 210.1200461 0.0000000 0.0000000 7.8194039 Inhomogeneous summary computed on fixed-seed envelope sample
madrid L static_inhomogeneous_sample inhomogeneous Poisson with static intensity 1000 3.5833155 0.0000000 0.0152723 7.3154189 Inhomogeneous summary computed on fixed-seed envelope sample
madrid L dynamic_inhomogeneous_sample inhomogeneous Poisson with dynamic-corridor intensity 1000 3.4954697 0.0000000 0.0000000 7.8194039 Inhomogeneous summary computed on fixed-seed envelope sample
madrid pcf static_inhomogeneous_sample inhomogeneous Poisson with static intensity 1000 111.6570876 3.2082706 0.0152723 0.0152723 Inhomogeneous summary computed on fixed-seed envelope sample
madrid pcf dynamic_inhomogeneous_sample inhomogeneous Poisson with dynamic-corridor intensity 1000 79.9677331 3.0627737 0.0152723 0.0152723 Inhomogeneous summary computed on fixed-seed envelope sample
barcelona K raw_CSR_sample homogeneous CSR 1000 32.6634983 0.0000000 0.0071620 3.6383166 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona L raw_CSR_sample homogeneous CSR 1000 1.2811947 0.0000000 0.0071620 3.1584599 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona F raw_CSR_sample homogeneous CSR 1000 0.0000000 -0.3438515 NA 0.2864816 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona G raw_CSR_sample homogeneous CSR 1000 0.3460185 -0.0100557 0.0011924 0.1240071 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona J raw_CSR_sample homogeneous CSR 1000 -0.0220000 -0.9909004 NA 0.5663784 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona pcf raw_CSR_sample homogeneous CSR 1000 11.6358174 0.3368370 0.0071620 0.0071620 Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona K static_inhomogeneous_sample inhomogeneous Poisson with static intensity 1000 9.9275435 0.0000000 0.0071620 3.6454786 Inhomogeneous summary computed on fixed-seed envelope sample
barcelona K dynamic_inhomogeneous_sample inhomogeneous Poisson with dynamic-corridor intensity 1000 18.7374990 0.0000000 0.0000000 3.1727840 Inhomogeneous summary computed on fixed-seed envelope sample
barcelona L static_inhomogeneous_sample inhomogeneous Poisson with static intensity 1000 0.4103258 0.0000000 0.0071620 3.6454786 Inhomogeneous summary computed on fixed-seed envelope sample
barcelona L dynamic_inhomogeneous_sample inhomogeneous Poisson with dynamic-corridor intensity 1000 0.8323541 0.0000000 0.0000000 3.0367052 Inhomogeneous summary computed on fixed-seed envelope sample
barcelona pcf static_inhomogeneous_sample inhomogeneous Poisson with static intensity 1000 881.3248856 17.8365261 0.0071620 0.0071620 Inhomogeneous summary computed on fixed-seed envelope sample
barcelona pcf dynamic_inhomogeneous_sample inhomogeneous Poisson with dynamic-corridor intensity 1000 306.3279795 18.5591154 0.0071620 0.0071620 Inhomogeneous summary computed on fixed-seed envelope sample
Empty-space F-function summary
city function_name max_positive_deviation max_negative_deviation first_positive_r_km note
madrid F 0 -0.5107259 NA Empty-space F function: observed F above Poisson CSR baseline indicates shorter empty-space distances than expected
barcelona F 0 -0.3438515 NA Empty-space F function: observed F above Poisson CSR baseline indicates shorter empty-space distances than expected
Global second-order CSR tests. The default final run reports Monte Carlo maximum-deviation p-values from saved envelope simulations; MAD/DCLF can be enabled with FDC_RUN_MAD_DCLF=true
city test function_name statistic p_value n_points n_simulations null_hypothesis note
madrid global_envelope K 326.0615188 0.010 1000 100 observed function is not more extreme than CSR simulations by global maximum absolute deviation Monte Carlo p-value computed as (1 + number of simulated maximum absolute deviations >= observed) / (nsim + 1); nsim=100
madrid global_envelope L 5.4216830 0.010 1000 100 observed function is not more extreme than CSR simulations by global maximum absolute deviation Monte Carlo p-value computed as (1 + number of simulated maximum absolute deviations >= observed) / (nsim + 1); nsim=100
madrid global_envelope F 0.5107259 0.010 1000 100 observed function is not more extreme than CSR simulations by global maximum absolute deviation Monte Carlo p-value computed as (1 + number of simulated maximum absolute deviations >= observed) / (nsim + 1); nsim=100
barcelona global_envelope K 32.6634983 0.010 1000 100 observed function is not more extreme than CSR simulations by global maximum absolute deviation Monte Carlo p-value computed as (1 + number of simulated maximum absolute deviations >= observed) / (nsim + 1); nsim=100
barcelona global_envelope L 1.2811947 0.010 1000 100 observed function is not more extreme than CSR simulations by global maximum absolute deviation Monte Carlo p-value computed as (1 + number of simulated maximum absolute deviations >= observed) / (nsim + 1); nsim=100
barcelona global_envelope F 0.3438515 0.010 1000 100 observed function is not more extreme than CSR simulations by global maximum absolute deviation Monte Carlo p-value computed as (1 + number of simulated maximum absolute deviations >= observed) / (nsim + 1); nsim=100
Clark-Evans and Hopkins-Skellam nearest-neighbour CSR tests
city test statistic p_value n_points alternative note
madrid clark_evans 0.5072061 <0.001 1000 clustered (R < 1) Clark-Evans test; No edge correction; Z-test; Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
madrid hopkins_skellam 0.0098993 <0.001 1000 two-sided Hopkins-Skellam test of CSR; using F distribution; Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=106136
barcelona clark_evans 0.6575701 <0.001 1000 clustered (R < 1) Clark-Evans test; No edge correction; Z-test; Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
barcelona hopkins_skellam 0.0166935 <0.001 1000 two-sided Hopkins-Skellam test of CSR; using F distribution; Second-order functions and global Monte Carlo envelopes use a fixed-seed sample where needed; observed function outside envelope indicates departure from CSR at that radius; second-order summaries computed on fixed-seed sample of 1000 points from full pattern n=61875
Madrid L, F, G and J functions with Poisson/CSR references
Madrid L, F, G and J functions with Poisson/CSR references
Barcelona L, F, G and J functions with Poisson/CSR references
Barcelona L, F, G and J functions with Poisson/CSR references

In Madrid, both inhomogeneous L summaries reduce the raw maximum positive L deviation, and the dynamic-controlled L summary reduces it slightly more than the static-controlled summary. In Barcelona, both controls also reduce the raw L deviation, but the static-controlled summary reduces it more than the dynamic-controlled summary. This means the L-function evidence is mixed: dynamic demand helps absorb second-order clustering in Madrid, while the static surface absorbs more of the sampled L-function clustering in Barcelona.

Marked Pattern Diagnostics

Marked tests use sector marks on sampled active-premise patterns after excluding unknown and other. These diagnostics describe whether nearby premises tend to share interpretable sector labels more than expected under random labelling. The class-9-style Poisson LR diagnostics compare a no-interaction model with an interaction model:

Marked-pattern analysis subsample. Sector tests are conditional on classified active premises after excluding unknown and other
city active_total classified_active excluded_active classified_share
madrid 106136 88613 17523 83.5%
barcelona 61875 47812 14063 77.3%
Marked point-pattern diagnostics
city test statistic p_value note
madrid segregation 1.1774136 0.030 Random-labelling/segregation test; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marktable 300.0000000 Nearest-neighbour mark contingency table; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid nearest_neighbor_mark_chisq 39.4808612 0.317 Pearson chi-square test on nearest-neighbour mark contingency table; H0 sector mark of a point is independent of the sector mark of its nearest neighbour; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid nncorr 1.4237511 Nearest-neighbour mark correlation; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid unmarked_poisson_spatial_trend_LR 585.9806175 <0.001 Class-9-style Poisson LR test: H0 ~1 homogeneous Poisson, H1 ~polynom(x,y,2) spatial trend; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_mark_space_interaction_LR 54.0783779 0.005 Class-9-style Poisson LR test: H0 ~polynom(x,y,2)+marks, H1 ~polynom(x,y,2)*marks; rejects mark-space independence after smooth spatial trend; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
barcelona segregation 0.5729571 0.129 Random-labelling/segregation test; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marktable 300.0000000 Nearest-neighbour mark contingency table; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona nearest_neighbor_mark_chisq 29.4973100 0.770 Pearson chi-square test on nearest-neighbour mark contingency table; H0 sector mark of a point is independent of the sector mark of its nearest neighbour; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona nncorr 0.9542163 Nearest-neighbour mark correlation; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona unmarked_poisson_spatial_trend_LR 334.8204850 <0.001 Class-9-style Poisson LR test: H0 ~1 homogeneous Poisson, H1 ~polynom(x,y,2) spatial trend; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_mark_space_interaction_LR 38.1978810 0.145 Class-9-style Poisson LR test: H0 ~polynom(x,y,2)+marks, H1 ~polynom(x,y,2)*marks; rejects mark-space independence after smooth spatial trend; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
Marked second-order cross-function and random-labelling diagnostics
city test sector_i sector_j function_name statistic p_value first_positive_r_km peak_abs_r_km null_hypothesis note
madrid marked_cross_function retail_nonfood hospitality Kcross 317.0899573 0.0152723 7.3306911 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood hospitality Lcross 5.1060247 0.0152723 7.3306911 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood hospitality pcfcross Inf 0.0000000 0.0000000 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood hospitality Gcross 0.3606545 0.0212217 0.7958133 type-j points are Poisson and independent of type-i points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood hospitality Jcross 0.0000000 NA 3.3742484 cross-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood retail_food Kcross 297.2293804 0.0610891 7.5139584 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood retail_food Lcross 4.7771205 0.0610891 7.5139584 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood retail_food pcfcross Inf 0.0000000 0.0000000 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood retail_food Gcross 0.4608021 0.0525101 1.1027113 type-j points are Poisson and independent of type-i points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood retail_food Jcross 0.0002323 0.0262550 2.2579326 cross-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function hospitality retail_food Kcross 283.2653182 0.0916336 7.8041316 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function hospitality retail_food Lcross 4.5095400 0.0916336 7.6208643 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function hospitality retail_food pcfcross Inf 0.0000000 0.0000000 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function hospitality retail_food Gcross 0.3348851 0.0918926 1.1552213 type-j points are Poisson and independent of type-i points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function hospitality retail_food Jcross 0.0015120 0.0262550 3.1112211 cross-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood all Kdot 329.4457497 0.0152723 7.4834139 type-specific points have no excess association with all points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood all Gdot 0.5173113 0.0159163 0.3766850 nearest-neighbour relation from type-specific points to all points follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_nonfood all Jdot 0.0001161 0.0097406 1.5877173 dot-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function hospitality all Kdot 322.5363494 0.0152723 7.7124980 type-specific points have no excess association with all points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function hospitality all Gdot 0.4860958 0.0159163 0.5040151 nearest-neighbour relation from type-specific points to all points follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function hospitality all Jdot 0.0001161 0.0097406 3.1169910 dot-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_food all Kdot 312.0419335 0.0152723 7.4681416 type-specific points have no excess association with all points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_food all Gdot 0.4314733 0.0053054 0.4615717 nearest-neighbour relation from type-specific points to all points follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function retail_food all Jdot 0.0000000 NA 1.4805707 dot-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function all all markcorr 0.3411922 0.0000000 0.0000000 random labelling of sector marks Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid marked_cross_function all all Iest 0.3653424 0.0159163 0.5623747 independence between sector marks Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
madrid random_labelling_Lcross_envelope retail_nonfood hospitality Lcross 0.0000000 NA NA sector marks are randomly assigned to fixed premise locations Global random-labelling envelope with nsim=100; statistic counts outside-envelope radii; Unknown/other sectors excluded; eligible n=88613 from original marked n=106136. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food retail_nonfood Kcross 46.5364969 0.0143241 3.2945386 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food retail_nonfood Lcross 1.7717235 0.0143241 3.2945386 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food retail_nonfood pcfcross Inf 0.0000000 0.0000000 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food retail_nonfood Gcross 0.3479568 0.0090135 0.3920878 type-j points are Poisson and independent of type-i points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food retail_nonfood Jcross 0.1088435 1.3024525 1.3159728 cross-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food hospitality Kcross 34.2533280 0.0286482 3.5738582 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food hospitality Lcross 1.2919033 0.0286482 3.5738582 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food hospitality pcfcross Inf 0.0000000 0.0000000 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food hospitality Gcross 0.2397630 0.0276393 0.4975073 type-j points are Poisson and independent of type-i points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food hospitality Jcross 0.0007401 0.0138196 1.2161289 cross-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_nonfood hospitality Kcross 28.1762699 0.0358102 3.0008950 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_nonfood hospitality Lcross 1.2416108 0.0358102 2.9865709 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_nonfood hospitality pcfcross Inf 0.0000000 0.0000000 independence between sector-specific components Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_nonfood hospitality Gcross 0.3832521 0.0368524 0.3408846 type-j points are Poisson and independent of type-i points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_nonfood hospitality Jcross 0.0022235 0.0138196 1.1470306 cross-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food all Kdot 36.6689644 0.0071620 3.2945386 type-specific points have no excess association with all points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food all Gdot 0.4207473 0.0021770 0.1806885 nearest-neighbour relation from type-specific points to all points follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_food all Jdot 0.0000000 NA 1.0365539 dot-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_nonfood all Kdot 35.9706473 0.0071620 3.4592656 type-specific points have no excess association with all points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_nonfood all Gdot 0.3868502 0.0021770 0.2220509 nearest-neighbour relation from type-specific points to all points follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function retail_nonfood all Jdot 0.0000000 NA 1.0185269 dot-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function hospitality all Kdot 35.2786364 0.0071620 3.4521035 type-specific points have no excess association with all points Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function hospitality all Gdot 0.2369675 0.0065309 0.2786522 nearest-neighbour relation from type-specific points to all points follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function hospitality all Jdot 0.0002959 0.0045068 0.5768648 dot-type nearest-neighbour relation follows the reference process Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function all all markcorr 0.3480675 0.0000000 0.0000000 random labelling of sector marks Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona marked_cross_function all all Iest 0.6043359 0.0021770 1.0863080 independence between sector marks Positive values indicate excess association relative to the reference curve; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
barcelona random_labelling_Lcross_envelope retail_food retail_nonfood Lcross 0.0000000 NA NA sector marks are randomly assigned to fixed premise locations Global random-labelling envelope with nsim=100; statistic counts outside-envelope radii; Unknown/other sectors excluded; eligible n=47812 from original marked n=61875. Computed on reproducible sample of 300 active premises.
Madrid grid sector relative-concentration surfaces
Madrid grid sector relative-concentration surfaces
Barcelona grid sector relative-concentration surfaces
Barcelona grid sector relative-concentration surfaces

The mapped surfaces show log2((sector share in cell) / (sector share citywide)) for the largest harmonised sectors after excluding unknown and other. Cells with fewer than five displayed-sector premises are masked. Values above zero mean the sector is over-represented in that grid cell relative to its citywide share; values below zero mean under-representation.

The marked evidence is restricted to interpretable sector groups. The segregation test evaluates random labelling of sector marks; the marked Poisson interaction LR test evaluates whether sectors have mark-specific spatial trends after a common smooth trend is included; and the nearest-neighbour mark chi-square test evaluates whether a point’s sector is independent of its nearest neighbour’s sector. Sector-specific conclusions are reported only for the cleaned marked sample and should not be generalised to the excluded catch-all categories.

The current marked evidence is stronger in Madrid than in Barcelona. Madrid rejects random labelling in the segregation test and rejects the marked spatial-interaction LR test after the common smooth trend, while the nearest-neighbour mark chi-square test is not significant. Barcelona does not reject random labelling or marked spatial interaction in the current sample, and its nearest-neighbour mark chi-square test is also not significant.

StaticBias And OpportunityGap

StaticBias and OpportunityGap are grid diagnostics, not model coefficients. They identify where the official static residential benchmark and OD-derived dynamic surface diverge.

StaticBias and OpportunityGap summary. Cell percentages are out of n_grid_cells; area percentages are out of total_area_km2
city n_grid_cells total_area_km2 mean_static_bias p10_static_bias p90_static_bias p10_opportunity_gap p90_opportunity_gap opportunity_gap_cells opportunity_gap_pct_cells opportunity_gap_area_km2 opportunity_gap_pct_area oversupply_cells oversupply_pct_cells oversupply_area_km2 oversupply_pct_area
madrid 3003 604.0 0 -0.85 0.92 -0.40 0.58 350 11.7% 73.7 12.2% 348 11.6% 72.3 12.0%
barcelona 586 101.7 0 -1.06 1.19 -0.91 1.03 60 10.2% 12.4 12.2% 60 10.2% 11.6 11.4%
StaticBias maps for Madrid and Barcelona
StaticBias maps for Madrid and Barcelona
OpportunityGap maps for Madrid and Barcelona
OpportunityGap maps for Madrid and Barcelona
Opportunity typology maps
Opportunity typology maps

Class rules:

Typology calculation:

service_intensity = n_active / area_km2

opportunity_gap = z(dynamic_demand) - z(service_intensity)

For each city separately, the map classifies every 500m hexagon using the 60th percentile thresholds:

dynamic_high = dynamic_demand >= Q60(dynamic_demand)

service_high = service_intensity >= Q60(service_intensity)

Opportunity typology counts. pct_cells is out of total_cells; pct_area is out of total_area_km2 within the same city
Map class Exact rule Interpretation
functioning_commercial_core dynamic_high == TRUE and service_high == TRUE high OD-derived demand and high observed active-service intensity
opportunity_gap dynamic_high == TRUE and service_high == FALSE high OD-derived demand but low observed active-service intensity
possible_oversupply_vulnerability dynamic_high == FALSE and service_high == TRUE low OD-derived demand but high observed active-service intensity
low_commercial_exposure dynamic_high == FALSE and service_high == FALSE low OD-derived demand and low observed active-service intensity
city typology n_cells total_cells pct_cells area_km2 total_area_km2 pct_area
madrid functioning_commercial_core 855 3003 28.5% 184.3 604.0 30.5%
madrid low_commercial_exposure 1450 3003 48.3% 273.7 604.0 45.3%
madrid opportunity_gap 350 3003 11.7% 73.7 604.0 12.2%
madrid possible_oversupply_vulnerability 348 3003 11.6% 72.3 604.0 12.0%
barcelona functioning_commercial_core 175 586 29.9% 37.5 101.7 36.9%
barcelona low_commercial_exposure 291 586 49.7% 40.2 101.7 39.5%
barcelona opportunity_gap 60 586 10.2% 12.4 101.7 12.2%
barcelona possible_oversupply_vulnerability 60 586 10.2% 11.6 101.7 11.4%

These classes are within-city relative classes based on 60th percentile thresholds. They are not absolute cross-city rankings of unmet demand.

Cross-City Summary

Cross-city comparison with explicit denominators. Percentages are within city
city total_premises active_premises active_pct_premises sectors n_grid_cells total_area_km2 opportunity_gap_cells opportunity_gap_pct_cells opportunity_gap_pct_area oversupply_cells oversupply_pct_cells oversupply_pct_area
barcelona 68024 61875 91.0% 8 586 101.7 60 10.2% 12.2% 60 10.2% 11.4%
madrid 152473 106136 69.6% 9 3003 604.0 350 11.7% 12.2% 348 11.6% 12.0%
Cross-city corridor exposure summary panel
Cross-city corridor exposure summary panel

Conclusion

The main model result is evaluated as an augmentation test: whether OD-derived dynamic and corridor covariates improve the official static population-income benchmark. The Poisson table gives the complete grid-discretised intensity comparison and confirms severe overdispersion. The fixed-theta negative-binomial sensitivity is therefore the main comparable overdispersion-sensitive ranking: in both cities, dynamic plus corridor exposure improves over static-only, and the full static plus dynamic plus corridor model is the best AIC specification. The dynamic-only model is not treated as the core hypothesis because it does not outperform the static-only benchmark in the current run.

The first-order tests show non-random association between active premises and both static and dynamic covariates, including distance to functional corridors. The second-order diagnostics are consistent with clustering and departures from CSR envelopes in the sampled patterns, while also showing that neither static nor dynamic inhomogeneous controls remove all residual clustering. StaticBias and OpportunityGap maps locate the practical divergence between static residential opportunity, OD-derived demand exposure and observed service intensity.

Data Remarks And Limitations