How to deal with multiple time series in MATLAB?
    12 views (last 30 days)
  
       Show older comments
    
I have some smart meter data which shows gas and electricity meter readings at 30 min intervals for about two years, for 16000 households. The date is stored in separate .mat files, with a datetime variable for the timestamp and a double variable for the actual data. Some of the data has gaps in, from a few hours to several days or weeks. I want to create a timeseries object containing all of the data and a continuous timestamp for the two year period, so that I can then interpolate the gaps. Another option would be to use snychronize, but for this it seems the 16000 data series need to be in individual timeseries objects, which seems cumbersome. I have tried this with timeseries objects and financial time series but cannot get all of the 16000 data series and corresponding timestamps into one time series object. When I try to add more than one series to an existing timeseries object, it is added "in series" rather than "in parallel" (i.e. data in the Data:1 column). When I tried with a financial time series I had difficulties preparing the datetime data in a cell array. Any ideas what the most efficient way to do this is? Thanks Russell
0 Comments
Answers (1)
  Nikhil Vyas
      
 on 26 Apr 2016
        The approach I would use is: merge the MAT files, initialize the N x 16000 timeseries.
So basically after merging, your final MAT file would have the following data:
fin_MAT
Time         Value1   Value2 ... Value16000
datetime1    val11    val21  ... val160001
datetime2    val22    val22  ... val160002
.            .        .      ... .
.            .        .      ... .
.            .        .      ... .
datetimeX    val1X    val2X  ... val16000X
From this, you can create a timseries using something like the following:
fin_ts = timeseries(fin_MAT(:, 2:end), <your_time_vector>, 'name', 'xyz');
2 Comments
  Sriram Jayachandran Raguraman
 on 28 Jun 2020
				Hello Russell,
I'm having a similar problem for my project. could you tell me how to solve this problem ? How did you organise the data and passed it to the network ?
See Also
Categories
				Find more on Time Series Collections in Help Center and File Exchange
			
	Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

