问题描述
我试图找到速度-时间数据序列的自相关,并且在进行了几次尝试之后,我仍然不知道该如何进行。 让我先一步一步走吧:
- 我有如下数据系列
Index u
0.01 10.78
0.02 10.93
0.03 10.33
....
....
100 10.65
- 自相关公式
P(s)=<u(t)*u(t+s)>/<u^2>
x=len(df/2) #Lets say df is the above dataframe
a=np.arange[0,50.01,0.01]
b=np.arange[0.01,0.01]
for s in a:
P(s)=0
for t in b:
P(s)=P(s)+(u(t)*u(t+s))
P(s)=P(s)/x #This creates the numerator of the above
equation at a fixed s value
Auto_corr=P(s)/P(s=0) #This is the auto-correlation value
corresponding to a s value and I want this
to be stored in a series corresponding to
the resp s value.
x_axis=R.index #Lets consider R as the name of new data series
y_axis=R['Auto_corr']
plt.plot(x_axis,y_axis,'r-.',label="AutoCorrelation")
plt.grid()
plt.show
- 最后我需要绘制一个图,其中y轴表示P(s),x轴表示s,即0.01、0.02、0.03 ... 50。情节应该看起来像这样:
注意:图像中的左一个。
我正在使用Python进行编码部分,无法获得令人满意的结果。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)