In this jupyter notebook, I will try to estimate how much more infectious Delta is than the 'original' COV-19 strain. Here, I define 'original' as the ensemble of viruses that spread from 2020 through June 2021.

The approach will be as follows:

- Download the NYT database, and normalize the COVID cases to each state's population.
- For each state, I will find the new cases reported each day -- this data oscillates wildly and needs to be smoothed. Though most analyses these days are done by taking the rolling average, another approach is to use wavelets to identify the sources of variation and smooth them out. I used the
`pywt`

package to do this. - Calculate a poor man's $R_{eff}$ by dividing the total cases at week t by the cases reported at week t-1.
- Cluster the states according to their $R_{eff}$ behavior by finding the K-nearest neighbors for each state, then doing leiden clustering.
- Identify the peak $R_{eff}$ for the original strain (prior to July 2021), and identify the peak $R_{eff}$ for delta (posterior to July 2021) for each cluster, compare and contrast.

In [1]:

```
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import datetime as dt
sys.path.append('./utils')
# see https://github.com/dangeles/dangeles.github.io/blob/master/jupyter/utils/{covid_utils, cfr}.py
import covid_utils as cv
import cfr
df = cfr.fetch_data()
```

In [12]:

```
smooth = cfr.smooth_active(df, level=3) # wavelet reconstruction, per state
pca = cfr.pca_plot(smooth, 'CasesPerPeriod', n_comps=4, plot=False)
groups = cfr.partition(pca, smooth) # leiden clustering
fig, ax = cfr.plot_partitions(smooth, 'CasesPerPeriod', groups,
pivot_kwargs={'transform': lambda x: x})
fig.suptitle('Weekly Recorded Cases', fontsize=20)
ax[0].set_ylabel('Daily Cases Per Million Inhabitants')
plt.tight_layout()
```

In [3]:

```
pca = cfr.pca_plot(smooth, 'DeathsPerPeriod', n_comps=4, plot=False)
groups = cfr.partition(pca, smooth)
fig, ax = cfr.plot_partitions(smooth, 'DeathsPerPeriod', groups,
pivot_kwargs={'transform': lambda x: x})
fig.suptitle('Weekly Recorded Deaths', fontsize=20)
ax[0].set_ylabel('Daily Deaths Per Million Inhabitants')
plt.tight_layout()
```