Re: [R] computationally singular

2005-08-10 Thread Kjetil Brinchmann Halvorsen
Weiwei Shi wrote: I think the problem might be caused two variables are very correlated. Should I check the cov matrix and try to delete some? But i am just not quite sure of your reply. Could you detail it with some steps? thanks, Why not do principal component analysis? To identify the

Re: [R] computationally singular

2005-08-10 Thread Weiwei Shi
PCA definately is worth of trying, which was my second thought. But thanks for the help and also on the suggestion. On 8/10/05, Kjetil Brinchmann Halvorsen [EMAIL PROTECTED] wrote: Weiwei Shi wrote: I think the problem might be caused two variables are very correlated. Should I check the cov

[R] computationally singular

2005-08-08 Thread Weiwei Shi
Hi, I have a dataset which has around 138 variables and 30,000 cases. I am trying to calculate a mahalanobis distance matrix for them and my procedure is like this: Suppose my data is stored in mymatrix S-cov(mymatrix) # this is fine D-sapply(1:nrow(mymatrix), function(i) mahalanobis(mymatrix,

Re: [R] computationally singular

2005-08-08 Thread Christian Hennig
Once I had a situation where the reason was that the variables were scaled to extremely different magnitudes. 1e-25 is a *very* small number but still there is some probability that it may help to look up standard deviations and to multiply the variable with the smallest st.dev. with 1e20 or

Re: [R] computationally singular

2005-08-08 Thread Weiwei Shi
I think the problem might be caused two variables are very correlated. Should I check the cov matrix and try to delete some? But i am just not quite sure of your reply. Could you detail it with some steps? thanks, weiwei On 8/8/05, Christian Hennig [EMAIL PROTECTED] wrote: Once I had a