04-18-2015, 10:12 AM
So here we have a useful programme called LSQS.
If you have a body of n vector observations & wish to fit your data in some linear relationship
a*V1+b*V2+c*V3.....=V
enter V1 in the first column of M1, V2 in the second column of M1....Vn in the nth column & V in the n+1th column.
The programme LSQS calculates the values of co-efficients a,b,c.... such that the errors in the resulting values of V are minimised.
The co-efficients are returned in Ans in Home view.
LSQS
SIZE(M1)►L1:
Ans(1)►R:
L1(2)►C:
M1►M2:
DELCOL M2;C:
SUB M3;M1;{1,C};{R,C}:
TRN(M2):
INVERSE(Ans*M2)*Ans*(M3*[1]):
If you have a body of n vector observations & wish to fit your data in some linear relationship
a*V1+b*V2+c*V3.....=V
enter V1 in the first column of M1, V2 in the second column of M1....Vn in the nth column & V in the n+1th column.
The programme LSQS calculates the values of co-efficients a,b,c.... such that the errors in the resulting values of V are minimised.
The co-efficients are returned in Ans in Home view.
LSQS
SIZE(M1)►L1:
Ans(1)►R:
L1(2)►C:
M1►M2:
DELCOL M2;C:
SUB M3;M1;{1,C};{R,C}:
TRN(M2):
INVERSE(Ans*M2)*Ans*(M3*[1]):