|
I am trying to code the program myself, but I did not get the write gradient.
Anyone knows the exact algorithm of ULS factor analysis used by SPSS? or any reference recommend? Thanks very much. Ronggui |
|
Hi Ronggui
Saturday, May 19, 2007, 11:54:35 PM, You wrote: 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:[hidden email] 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) |
|
Hi García-Granero,
Thanks for your information. I have read the paper from SPSS's website. I get the f(psi) (see page 5 of factor.pdf) correctly, but I can not get the right derivatives. what I code is like these: mat <- R - diag(psi^2) # diag(psi^2) means diagonal matrix with psi^2 as the diagonal elements. E <- eigen(mat)$value # the eigen value of length p from the biggest to the smallest. L <- eigen(mat)$vectors # matrix of p x p, each column is the corresponding eigenvectors. E2 <- E[-(1:m)] # vector of eigenvalue except the first m largest ones. L2 <- L[, -(1:m)] # matrix of (p-m) x p, corresponding to E2. Df/Dx_i <- 2 * psi * (L^2 %*% E2) # * means multiply, %*% means inner product. L^2 produce a new matrix with elements in ith row and j column is quare of the corresponding elements in L. But the optimization fail due to the wrong derivative. I don't know what is wrong. It is my codes or the document goes wrong? Thanks very much. 2007/5/21, Marta García-Granero <[hidden email]>: > Hi Ronggui > > Saturday, May 19, 2007, 11:54:35 PM, You wrote: > > 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:[hidden email] > 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) > |
|
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:[hidden email] >> 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:[hidden email] 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) |
|
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 <[hidden email]>: > 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:[hidden email] > >> 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:[hidden email] > 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) > |
| Free forum by Nabble | Edit this page |
