Forecasting Immunity Vaccination progress with Prophet
Tags: datascience
Published: 2021-07-08 11:38:09

---
title: Forecasting Immunity Vaccination progress with Prophet
published: true
date: 2021-06-29 06:42:00 UTC
tags: DataScience
canonical_url: https://apiumhub.com/tech-blog-barcelona/forecasting-immunity-vaccination-progress-with-prophet/
---

To predict herd immunity in a given country given the data, we  studied different parameters coming from country vaccinations dataset. We selected  _total\_vaccinations_ and _people\_fully\_vaccinated\_per\_hundred_ having into account this last ratio as one of the significant ones for measuring immunity progress. If you want to know more about previous exploratory analysis with insightful insights such as the correlation in between the country GPD Growth and immunity progress coming from COVID data, you can have a look [here](https://apiumhub.com/covid-data-analysis/). And in this post we will look at forecasting immunity vaccination progress with Prophet

## Forecasting Immunity Vaccination

As for finding the most significant Forecasting tool, we Line Plotted the cumulative sum of **people\_fully\_vaccinated** progress over time for visualizing the type of growth. As a conclusion, we find out that the pattern follows a type of _logistic growth curve_ , aiming for a behaviour in which herd immunity starts small but increases exponentially, but then starts to decrease towards and asymptote. When thinking about this type of logistic growth curve, there is usually some maximum achievable point: total market size, total population size, etc. This is called the _carrying capacity parameter_, and the forecast should saturate at this point.For our prediction model, the _key concept  is to assume a cap parameter that might be aligned with the vaccination rhythm or behaviour_.

![Screenshot 2021 06 29 at 08.00.36](https://apiumhub.com/wp-content/uploads/2021/06/Screenshot-2021-06-29-at-08.00.36.png "Forecasting Immunity Vaccination progress with Prophet 1")<figcaption>Fig 1. Canonical logistic growth curve and Inmunity progress of Israel, leader in vaccination.</figcaption>

According to data sources, Israel have standed as a vaccination leader. Having different age range groups, a heavily marketed vaccination campaign and an restlessness vaccination rhythm have been key successful factors for achieving these results.

_ _

### Why use Prophet ?

Prophet is a forecasting procedure implemented in R and Python. It is fast and provides completely automated forecasts that can be tuned by hand by data scientists and analysts. It heavily takes into account seasonality and has been used for predicting the impact of facebook campaigns . It indeed offers flexibility and auto tuning of several parameters.

We selected this tool because it allows us to establish a logistic growth forecast model with a **cap parameter as a growing sequence** , following the pattern that herd immunity follows.Besides, it allows to select the prediction days we want  . 

When implementing carrying capacity, we design a python function with numpy that will follow the growth rhythm that has been observed in the cumulative sum of **people\_fully\_vaccinated** ratio.

![Screenshot 2021 06 29 at 08.01.44](https://apiumhub.com/wp-content/uploads/2021/06/Screenshot-2021-06-29-at-08.01.44.png "Forecasting Immunity Vaccination progress with Prophet 2")<figcaption>Fig3. Previous function in which we create the cap increasing sequence <br></figcaption>

In order to scale this model for all countries, we shall instantiate its own logistic growth model taking into account the carrying capacity.  For that , we shall understand that each country has its own growth cap sequence and consistently implement it using the function described in Fig3.   
When creating the machine learning Prophet model, we shall take into account to select the parameter _logistic_ when we instantiate it, periods as the number of days that we want to predict.

![Screenshot 2021 06 29 at 08.03.16](https://apiumhub.com/wp-content/uploads/2021/06/Screenshot-2021-06-29-at-08.03.16.png "Forecasting Immunity Vaccination progress with Prophet 3")<figcaption>Fig4. Prophet Forecasting Model <br></figcaption>

![Screenshot 2021 06 29 at 08.03.46](https://apiumhub.com/wp-content/uploads/2021/06/Screenshot-2021-06-29-at-08.03.46.png "Forecasting Immunity Vaccination progress with Prophet 4")<figcaption>    Fig5. Prophet Forecasting models results for Israel.<br></figcaption>

**Conclusions**

Population has been educated to take safety precautions and measurements for ‘lowering ‘ a **normal distribution** inflection curve . Immunity progress follow a logistic pattern, now  it might be the time to aim and support all initiatives that follow a **logistic curve** and might **increase the carrying capacity**.