Correlation of 2 time dependent multidimensional signals (signal vectors)

前端 未结 3 1154
有刺的猬
有刺的猬 2020-11-29 13:29

I have a matrix M1 , each row of which is a time-dependent signal.

And I have another matrix, M2, of the same dimensions, each row of which is also a time dependent

3条回答
  •  春和景丽
    2020-11-29 14:10

    not knowing enough of numpy array magic, I'd just pick out the rows, feed each pair individually to corrcoeff

    [np.corrcoef(i,j)[0][1] for i,j in zip(a,b)]
    

    for a np.array column output

    c, c.shape = np.array([np.corrcoef(i,j)[0][1] for i,j in zip(a,b)]), (a.shape[0], 1)
    

    I'm sure there's better using numpy broadcast/indexing features

提交回复
热议问题