Missing data in Time Series

Missing data is a well-known problem in Data Science. Missing data can cause problems in data analysis and modeling. Therefore rows with missing values need to be deleted or the missing values should be filled with reasonable values. The process of filling the missing values is called Imputation. But when dealing with time series this process is referred to as Interpolation.

In this blog, I will talk about some ways to fill missing values in Time Series.

Mean Interpolation is one of the simplest and easiest methods used to fill the missing values. In this method the missing values are filled with the mean.

In this method the missing values are filled with the median.

In this method the missing values are filled with the mode.

Linear Interpolation is creating a straight line between the two points around the missing point and then using that line to create the missing point. In other words its the mid point between two points.

Spline is a special function defined piecewise by polynomials.Splines are functions which match given values at the points x1,…,xNT and have continuous derivatives up to some order at the knots, or the points x2,…,xNT­1. Cubic splines are most common. In this case the function is represented by a cubic polynomial within each interval and has continuous first and second derivatives at the knots. Two more conditions can be specified arbitrarily. These are usually the second derivatives at the two end-points, which are commonly taken as zero; this gives the natural cubic splines.

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