[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Importing FIXES functions from octave-forge, and a couple of other thing
From: |
John W. Eaton |
Subject: |
Importing FIXES functions from octave-forge, and a couple of other things |
Date: |
Mon, 3 Apr 2006 15:24:28 -0400 |
On 2-Apr-2006, David Bateman wrote:
| The second patch is to port the octave-forge random number generators to
| octave, while keeping the old generators in place. The old generators
| are selected by setting the "seed" of the generator with the "seed"
| keyword, while the new generators are selected with the "state" keyword
| and a vector with up to 625 elements. In addition the "twister" keyword
| is an alais for the "state" keyword as R14sp3 allows this to select the
| Mersenne Twister generator.
|
| Additionally I included the rande, randg and randp generators and
| include randlib versions of each of this as well. To test the code, the
| test suite from the octave-forge code was also added. With this change
| both the existing octave and octave-forge generators are available with
| exactly the same sequences as previously. I good further suggestion is
| that the statistics functions are updated to use the rande, randp and
| randg functions to significantly accelerate their performance.
I applied this patch.
| The major difference here with the old generators at the moment is that
| the new generators all rely on a single mersenne twister, while teh old
| generators each have a different generator. John what do you prefer.
It does not make much difference to me. Having one generator seems
fine. As noted in the manual, my original reason for having separate
generators was so that
rand ("seed", 13);
randn ("seed", 13);
u = rand (100, 1);
n = randn (100, 1);
and
rand ("seed", 13);
randn ("seed", 13);
u = zeros (100, 1);
n = zeros (100, 1);
for i = 1:100
u(i) = rand ();
n(i) = randn ();
end
would produce equivalent results. I'm not sure that this matters all
that much, so I think it is OK to just have one generator.
Thanks,
jwe
- Importing FIXES functions from octave-forge, and a couple of other things, David Bateman, 2006/04/02
- Re: Importing FIXES functions from octave-forge, and a couple of other things, Paul Kienzle, 2006/04/02
- Importing FIXES functions from octave-forge, and a couple of other things, John W. Eaton, 2006/04/03
- Importing FIXES functions from octave-forge, and a couple of other things, John W. Eaton, 2006/04/03
- Importing FIXES functions from octave-forge, and a couple of other things, John W. Eaton, 2006/04/03
- Importing FIXES functions from octave-forge, and a couple of other things,
John W. Eaton <=
- Importing FIXES functions from octave-forge, and a couple of other things, John W. Eaton, 2006/04/03