Sign in

A whys gent being fascinated by people, math, data, art, code, seeks liberation by the Medium of writing...

Who is an edupreneur?

Who is an entrepreneur?

  • Solves a problem in society and, adds value to the society.
  • Builds a proper team for the goal, and creates employment opportunities.
  • Makes a dedicated process towards the growth of the product and the team.

What should be the mentality of a Happy Entrepreneur?


  • What is Time Series?
  • What is the main focus of Time Series?
  • How is Time Series different from Regression?
  • How to mathematically model Time Series?
  • Why stationarity of the Time Series?
  • What is the Central Idea (the two fundamental steps)?
  • What is ARIMA modeling in short?

There are two broad steps in Time Series.

Step 1

Exploratory Data Analysis and Transform data into stationary data.

Step 2

Model and Predict the dependence structure of the errors.

In this article, I will discuss Step 2, using AR, MA, and ARIMA.

  • What is stationary data?
  • What are the components behind prediction?
  • How future data depend on the past…


You can listen to this youtube tutorial (with clarity and better intuition) of the same thing, and/or read the whole article.

We discuss the following

  • What is Time Series?
  • What is the main focus of Time Series?
  • How is Time Series different from Regression?
  • How to mathematically model Time Series?
  • Why stationarity of the Time Series?
  • What is the Central Idea?
  • What is ARIMA modeling in short?

What is Time Series?

Time series data is a sequence of data over discrete time points.

are the data points over time, where 1,2,3,..,n are the time points.


Load your data (csv format)

data = read.csv("location/filename.csv")

Exploration of Data

Observing the data

head(data) 
tail(data)

Variable Types

str(data)

Understanding the Data

Important Variables

Numerical Variables

  • PercentOfBaseline

Categorical Variables

  • Date
  • AirportName
  • Centroid (of airports)
  • City
  • State
  • Country
  • Geography (of countries)

Comments

  • This is time-series data.
  • The centroid and geography will be only helpful if we want to visualize the data on the world map.
  • Country → State → City → AirportName are factor variables inside the next one.

Focus

  • Data Visualization is the main focus of the project.
  • Due to the structure of Country → State → City → AirportName, the best way to visualize it in an app with dropdown options. (R Shiny App, Tableau, Power BI, etc.)


Load your data

Chile Data

library(dplyr)
data_chile = data %>% filter(Country == "Chile")
chile = data_chile[,c(2,5)]
head(chile)

Convert into time-series data structure*

  • 1,2,3,4,… as time index with no NA values.
library(zoo)
z <- read.zoo(chile, format = "%Y-%m-%d")#zoo series for dates
time(z) <- seq_along(time(z))#sequential data as 1,2,3,4,...
ts_chile = as.ts(z) #conversion into time series data structure
head(ts_chile)
  • Date as a time index with NA values to be removed.
library(zoo)
library(tseries)#for removing na from ts()
z <- read.zoo(chile, format = "%Y-%m-%d")#zoo series for dates
ts_chile =…


Data

head(data) 
dim(data)
> 7247,11 #not good head visualization

Types of variables

str(data)

Important Variables (common sense)

Continuous Variables

  • PercentofBaseline

Categorical Variables

  • Date
  • City (inside State)
  • State (inside Country)
  • Country (We will focus on this important Categorical Factor)
  • Airport Name (inside City)

Observations

This is time-series data.

We don’t know if we have information about all the airports, cities of the four countries. Thus, the movement of PecentofBaseline only matters along time in each of the different airports, cities, and countries given.

Exploratory Data Analysis

Univariate

ggplot(data, aes(x = PercentOfBaseline, fill = "red"))+geom_density(alpha = 0.2)


The first question, that must come to any sane person’s mind, unlike me is that

“Why do we need to seek liberation?”

Let’s do a simple experiment.

  1. Take a long breath slowly.
  2. Hold the breath for 5–10 seconds.
  3. Then release, exhale focusing on the breath slowly
  4. Try to feel and experience the breath movement.

Now, I have a simple task for you.

Rate the feeling of the following three based on your experience.

  1. When you inhaled?
  2. When you kept the breath inside you?
  3. When…


“What is the meaning of equation x = y with respect to life?”


What is the Flow State?


I was meditating. Instead of being calm, I felt stressed out, irritated, and out of control. What exactly happened? How to avoid this?

Srijit Mukherjee

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store