A comparison and thanks
- To: mathgroup at smc.vnet.net
- Subject: [mg75464] A comparison and thanks
- From: "actuary at mchsi.com" <actuary at mchsi.com>
- Date: Wed, 2 May 2007 03:46:28 -0400 (EDT)
To: All After sending my initial email, I decided to use approach #3. After receiving all of the responses to me question, I ran a comparison of my method against the methods using the UnitStep function and the THread function The problem set-up is that is have two 2-dimensionanl matrices. Each matrix has 10,000 rows and 359 columns. I wanted to find, for a given i the number of times a(i,j) > {b(i,j)+k) and then determine the value for specific statistic over all 10000 i's. 1. Timing[Quantile[Table[Total[UnitStep[srl[[i,All]] - (lrl[[i, All]] + .15)]], {i, 1, n}], .5]/359 // N] {2.574 Second, 0.142061} 2. Timing[Quantile[Table[Count[Thread[srl[[i,ll]] > (lrl[[i, All]] + . 15)], True], {i, 1, n}], .5]/359 // N] {4.536 Second, 0.1420 3. Timing[Quantile[Table[Count[srl[[i, All]] - (lrl[[i, All]] + .15), _?Positive], {i, 1, n}], .5]/359 // N] 61} (5.929 Second, 0.142061} The UnitStep function did the task the fastest. Thanks again for all of your suggestions. Larry