RosettaCodeData/Task/Multiple-regression/PARI-GP/multiple-regression.pari

5 lines
167 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
pseudoinv(M)=my(sz=matsize(M),T=conj(M))~;if(sz[1]<sz[2],T/(M*T),(T*M)^-1*T)
addhelp(pseudoinv, "pseudoinv(M): Moore pseudoinverse of the matrix M.");
y*pseudoinv(X)