Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-02-20 02:47 (3710 d 22:00 ago) Posting: # 14466 Views: 13,788 |
|
Dear all, I’m still exploring R’s graphic capabilities… ![]() Can you guess which plot shows the type I errors of which design? Bonus question: What can we learn from these plots? For initiates: CV 10–80% (step 2%), n1 12–72 (2) ⇒ 1.116·109 simulations/plot. Power2Stage is amazing.Edit: Unfair, bloody unfair! Poor TOST. ![]() — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
nobody nothing 2015-02-20 09:25 (3710 d 15:22 ago) @ Helmut Posting: # 14467 Views: 12,527 |
|
Hi Vienna! Totally off topic: http://link.springer.com/article/10.1007/s00228-015-1806-2?no-access=true ...you should publish open-source... ![]() (Springer handled the additional material .doc quite loveless, btw) OT: First graph = Potvin B Second graph = Potvin C Third graph = conventional 2x2 ? — Kindest regards, nobody |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-02-20 14:01 (3710 d 10:47 ago) @ nobody Posting: # 14471 Views: 12,520 |
|
Hi Sweden (or Germany?) ❝ ...you should publish open-source... Everybody – who could afford it – should do so. It was an invited review and assessing the endless list of references and running the simulations took me close to two months. My one-man show didn’t want to spend € 2,200 for OA. ❝ (Springer handled the additional material .doc quite loveless, btw) Yes. ![]() I had some discussions with the publisher about the format of the plots in the paper only to find them downscaled making some legends almost illegible… ❝ First graph = Potvin B ❝ Second graph = Potvin C ❝ Third graph = conventional 2x2 ? Almost – almost – yes. Potvin’s adjusted α of 0.0294 for both methods was unfortunate. “Type 2” always needs more adjustment than “type 1”. I used the optimized values of 0.0303 and 0.0282. No significant inflation of the TIE (maxima 0.05015 and 0.05010). — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
nobody nothing 2015-02-20 15:18 (3710 d 09:29 ago) @ Helmut Posting: # 14472 Views: 12,527 |
|
Hi from nowhere! ❝ Potvin’s adjusted α of 0.0294 for both methods was unfortunate. “Type 2” always needs more adjustment than “type 1”. I used the optimized values of 0.0303 and 0.0282. No significant inflation of the TIE (maxima 0.05015 and 0.05010). Clever! ![]() ❝ ...and running the simulations took me close to two months. Sorry for OT again, but I heard that all the "for..." constructions are not so effective in R and better to use vectors for all "for ...to" and calculate them. Have you any experience on this? (Read the R developers are thinking about an API for distributed computing. so we can share all our machines for large simulations ![]() — Kindest regards, nobody |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-02-20 16:38 (3710 d 08:09 ago) @ nobody Posting: # 14473 Views: 12,520 |
|
Hi to nowhere! ❝ ❝ I used the optimized values of 0.0303 and 0.0282. No significant inflation of the TIE (maxima 0.05015 and 0.05010). ❝ ❝ Clever! THX. Not new (see this thread). ❝ ❝ ...and running the simulations took me close to two months. Last year some options were not implemented in Power2Stage and I had to write my own – clumsy – code…❝ I heard that all the "for..." constructions are not so effective in R and better to use vectors for all "for ...to" and calculate them. Yes. Sometimes the performance boost can by 100×.
❝ Have you any experience on this? Functions in PowerTOST and Power2Stage are completely vectorized and pre-compiled. With my latest code finding a suitable adjusted α and validating for TIE and power generally takes less than 30 minutes on my machine. Example for my “type 2” at the location of the maximum TIE. Four seconds for 106 sim’s!
❝ (Read the R developers are thinking about an API for distributed computing. so we can share all our machines for large simulations Yes, that would be nice! It’s already possible to run R in a local cloud-computing environment. We tried that at the Uni Lancaster and the speed boost was 20–50. With a SETI-like approach we could even think about TSDs for RSABE… — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
nobody nothing 2015-02-20 17:37 (3710 d 07:11 ago) @ Helmut Posting: # 14475 Views: 12,417 |
|
❝ ❝ Clever! ❝ ❝ THX. Not new (see this thread). Yeeaaaaahhhh, now I remember that... even ran the code in R sometimes... ![]() ❝ ❝ ❝ ❝ ❝ ❝ OK, 4.9s here...almost 25% down...but not a problem at all ❝ ...With a SETI-like approach we could even think about TSDs for RSABE… Let's start with distributed computing in, let's say 10 to 20 instances on different computers.. — Kindest regards, nobody |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-02-20 17:58 (3710 d 06:49 ago) @ nobody Posting: # 14476 Views: 12,506 |
|
Hi nobody, ❝ Yeeaaaaahhhh, now I remember that... even ran the code in R sometimes... Wouldn’t recommend that any more. If you want I can send you my current version (including futility criteria). Parallel designs not implemented yet.
❝ ❝ ...With a SETI-like approach we could even think about TSDs for RSABE… ❝ ❝ Let's start with distributed computing in, let's say 10 to 20 instances on different computers.. Once the API is ready… On my machine I often use three instances of R without problems. — Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
nobody nothing 2015-02-20 18:01 (3710 d 06:46 ago) @ Helmut Posting: # 14477 Views: 12,445 |
|
❝ If you want I can send you my current version (including futility criteria). Parallel designs not implemented yet. Would be nice, something to play with over the weekend! ![]() Many thanx in advance... — Kindest regards, nobody |
ElMaestro ★★★ Denmark, 2015-02-21 00:48 (3709 d 23:59 ago) @ Helmut Posting: # 14480 Views: 12,395 |
|
Hi Hötzi, ❝ for(j in seq_along(run)) v1 <- c(v1, rnorm(1, mean=0, sd=1)) This is a funny way to do it. There will be constant memory re-allocation of the vector this way. I guess that's what takes the time. Try and check if a technique called loop unrolling also helps speed things up in R. Sometimes it works miracles but is very implementation-specific. It has a little effect in my C implementations, but nothing really substantial so far. The idea is (and pardon me for going from a for loop to a while loop; this is just because I don't know of a way to make a for loop increase by more than one per iteration, but I am sure you can do that): In stead of i=0 we can try i=0 Here in stead of looping 10 times, we just need to loop 5 times. You can of course unroll a lot more than just x2 as the above example. One obvious drawback is that code can appear visually bloated but this of course doesn't affect functionality. — Pass or fail! ElMaestro |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-02-21 02:11 (3709 d 22:36 ago) @ ElMaestro Posting: # 14481 Views: 12,340 |
|
Hi ElMaestro, ❝ ❝ for(j in seq_along(run)) v1 <- c(v1, rnorm(1, mean=0, sd=1)) ❝ ❝ This is a funny way to do it. There will be constant memory re-allocation of the vector this way. I guess that's what takes the time. Exactly. That’s really stupid (see the R Inferno Circle 2). Detlew cured me. ❝ The idea is (and pardon me for going from a for loop to a while loop; this is just because I don't know of a way to make a for loop increase by more than one per iteration, but I am sure you can do that): I have learned that one never ever should try to manipulate the counter of a for -loop. ![]()
But: Quite often the number of iterations is not known beforehand (here it must be even) and the time-consuming part is the Do.Something() .Reminds me on my first Pascal-lessons almost 40 years ago.
— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
ElMaestro ★★★ Denmark, 2015-02-21 02:32 (3709 d 22:15 ago) @ Helmut Posting: # 14482 Views: 12,353 |
|
Hi Hötzi, just tried to implement something that more or less corresponded to the example you had. I get about a 10% speedup difference if I unroll 4x:
runs <- 1e5 10% isn't bad, actually. One could probably even optimise the number of unrolls. — Pass or fail! ElMaestro |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-02-21 02:50 (3709 d 21:57 ago) @ ElMaestro Posting: # 14483 Views: 12,408 |
|
Hi ElMaestro, ❝ I get about a 10% speedup difference if I unroll 4x: Confirmed. ![]() ❝ 10% isn't bad, actually. One could probably even optimise the number of unrolls. Yeah, but at the end of the day it’s not necessarily the loop-overhead that counts. Such a code is terrible to maintain. PS: In your unrolled code set runs <- 5 and after execution type length(v2) . Kinetica-style.— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
ElMaestro ★★★ Denmark, 2015-02-21 03:27 (3709 d 21:20 ago) @ Helmut Posting: # 14484 Views: 12,374 |
|
Hi Hötzi, ❝ PS: In your unrolled code set runs <- 5 and after execution type length(v2) . Kinetica-style.Wow, I like it ![]() In C you can get punished real bad if you do stuff like that. Looks like R knows that users make occasional mistakes and will reallocate the array length when the user tries to set something that is out of bounds. Stuff like this restores my faith in humanity. — Pass or fail! ElMaestro |
Helmut ★★★ ![]() ![]() Vienna, Austria, 2015-02-21 14:13 (3709 d 10:35 ago) @ ElMaestro Posting: # 14485 Views: 12,276 |
|
Hi ElMaestro, ❝ In C you can get punished real bad if you do stuff like that. Makes sense. ❝ Looks like R knows that users make occasional mistakes and will reallocate the array length when the user tries to set something that is out of bounds. Couldn’t find anything about in the man-pages or on R-help. IMHO, R should at least throw a warning. Another surprising goodie:
— Dif-tor heh smusma 🖖🏼 Довге життя Україна! ![]() Helmut Schütz ![]() The quality of responses received is directly proportional to the quality of the question asked. 🚮 Science Quotes |
nobody nothing 2015-02-21 22:02 (3709 d 02:45 ago) @ Helmut Posting: # 14486 Views: 12,196 |
|
...funny! — Kindest regards, nobody |