On Sun, Mar 13, 2011 at 10:34 PM, Robert O'Boyle <[email protected]> wrote:
> I am doing some MCMC work and have been fiddling around with different ways
> to implement this in J.

I can not comment on that part.  All of my explorations with markov chains
in J have been deterministic rather than monte carlo.

> (TEST"0  i.10) "0 i.5
>
> to execute TEST 5 times but got
>
> 0 1 3 6 10 15 21 28 36 45
> 0 1 3 6 10 15 21 28 36 45
> 0 1 3 6 10 15 21 28 36 45
> 0 1 3 6 10 15 21 28 36 45
> 0 1 3 6 10 15 21 28 36 45
>
> rather than the desired
>
>  0   1   3   6  10  15  21  28  36  45
>  45  46  48  51  55  60  66  73  81  90
>  90  91  93  96 100 105 111 118 126 135
> 135 136 138 141 145 150 156 163 171 180
> 180 181 183 186 190 195 201 208 216 225

For me, the natural way of doing this in J would be:
  ($ $ +/\@,)5#,:i.10

Though the only resemblance that has to monte carlo code I have used
is the n#,: bit.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to