label=f"$\sigma = {s} \Rightarrow k={0.4}$")

plt.xlim(-0.6, 10.6)
plt.ylim(0.001, 1)
plt.legend()
plt.yscale("log")

ax = plt.gca()
ax.yaxis.set_major_formatter(PercentFormatter(xmax=1, decimals=1))

#%%

# max tracing capacity
m = 2147483647

susp = read_batch_run("data/suspContainment.zip", rValues=True)

#%%

df = susp[(susp.tracingCapacity == m) & (susp.unrestricted == "yes")]
#df = suspT

hue = sns.color_palette(n_colors=3)

g = sns.relplot(x="date",
                y="cases",
                estimator="mean",
                ci="q95",
                palette=hue,
                hue="sigma",
                col="containment",
示例#2
0
            label=f"$\sigma = {s} \Rightarrow k={0.4}$")

plt.xlim(-0.6, 10.6)
plt.ylim(0.001, 1)
plt.legend()
plt.yscale("log")

ax = plt.gca()
ax.yaxis.set_major_formatter(PercentFormatter(xmax=1, decimals=1))

#%%

# max tracing capacity
m = 2147483647

susp = read_batch_run("data/suspContainment3.zip", r_values=True)

#%% Unrestricted

df = susp[(susp.tracingCapacity == 0) & (susp.unrestricted == "yes") &
          (susp.containment == "INDIVIDUAL_ONLY")]

fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3))

hue = sns.color_palette(n_colors=3)

sns.lineplot(x="date",
             y="cases",
             estimator="mean",
             ci="q95",
             ax=ax,
示例#3
0
                s=40,
                data=act_week,
                ax=ax)
#sns.scatterplot(x="date", y="notAtHomeExceptLeisureAndEdu", label="notAtHome (Weekend)", s=40, data=act_wend, ax=ax)

ax.xaxis.set_major_formatter(dateFormater)

plt.ylabel("activity participation in %")
plt.legend(loc="best")

plt.xlim(datetime.fromisoformat("2020-03-01"),
         datetime.fromisoformat("2020-11-01"))

#%% Base calibration

df_base = read_batch_run("data/paper.zip")

#%%

aggregate_batch_run("data/paper.zip")

#%%

fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3.8))

df = df_base[(df_base.unrestricted == "yes") & (df_base.diseaseImport == "yes")
             & (df_base.theta == 1.36e-5)]

rki.plot.scatter(x="date",
                 y=["cases"],
                 label=["RKI Cases"],
示例#4
0
                s=40,
                data=act_week,
                ax=ax)
#sns.scatterplot(x="date", y="notAtHomeExceptLeisureAndEdu", label="notAtHome (Weekend)", s=40, data=act_wend, ax=ax)

ax.xaxis.set_major_formatter(dateFormater)

plt.ylabel("activity participation in %")
plt.legend(loc="best")

plt.xlim(datetime.fromisoformat("2020-03-01"),
         datetime.fromisoformat("2020-07-01"))

#%% Section 3-1

df31 = read_batch_run("data/section-3-1.zip")

#%%

fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3.8))

rki.plot.scatter(x="date",
                 y=["cases"],
                 label=["RKI Cases"],
                 color=palette[4],
                 ax=ax,
                 logy=True)

sns.lineplot(x="date",
             y="cases",
             estimator="mean",
示例#5
0
#%%

sns.set_style("whitegrid")
sns.set_context("paper")

dateFormater = ConciseDateFormatter(AutoDateLocator())

palette = sns.color_palette()

#%%

rki, hospital = read_case_data("berlin-cases.csv", "berlin-hospital.csv")

#%%  Graphs for outdoor / indoor runs

outdoor = read_batch_run("data/outdoor.zip")

#%%

fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3.8))
hue = sns.color_palette(n_colors=2)

rki.plot.scatter(x="date",
                 y=["cases"],
                 label=["RKI Cases"],
                 color=palette[4],
                 ax=ax,
                 logy=True)

sns.lineplot(x="date",
             y="cases",
            label=f"$\sigma = {s} \Rightarrow k={0.4}$")

plt.xlim(-0.6, 10.6)
plt.ylim(0.001, 1)
plt.legend()
plt.yscale("log")

ax = plt.gca()
ax.yaxis.set_major_formatter(PercentFormatter(xmax=1, decimals=1))

#%%

# max tracing capacity
m = 2147483647

