# 016. Year-over-year demand comparison

**Question:** How does observed hourly demand compare between corresponding months of the two years?

## Result

The largest computed metric is 1.529 for 3.0; the smallest is 0.4133 for 6.0. Metric: relative_change (Relative change).

Different weather, availability and missing-hour patterns remain confounders. Means use observed hours only.

![Year-over-year demand comparison](outputs/chart.png)

| mnth | mean_2011 | mean_2012 | hours_2011 | hours_2012 | relative_change |
| --- | --- | --- | --- | --- | --- |
| 1 | 55.51 | 130.6 | 688 | 741 | 1.352 |
| 2 | 74.29 | 149 | 649 | 692 | 1.006 |
| 3 | 87.73 | 221.9 | 730 | 743 | 1.529 |
| 4 | 131.9 | 242.7 | 719 | 718 | 0.839 |
| 5 | 182.6 | 263.3 | 744 | 744 | 0.4421 |
| 6 | 199.3 | 281.7 | 720 | 720 | 0.4133 |
| 7 | 190 | 273.7 | 744 | 744 | 0.4405 |
| 8 | 187 | 288.3 | 731 | 744 | 0.5418 |
| 9 | 177.7 | 303.6 | 717 | 720 | 0.7083 |
| 10 | 166.2 | 280.8 | 743 | 708 | 0.6895 |
| 11 | 142.1 | 212.6 | 719 | 718 | 0.4963 |
| 12 | 117.8 | 166.7 | 741 | 742 | 0.4148 |

The chart shows 12 of 12 result rows; the table previews the first 12 in the analysis-defined order. [Download the full result table](outputs/results.csv). Numerical values are computed from the source; missing results stay unavailable.

## Method

Month-matched means and observation counts, rather than unadjusted monthly totals.

The study uses shared source preparation and reusable statistical routines. Its specific transformations are in [analysis.py](analysis.py), and common model/evaluation code is in [portfolio/methods.py](../../portfolio/methods.py). The [notebook](analysis.ipynb) executes the study and displays the saved results.

## Decision and limitations

Investigate system expansion and service availability before attributing observed growth to behavior.

Historical system rentals measure realized use, not unmet demand or station inventory. Missing hours are unknown. Weather associations do not establish causal effects. 

Related studies may share observations or holdouts. These are focused analytical studies, not independent replications or deployed business systems. Any model refinements informed by these results need new untouched evaluation data. No commercial impact is inferred from an association or backtest.

## Reproduce

From the repository root, after installing `requirements.txt`:

```powershell
python projects/016-year-over-year-demand-comparison/analysis.py
```

Source data are downloaded automatically if absent. Original archives are retained unchanged and checked by SHA-256. The cleaned cache normalizes column names; field-specific changes are visible in [data preparation](../../portfolio/data.py). Runtime evidence is in [receipt.json](outputs/receipt.json).

## Source

[Bike Sharing](https://archive.ics.uci.edu/dataset/275/bike+sharing+dataset), Fanaee-T (2013). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/bikes.json) and [prepared-data audit](../../data/provenance/bikes_prepared.json) record the downloaded files, field coverage and hashes.
