Date: Fri, 1 Jun 2007 10:38:10 +0800 Reply-To: ronggui wong Sender: "SPSSX(r) Discussion" From: ronggui wong Subject: Re: Anyone knows the exact algorithm of ULS factor analysis Comments: To: Marta García-Granero In-Reply-To: <1761106546.20070524104638@terra.es> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi Marta, Thanks for your help. I think I am pretty sure the derivative is wrong. in p5 of the document says "In terms of the derivatives, for ULS Df/Dx_i = 2 x_i \sum {lambda_k omega_ik^2} " I believe it is Df/Dx_i = - 2 x_i \sum {lambda_k omega_ik^2}, it seems that the spss document ignores a minus symbolic. 2007/5/24, Marta García-Granero : > Hi Ronggui > > Although this is a bit out of my scope, here's my two cents: > > 1) Why are you trying to write your own code for something that SPSS > does? BTW, what program are you using for that task? > 2) Assuming you must do it, perhaps you should check the adequacy of > the dataset you are using by running SPSS' FACTOR with the same > dataset and then comparing the results with the ones you get. > 3) Print every intermediate result you compute with your > program, to see where things go wrong. > > I don't think the SPSS documentation is wrong, but, have you checked > the other reference I recommended you?, you migh find extra > information there. > > You wrote: > > rw> Thanks for your information. I have read the paper from SPSS's > rw> website. I get the f(psi) (see page 5 of factor.pdf) correctly, but I > rw> can not get the right derivatives. > > rw> what I code is like these: > > rw> mat <- R - diag(psi^2) > rw> # diag(psi^2) means diagonal matrix with psi^2 as the diagonal elements. > rw> E <- eigen(mat)$value > rw> # the eigen value of length p from the biggest to the smallest. > rw> L <- eigen(mat)$vectors > rw> # matrix of p x p, each column is the corresponding eigenvectors. > rw> E2 <- E[-(1:m)] > rw> # vector of eigenvalue except the first m largest ones. > rw> L2 <- L[, -(1:m)] > rw> # matrix of (p-m) x p, corresponding to E2. > > rw> Df/Dx_i <- 2 * psi * (L^2 %*% E2) > rw> # * means multiply, %*% means inner product. L^2 produce a new matrix > rw> with elements in ith row and j column is quare of the corresponding > rw> elements in L. > > rw> But the optimization fail due to the wrong derivative. I don't know > rw> what is wrong. It is my codes or the document goes wrong? > > >> rw> I am trying to code the program myself, but I did not get the write gradient. > >> > >> rw> Anyone knows the exact algorithm of ULS factor analysis used by SPSS? > >> rw> or any reference recommend? > >> > >> Have you tried to take a look at the SPSS documentation? It can be > >> found in the Algorithms folder in the installation CD or here: > >> > >> http://support.spss.com/Student/Documentation/Algorithms/index.html > >> > >> (use Guest as user and password to login) > >> > >> Also, there is an excellent online book by Ledyard Tucker > >> and Robert MacCallum at > >> > >> http://www.unc.edu/~rcm/book/factornew.htm > >> > >> Perhaps you can find more technical information there. > >> > >> -- > >> Regards, > >> Dr. Marta García-Granero,PhD mailto:biostatistics@terra.es > >> Statistician > >> > >> > >> > >> > >> --- > >> "It is unwise to use a statistical procedure whose use one does > >> not understand. SPSS syntax guide cannot supply this knowledge, and it > >> is certainly no substitute for the basic understanding of statistics > >> and statistical thinking that is essential for the wise choice of > >> methods and the correct interpretation of their results". > >> > >> (Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind) > >> > > > > -- > Regards, > Dr. Marta García-Granero,PhD mailto:biostatistics@terra.es > Statistician > > --- > "It is unwise to use a statistical procedure whose use one does > not understand. SPSS syntax guide cannot supply this knowledge, and it > is certainly no substitute for the basic understanding of statistics > and statistical thinking that is essential for the wise choice of > methods and the correct interpretation of their results". > > (Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind) > 

Back to: Top of message | Previous page | Main SPSSX-L page