susp = read_batch_run("data/suspContainment3.zip", r_values=True)

#%% Unrestricted

df = susp[(susp.tracingCapacity == 0) & (susp.unrestricted == "yes") &
          (susp.containment == "INDIVIDUAL_ONLY")]

fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3))

hue = sns.color_palette(n_colors=3)

sns.lineplot(x="date",
             y="cases",
             estimator="mean",
             ci="q95",
             ax=ax,
示例#7
0
#%%

sns.set_style("whitegrid")
sns.set_context("paper")

dateFormater = ConciseDateFormatter(AutoDateLocator())

palette = sns.color_palette()

#%%

rki, hospital = read_case_data("berlin-cases.csv", "berlin-hospital.csv")

#%%  Graphs for outdoor / indoor runs

outdoor = read_batch_run("data/outdoor.zip")

#%%

fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3.8))
hue = sns.color_palette(n_colors=2)

rki.plot.scatter(x="date",
                 y=["cases"],
                 label=["RKI Cases"],
                 color=palette[4],
                 ax=ax,
                 logy=True)

sns.lineplot(x="date",
             y="cases",
示例#8
0
ev_work_05 = events_05[events_05.actType.str.contains("work")]

#%%

p = np.array([0.25, 0.5, 0.75])

# Effect of remaining fraction is roughly quadratic

print(ev_work.maxGroupSize.quantile(p))
print(ev_leis.maxGroupSize.quantile(p))
print(ev_visit.maxGroupSize.quantile(p))
print(ev_errands.maxGroupSize.quantile(p))

#%%

gs = read_batch_run("data/groupSizes5.zip")

#%%

for cm in set(gs.contactModel):

    df = gs[gs.contactModel == cm]

    fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3.8))
    hue = sns.color_palette(n_colors=3)

    #rki.plot.scatter(x="date", y=["cases"], label=["RKI Cases"], color=palette[4], ax=ax, logy=True)

    sns.lineplot(x="date",
                 y="cases",
                 estimator="mean",
示例#9
0
sns.set_style("whitegrid")
sns.set_context("paper")

dateFormater = ConciseDateFormatter(AutoDateLocator())

palette = sns.color_palette()


#%%
rki, hospital = read_case_data("berlin-cases.csv", "berlin-hospital.csv")
#rki, meldedatum, hospital = read_case_data("/Users/sebastianmuller/git/public-svn/matsim/scenarios/countries/de/episim/original-data/Fallzahlen/RKI/berlin-cases.csv", "/Users/sebastianmuller/git/public-svn/matsim/scenarios/countries/de/episim/original-data/Fallzahlen/RKI/berlin-cases-meldedatum.csv", "/Users/sebastianmuller/git/public-svn/matsim/scenarios/countries/de/episim/original-data/Fallzahlen/Berlin/berlin-hospital.csv")

#%%  Graphs for outdoor / indoor runs

outdoor = read_batch_run("data/outdoor.zip")

#%% 

fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3.8))
hue = sns.color_palette(n_colors=2)

rki.plot.scatter(x="date", y=["cases"], label=["RKI Cases"], color=palette[4], ax=ax, logy=True)

sns.lineplot(x="date", y="cases", estimator="mean", ci="q95", ax=ax,
             style="tracingCapacity", hue="furtherMeasuresOnOct1", palette=hue, 
             data=outdoor)


ax.xaxis.set_major_formatter(dateFormater)
ax.yaxis.set_major_formatter(ScalarFormatter())
        pass

h_bound = pd.DataFrame(scaled, columns=["size"])

#%%

p = np.array([0.1, 0.25, 0.5, 0.75, 0.9])

# Effect of remaining fraction is roughly quadratic

print(h_bound['size'].quantile(p ** 1.6))    


#%%

gs = read_batch_run("data/groupSizes3.zip")

#%%

fig, ax = plt.subplots(dpi=250, figsize=(7.5, 3.8))

palette = sns.color_palette(n_colors=3)

rki.plot.scatter(x="date", y=["cases"], label=["RKI Cases"], ax=ax, logy=True)

#sns.lineplot(x="date", y="cases", hue="remaining", style="bySize", palette=palette, ci=None, data=df, ax=ax)
sns.lineplot(x="date", y="cases", hue="sigma", style="bySize", palette=palette, 
             ci=None, data=gs[gs.remaining==0.25], ax=ax)


plt.ylim(bottom=1)