Basic Terminologies in Time Series Forecasting

Basic Terminologies in Time Series Forecasting

What is Time Series Resampling?

Time series resampling involves changing the frequency of your time-series data. This is done by either:

  1. Upsampling: Increasing the data frequency (e.g., from daily to hourly).
  2. Downsampling: Decreasing the data frequency (e.g., from hourly to daily).

Resampling is useful for analyzing time-series data at different granularities, filling in missing data, or summarizing data over specific time intervals.

Example:


Original Data


1. Downsampling (Daily to Weekly)

We aggregate data from daily to weekly frequency using the mean.


Here, the weekly mean is calculated for all dates up to

2. Upsampling (Daily to Hourly)

We increase the frequency of data from daily to hourly.


What is Time Shifting in Time Series?

Time shifting in time series refers to moving the data forward or backward along the time index. This operation is useful for comparing data across time periods, lag analysis, or computing changes over time.

Types of Time Shifting

  1. Shifting Forward: Moves data to future timestamps (introduces NaN at the start).
  2. Shifting Backward: Moves data to past timestamps (introduces NaN at the end).

Sample Usage:


Jupyter Snaps


Jupyter Snaps


Jupyter Snaps


Jupyter Snaps

Rolling and Expanding

A common process with time series is to create data based off of a rolling mean. The idea is to divide the data into "windows" of time, and then calculate an aggregate function for each window. In this way we obtain a simple moving average.

Instead of calculating values for a rolling window of dates, what if you wanted to take into account everything from the start of the time series up to each point in time? For example, instead of considering the average over the last 7 days, we would consider all prior data in our expanding set of averages.

Junaid .

Data Scientist at Trinity Life Sciences - Generative AI Engineer

1 个月
回复

要查看或添加评论,请登录

Junaid .的更多文章

社区洞察

其他会员也浏览了