对于DRGroot模型的社交网络,Python中的lhs单元特征向量有什么不对

2024-04-25 23:32:44 发布

您现在位置:Python中文网/ 问答频道 /正文

Python for DRGroot社交网络模型中的lhs单位特征向量有什么错:

The influence array at time 0 is:
1/3, 1/3 1/3
1/2, 1/2, 0
0, 0.25, 0.75

It is suppose to converge to the array:
3/11 4/11 4/11
3/11 4/11 4/11
3/11 4/11 4/11

假设可以通过在时间0取数组的左侧单位向量来得到收敛数组。你知道吗

我的线性代数有时会生锈,我想在python中尝试一下:

import numpy as np
from scipy.linalg import eig
np.set_printoptions(precision=4)
limT = np.array([(0.33,0.33,0.33),(0.5,0.5,0.0),(0.0,0.25,0.75)])
w, vl, vr = eig(limT, left=True)
lhs = vl.conj().T.dot(limT)
>>> lhs
array([[-0.0678,  0.0335,  0.0335],
       [-0.4669, -0.6231, -0.6231],
       [-0.2958, -0.1006,  0.3904]])
lhs/np.linalg.det(lhs)
array([[ -2.385 ,   1.1795,   1.1795],
       [-16.4266, -21.9221, -21.9221],
       [-10.4052,  -3.5378,  13.7349]])

最后的数组显然不是:

3/11 4/11 4/11
3/11 4/11 4/11
3/11 4/11 4/11

我可能误解了几个问题,感谢你的帮助。你知道吗


Tags: toimport网络forisnp数组array