簡體   English   中英

分析間隔不均勻的時間序列

[英]Analyzing unevenly spaced timeseries

我的任務是分析與許多天氣參數相關的水箱中的輸入流量。 從狹義上講,我必須調查這些變量可能對感興趣的變量產生的任何可能影響。 話雖如此,我不知道應用哪種方法,因為我只考慮 Pearson 的相關系數。 即使使用這個,采樣率也不同,因為天氣狀況每 3 小時測量一次,而輸入流量每 5 分鍾測量一次。 我應該平均超過 3 小時,忽略與天氣數據集時間戳不對應的數據,還是您會提出其他建議?

weather = [ (1.21,0), (1.08, 0.5), (1.04, 1), (1.02, 1.5)]
input_flow = [ (120,0), (124,1)]

此類數據的表示,其中第一個索引是參數的值,而第二個索引是以秒為單位的時間

實現這一目標的一種方法:`

import numpy as np

a = np.arange(100).reshape(-1,1)
b = np.arange(10).reshape(-1,1)

#How do we -expand- make "B" a set of points the same width as "A"?

expansion_factor = a.shape[0]/b.shape[0]
b_expanded = np.repeat(b, expansion_factor, axis=0)

#How can we combine input data using A and B ?
c = np.concatenate((a, b_expanded),axis=1)

#Could this be what we want to achieve ?
c

可以使用稀疏矩陣作為另一種方式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM