Accessibility and isolation (quakecascade.access)¶
What it computes¶
Given a cost matrix \(c_{ij}\) from demand units \(i\) (rows) to facilities \(j\)
(columns), such as RoadNetwork.travel_time_matrix(origins, facilities):
- Decay \(f(c)\), a weight in \([0, 1]\) that is exactly zero beyond the threshold \(T\) and for unreachable pairs.
- Hansen potential (Hansen 1959): \(A_i = \sum_j S_j\, f(c_{ij})\).
- Two-step floating catchment area (Radke & Mu 2000; Luo & Wang 2003; decayed catchments: Luo & Qi 2009):
supply per head that unit \(i\) can claim. The population-weighted access conserves supply: \(\sum_i P_i A_i = \sum_{j:\,D_j>0} S_j\) (tested). * Nearest time per unit, and the isolation status of each unit before and after an event. * Population by status, the people in each isolation category.
Decay kinds¶
decay |
\(f(c)\) for \(c \le T\) | Parameter | Source |
|---|---|---|---|
cumulative |
\(1\) | – | Wachs & Kumagai (1973) |
linear |
\(1 - c/T\) | – | Luo & Qi (2009) cone |
exponential |
\(e^{-\beta c}\) | \(\beta\) (required) | gravity family |
gaussian |
\(\dfrac{e^{-\frac12 (c/T)^2} - e^{-\frac12}}{1 - e^{-\frac12}}\) | – | Dai (2010), Eq. 2 |
gaussian_sigma |
\(e^{-c^2/(2\sigma^2)}\) | \(\sigma\) (required) | Kwan (1998) |
power |
\(\min(1, c^{-\beta})\) | \(\beta\) (required) | gravity family |
logistic |
\(1/(1 + e^{4(c - h)/h})\) | half-weight cost \(h\) (required) | – |
half_weight_time(kind, param, T) gives the cost at which a decay reaches
0.5, a single number to compare choices.
Isolation status¶
A unit is reachable when its time is finite and, if limit_s is given, not
above it. With \(d = t_\text{post} - t_\text{pre}\) and tolerance \(\tau\)
(worse_tol_s):
| Status | Rule |
|---|---|
newly_cut_off |
reachable before, not after |
always_cut_off |
reachable neither before nor after |
worse |
both reachable, \(d > \tau\) |
same |
both reachable, \(\lvert d\rvert \le \tau\) |
improved |
both reachable and \(d < -\tau\), or reachable only after |
no_pre_time / no_post_time |
the time is unknown (NaN), no category |
This is the pre/post comparison used in accessibility-loss studies of
network disruption (e.g. Sohn 2006); always_cut_off units had no access
before the event either and are reported apart, so they are not counted as
event losses.
Missing data¶
inf= unreachable,NaN= unknown. They are never interchanged.- 2SFCA: a unit whose whole cost row is unknown gets
NaNandno_travel_time. A unit with an unknown population adds nobody to any catchment, so every ratio it touches is an upper bound and the units that reach those facilities arepartial. A facility with unknown supply is left out (no_supply) and the units that reach it arepartial. A facility with nobody in its catchment has no ratio (NaN,empty), orno_demandwhen the only residents within reach have unknown numbers; a facility whose every cost is unknown (for example one off the network) isno_travel_time. None of these carries a catchment number. - Hansen: facilities with unknown supply are skipped, so the potential is a
lower bound; a unit that reaches only such facilities gets
NaN, not 0. - Every decay parameter (\(\beta\), \(\sigma\), the power exponent, the logistic midpoint) must be positive; \(\beta \le 0\) would weight every reachable facility 1.
nearest_time: some unknown entries with a finite minimum givepartial(the value is an upper bound); unknown entries and no reachable facility giveNaNandno_travel_time.population_by_status: a category with units that all lack population sums toNaN; an empty category is a true0.
Parameters¶
| Parameter | Unit | Default | Source / note |
|---|---|---|---|
threshold \(T\) |
cost unit | required | catchment size, the caller's |
decay |
– | cumulative |
table above |
param |
per kind | required where the kind has one | – |
limit_s |
s | none | reachability bound |
worse_tol_s \(\tau\) |
s | required | no published default; 0 = exact comparison |
Caveats¶
- 2SFCA access is a ratio (supply per head); its absolute value depends on the supply unit (beds, places) and should not be compared across supply types.
- The threshold and decay drive the result as much as the network does; report a sensitivity run over plausible \(T\).
Example¶
import numpy as np
from quakecascade import access
cost = np.array([[5.0, 15.0], [8.0, 3.0]]) # minutes, demand x facility
acc = access.two_step_fca(cost, supply=[10, 20], demand=[100, 200], threshold=10)
print(acc["access"].round(4).tolist()) # [0.0333, 0.1333]
pre = access.nearest_time(cost)["nearest_time"]
post = access.nearest_time(np.array([[np.inf, 25.0], [9.0, np.inf]]))["nearest_time"]
status = access.isolation_status(pre, post, limit_s=20, worse_tol_s=0.5)
print(status["isolation_status"].tolist()) # ['newly_cut_off', 'worse']
print(access.population_by_status(status, [100, 200]).head(2))
Provenance¶
Decay functions, Hansen and 2SFCA are ported from the PlanX engine
(engine/accessibility.py, same author); the Gaussian kind of the PlanX
engine is gaussian_sigma here, and gaussian is the threshold-normalised
form of Dai (2010) used by the DİRİ 2SFCA, re-implemented. The isolation
categories re-implement the DİRİ cascade comparison; the tolerance there
was a fixed relative 1 %, here it is an explicit absolute argument.
References¶
- Dai, D. (2010). Black residential segregation, disparities in spatial access to health care facilities, and late-stage breast cancer diagnosis in metropolitan Detroit. Health & Place 16(5), 1038–1052. doi:10.1016/j.healthplace.2010.06.012
- Hansen, W. G. (1959). How accessibility shapes land use. Journal of the American Institute of Planners 25(2), 73–76. doi:10.1080/01944365908978307
- Kwan, M.-P. (1998). Space-time and integral measures of individual accessibility: a comparative analysis using a point-based framework. Geographical Analysis 30(3), 191–216. doi:10.1111/j.1538-4632.1998.tb00396.x
- Luo, W., & Qi, Y. (2009). An enhanced two-step floating catchment area (E2SFCA) method for measuring spatial accessibility to primary care physicians. Health & Place 15(4), 1100–1107. doi:10.1016/j.healthplace.2009.06.002
- Luo, W., & Wang, F. (2003). Measures of spatial accessibility to health care in a GIS environment: synthesis and a case study in the Chicago region. Environment and Planning B 30(6), 865–884. doi:10.1068/b29120
- Radke, J., & Mu, L. (2000). Spatial decompositions, modeling and mapping service regions to predict access to social programs. Geographic Information Sciences 6(2), 105–112. doi:10.1080/10824000009480538
- Sohn, J. (2006). Evaluating the significance of highway network links under the flood damage: an accessibility approach. Transportation Research Part A 40(6), 491–506. doi:10.1016/j.tra.2005.08.006
- Wachs, M., & Kumagai, T. G. (1973). Physical accessibility as a social indicator. Socio-Economic Planning Sciences 7(5), 437–456. doi:10.1016/0038-0121(73)90041-4