在python中通过最小二乘法查找未知数

时间:2019-04-20 07:57:29

标签: python python-3.x

我在使用关系Ax = b的最小二乘法估计参数时遇到问题。我有xb的值,而A是一个9 x 9的矩阵,包含下面给出的未知数

A = np.array([[R,S,0,0,0,T,0,0,0],
              [Q,R,S,0,0,0,T,0,0],
              [0,Q,R,S,0,0,0,T,0],
              [0,0,Q,R,S,0,0,0,T],
              [0,0,0,Q,R,S,0,0,0],
              [P,0,0,0,Q,R,S,0,0],
              [0,P,0,0,0,Q,R,S,0],
              [0,0,P,0,0,0,Q,R,S],
              [0,0,0,P,0,0,0,Q,R]])

x = np.array([[11], [20], [13], [43], [5], [63], [72],[84], [96]])

b = np.array([[10], [2], [4], [3], [5], [1], [7],[6], [9]])

P = (W + X)

Q = (W + 2*Y)

R = (2*W - 0.1)

S = (W - X)
T = (W - 2*Y)

我需要获取WXY的值。 任何帮助将不胜感激

0 个答案:

没有答案