How to calculate differences between time series?

miner77miner77 Member Posts: 2 Contributor I
edited November 2018 in Help
Hello,

I have time series from different markets and would like to calculate the price delta between the markets.
For each market I have a cvs file with following columns: Market, Time stamp, Price.
As any price change triggers a new data entry, the time stamps from each market also differ.

How can I transform the time series data within rapidminer to calculate the price differences between the different markets?
Any recommendations?

Thanks!

Answers

  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    This requires a non-trivial process. One approach is to create a new field that extracts the desired time-resolution from the time stamp, e.g. day. This can be done with the Date to Numerical operator. Be sure to set the reference date to "epoch".

    Then aggregate by this attribute and calculate e.g. the average of the prices.

    That will result in a dataset where each time series has at most one value per day, and then you can calculate the difference of the daily average prices.

    If some of the data has missing values for some days, you can specify the day attribute as id and use Fill Data Gaps and Replace Missing Values (Series) to replace those missing values in the desired fashion.

    Happy Mining!
    ~Marius
Sign In or Register to comment.