Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Random replacement

  • To: mathgroup at
  • Subject: [mg50562] Re: [mg50523] Re: [mg50496] Random replacement
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Fri, 10 Sep 2004 04:06:06 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

Here is the way to test it. First evaluate











Note that I got a different answer than before. That means that the 
package did properly load and was working, before I cleared Random. Now 
to make it work again just quit the Kernel and restart it by performing 
another calculation.


Andrzej Kozlowski
Chiba, Japan

On 8 Sep 2004, at 22:03, sean kim wrote:

> Hi andrej
> is there any tests to see whether or not I have put it
> in the proper folder and it is working as i wish?
> thanks in advance for any insights,
> sean
> --- Andrzej Kozlowski <andrzej at> wrote:
>> I have written a small "package" intended to as a
>> workaround for the
>> problem with the built in Random function fully
>> explained by Daniel
>> Lichtblau in:
> <>
>> The "package" simply implements Daniel's workaround
>> described in his
>> posting. In fact it is not a proper package (it
>> defines no new
>> contexts) but simply a init.m file which, if loaded
>> on Kernel startup
>> (this will happen if you put it into folder Kernel
>> in the folder
>> Autoload in your $UserAddOnsDirectory directory)
>> will replace all calls
>> to the SW algorithm that has been causing some
>> problems by  calls to
>> Wolfram's "rule 30" CA automaton random number
>> generator. (Actually it
>> does not deal with large - more than 31 bit- integer
>> calls). Of course,
>> one can also copy the contents of the package and
>> paste into an
>> existing init.m file.
>> The only advantage of this package, compared with
>> very similar
>> workarounds that have been mentioned several times
>> on this list (which
>> were based on defining a Random[] substitute called
>> MyRandom or
>> something like that)  is that it does not require
>> modifying the code
>> for individual distributions in various statistics
>> packages: by
>> replacing Random itself we can deal with all the
>> cases at once.
>> The reason why I wrote this package was because I
>> was obtaining
>> inaccurate values for option pricing using
>> Monte-Carlo simulation with
>> the built in Random and the NormalDistribution
>> package. With the
>> replacement init.m file loaded these values have
>> become noticeably
>> better. I assume similar improvements should show up
>> in programs that
>> use simulation with a large number of samples with
>> other distributions.
>> The package can be downloaded from any of my two
>> (identical) sites:
>>   (in
>> Japan)
>>      (in
>> Poland)
>> The name of the "package" is simply init.m.
>> Andrzej Kozlowski
>> Chiba, Japan
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!

  • Prev by Date: Re: parallel NMinimize[]
  • Next by Date: Re: Re: How to solve a simple Trig cofunction?
  • Previous by thread: Re: Random replacement
  • Next by thread: Re: Random replacement