Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-13 Thread William Dunlap
p-boun...@r-project.org] On > Behalf > Of Michael Dewey > Sent: Sunday, August 12, 2012 6:54 AM > To: Boel Brynedal; R-help Mailing List > Subject: Re: [R] Problem when creating matrix of values based on covariance > matrix > > At 15:17 11/08/2012, Boel Brynedal wrote: >

Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-12 Thread R. Michael Weylandt
On Sun, Aug 12, 2012 at 7:52 PM, R. Michael Weylandt wrote: > I am not sure if this is a general/fixed bias in the spearman > estimator or if it's just a function of the covMat I randomly chose. > Prof. Dalgaard and many others on this list must know. To somewhat answer myself, I restricted my at

Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-12 Thread R. Michael Weylandt
On Sun, Aug 12, 2012 at 1:46 PM, Boel Brynedal wrote: > A clarification - yes, calculating the pearson covariance does give > the expected results. I dont fully understand why yet, but many thanks > for this help! I'm not sure that the spearman correlation is an appropriate estimator for the cova

Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-12 Thread Boel Brynedal
A clarification - yes, calculating the pearson covariance does give the expected results. I dont fully understand why yet, but many thanks for this help! 2012/8/12 Boel Brynedal : > Thanks for these replies. > @Peter - are these methods only suitable for pearson covariances? That > would def expla

Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-12 Thread Boel Brynedal
Thanks for these replies. @Peter - are these methods only suitable for pearson covariances? That would def explain my issues. Sorry for my ignorance, but I would highly appreciate an explanation. My original covariance matrix is calculated using spearman as well (which is suitable for the data). @M

Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-12 Thread peter dalgaard
On Aug 11, 2012, at 16:17 , Boel Brynedal wrote: > cov8=cov(sample8,method='spearman') There's your problem. I'm surprised that nobody seems to have picked up on this, but Spearman covariances are of the ranks, not of the data. Try method="pearson". -- Peter Dalgaard, Professor, Center for S

Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-12 Thread Michael Dewey
At 15:17 11/08/2012, Boel Brynedal wrote: Hi, I want to simulate a data set with similar covariance structure as my observed data, and have calculated a covariance matrix (dimensions 8368*8368). So far I've tried two approaches to simulating data: rmvnorm from the mvtnorm package, and by using t

Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-11 Thread Boel Brynedal
Hi, thanks for the reply. I am not assuming that the supplied covariance vector in any way captures the 'true' covariance matrix of the population, but thats not what I am after either. I just want to simulate data that has a similar covariance as that covariance matrix. And the numbers are so huge

Re: [R] Problem when creating matrix of values based on covariance matrix

2012-08-11 Thread Bert Gunter
Sampling error? Do you realize how large a sample size you would need to precisely estimate an 8000 x 8000 covariance matrix? Probably exceeds the number of stars in our galaxy... Numerical issues may also play a role, but I am too ignorant on this aspect to offer advice. Finally, this is reall