Re: [R] replace loops with matrix

2010-08-17 Thread Nikhil Kaza
what is nt? is that a typo for ns? I don't see why you need to calculate lia within the loop. Also library(fBasics) ccl <-rowprod(lia) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 17, 2010, at 6:22 PM, Hey Sky wrote: He

[R] replace loops with matrix

2010-08-17 Thread Hey Sky
Hey, R users I am using numerical method for my research paper and the computation burden is very heavy. first I tried to do it with loops, example code as following, and it take hours to converge for only 200 obs. and my real data has 4000 obs. and the optimization command that I use is: o