access.fca.two_stage_fca

access.fca.two_stage_fca(demand_df, supply_df, cost_df, max_cost=None, demand_index='geoid', demand_name='demand', supply_index='geoid', supply_name='supply', cost_origin='origin', cost_dest='dest', cost_name='cost', weight_fn=None, normalize=False)[source]

Calculation of the two-stage floating catchment accessibility ratio, from DataFrames with precomputed distances. This is accomplished through a single call of the access.weighted_catchment method, to retrieve the patients using each provider. The ratio of providers per patient is then calculated at each care destination, and that ratio is weighted and summed at each corresponding demand site. This is based on the original paper by Luo and Wang [Luo and Wang, 2003], as extended by Luo and Qi [Luo and Qi, 2009] and McGrail and Humphreys [McGrail and Humphreys, 2009].

Parameters:
demand_dfpandas.DataFrame

The origins dataframe, containing a location index and a total demand.

demand_originstr

is the name of the column of demand_df that holds the origin ID.

demand_valuestr

is the name of the column of demand_df that holds the aggregate demand at a location.

supply_dfpandas.DataFrame

The origins dataframe, containing a location index and level of supply

supply_originstr

is the name of the column of supply_df that holds the origin ID.

supply_valuestr

is the name of the column of supply_df that holds the aggregate demand at a location.

cost_dfpandas.DataFrame

This dataframe contains a link between neighboring demand locations, and a cost between them.

cost_originstr

The column name of the locations of users or consumers.

cost_deststr

The column name of the supply or resource locations.

cost_namestr

The column name of the travel cost between origins and destinations

weight_fnfunction

This fucntion will weight the value of resources/facilities, as a function of the raw cost.

max_costfloat
This is the maximum cost to consider in the weighted sum;

note that it applies _along with_ the weight function.

normalizebool

True to normalize the FCA series, by default False.

Returns
——-
accesspandas.Series

A – potentially-weighted – two-stage access ratio.