Displaying 1 result from an estimated 1 matches for "3000x4".
Did you mean:
30004
2007 Mar 16
1
ideas to speed up code: converting a matrix of integers to a matrix of normally distributed values
...))
a12 <- array(sapply(alleles,make.effects),dim=c(2,nrow(alleles),ncol(alleles)))
(a1 <- a12[1,,])
(a2 <- a12[2,,])
#I've set the population correlation = .5; empirical corr=.4635
cor(as.vector(a1),as.vector(a2))
##run this to see that the code begins to get pretty slow with even a
3000x4 matrix
system.time({
alleles <- matrix(rep(c(5400,3309,2080,1080,2080,1111,389,9362,6372,3787,2798,1009),1000),ncol=4)
a12 <- array(sapply(alleles,make.effects),dim=c(2,nrow(alleles),ncol(alleles)))
a1 <- a12[1,,]
a2 <- a12[2,,]
})
--
Matthew C Keller
Postdoctoral Fellow
Virgin...