[英]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.