## 3 The Bike-Share Case
### Evaluation--Formulation of Simulation and ML Models
#### 3.4.2 Causal Inference  
We apply a causal inference model proposed by [PERSON] et al. using a Bayesian framework [57] to infer the impact of incentives on rental and return flows.  
The model predicts the impact of an intervention (e.g., Bike Angel incentives) on the response metric (e.g., demand uplift) by regressing its pre-intervention time series on covariates unaffected by the intervention. It then generates a counterfactual response for the post-intervention period based on these \"untreated\" covariates. The impact is the difference between the observed and predicted counterfactual values.  
To identify suitable contemporaneous correlates, we first compute similarity scores for station pairs in the demand cluster using the bike utilisation metric (as outlined below). For each station, we then select the time series of one or more of the closest stations.  
**Stage 1:** Clustering by Demand Symmetry  
**Data:** Hourly bike utilisation for each station (Bike utilisation (percentage of bikes rented) = Dock availability/Capacity).  
Steps:  
Load and preprocess the data:  
Pivot the dataset to create a 24 h utilisation vector for each station and day.  
Normalise the utilisation vectors for each station using MinMax scaling.  
For each pair of stations (21 pairs for seven stations):  
Extract the 24 h utilisation vectors for corresponding days for both stations.  
Calculate the L2 distance between the normalised vectors for each day.  
Compute the average L2 distance across all days as the final similarity metric for the station pair.  
Store the average L2 distances for all station pairs in a table, sorted by similarity (lowest to highest distance).  
In the second stage, we use the causal impact model to estimate the effects of incentives. The demand censoring step provides two continuous time streams for the unincentivised and incentivised demands. For the target station, we pass the incentivised demands for the post-intervention period to the model to infer what would have happened without the intervention. The inputs include the unincentivised demands from correlates, which are stations with similar demand patterns (identified in stage one).  
**Stage 2:** Causal Impact Model for Estimating Incentive Effects  
**Data:** Base (unincentivised) and incentivised rental/return demands for each station. Steps:  
* Prepare the Data:
* Filter and rename the columns to distinguish between base and incentivised demands (e.g., \"Rentals Normal\" for base, \"Rentals Uplift\" for incentivised).
* Pivot the data to create a time series of rentals and returns for each station, with pre-intervention values using base demand and post-intervention values using incentivised demand.
* Define the pre- and post-intervention periods based on the intervention days.
* Run the Causal Impact Model:
* Use the base demands from correlated stations (identified in Stage 1) as covariates and the incentivised demand for the target station as the response series.
* The model infers the base demand for the target station during the post-intervention period (had no incentives been applied).
* Collate and Average Results:
* Collect the target station's inferred rental/return uplift (i.e., the difference between the incentivised and predicted base demand) across all intervention days.
* Average the results to create a typical week, showing hourly estimated percentage uplifts for rentals and returns.  
The chart in Figure 7 compares the counterfactual (or inferred base) and incentivised rental demands for a given day in the test period. The orange band represents a 90% prediction interval around the point predictions for unincentivised demands. Given this interval, the causal inference model reported statistically significant effects across all test days, indicating that 90% of probable untreated demand values are expected to fall below the observed incentivised demands.