You can find a lot of examples with Python. Here is an example I found for Python using only numpy, on Wikipedia:def varimax(Phi, gamma = 1, q = 20, tol = 1e-6): from numpy import eye, asarray, dot, sum, diag from numpy.linalg import svd p,k = Phi.shape R = eye(k) d=0 for i in xrange(q): d_old = d Lambda = dot(Phi, R) u,s,vh = svd(dot(Phi.T,asarray(Lambda)**3 - (gamma/p) * dot(Lambda, diag(diag(dot(Lambda.T,Lambda)))))) R = dot(u,vh) d = sum(s) if d/d_old < tol: break return dot(Phi, R) 这篇关于使用numpy在python中执行varimax旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-31 07:38