0
1

More than 3 years have passed since last update.

COVID-19の感染者数をProphetで予測 更新

Posted at

概要

2週間前にProphetで予測した感染者数を最新のデータで再度予測した
差分だけを記載する

  • 実施: 2020年12月04日
  • パケージ:Prophet

Prophetで感染者数予測

2週間前のProphet予測では12月上旬は3000人を超えていたが、いまは幸い2500人くらいとなっている
この先30日の国内感染者数予測は下図となった
傾向は前回の予測同様、12月中旬に向けていったん減少するが、その後増加するらしい
image.png
試しに60日先まで予測すると下図となった
12月にいったん減少するが第一波、二波の後にあった小康状態が今回はなく、1月はずっと増加する予測
現実味を帯びた嫌な波形になったように感じる
image.png

今回は国内感染の陽性率も予測させてみた
データ更新以外のコードは前回の続き

df_ratio = pd.DataFrame()
df_ratio['ds'] = pd.to_datetime(df_dom['DS'])
df_ratio['y'] = df_dom['pos_def'] / df_dom['test_def'] * 100   # 国内陽性率

m = Prophet(yearly_seasonality=True, weekly_seasonality=True, daily_seasonality=True)
m.fit(df_ratio[95:])     # 5月までの生データが暴れていたので前半をオミット
future = m.make_future_dataframe(periods=30, freq='D', include_history=True)
forecast = m.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail()
fig = m.plot(forecast, figsize=(20, 10))
ax = add_changepoints_to_plot(fig.gca(), m, forecast)
ax = fig.gca()
ax.set_title("Positive / Tested", size=16)
ax.set_xlabel("date", size=16)
ax.set_ylabel("Ratio (%)", size=16)
ax.tick_params(axis="x", labelsize=14)
ax.tick_params(axis="y", labelsize=14)

微増といったところか…
PCR検査は感染者数増加に追い付いていると考えられる
image.png

なお、空港検査でのPositive判定予測は下図となった
image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1