[R] R2winbugs : vectorization

2008-12-17 Thread Philip A. Viton
Many thanks to all responders. It turns out that there is a winbugs update available, which defines a new version of inprod, inprod2. Using inprod2 the vectorized code runs in about the same time as the scalar version. On the print problem: the issue here turns out to be that the arm

Re: [R] R2winbugs : vectorization

2008-12-16 Thread Vitalie Spinu
I remember having similar problem with inprod function. As far as I could remember a sole deference in my models was that I used inprod instead of explicit sum (exactly as you did). In my case the inprod version was faster but result were completely aberrant. So I abandoned the inprod as

[R] R2winbugs : vectorization

2008-12-15 Thread Philip A. Viton
I'm new to bugs, so please bear with me. Can someone tell me if the following two models are doing the same thing? The reason I ask is that with the same data, the first (based on 4 separate coeffs a1--a4) takes about 50 secs, while the second (based on a vectorized form, a[]) takes about

Re: [R] R2winbugs : vectorization

2008-12-15 Thread Ben Bolker
Philip A. Viton wrote: I'm new to bugs, so please bear with me. Can someone tell me if the following two models are doing the same thing? The reason I ask is that with the same data, the first (based on 4 separate coeffs a1--a4) takes about 50 secs, while the second (based on a

Re: [R] R2winbugs : vectorization

2008-12-15 Thread plummer
Philip, If you are using WinBUGS 1.4, then the poor performance of the inprod function is a known problem. An inprod2 function was introduced in 1.4.3 to improve performance. See http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/contents.shtml#problems You might try using that. For WinBUGS problems,