[Gsoc-dowd] same seed for randn/rnorm

Brian G. Peterson brian at braverock.com
Mon Aug 10 13:48:02 CEST 2015


On Mon, 2015-08-10 at 04:56 -0500, Brian G. Peterson wrote:
> On 08/10/2015 04:38 AM, Dinesh Acharya wrote:
> > In order to generate same random numbers in R as in matlab (as in Dowd's
> > function table6point1.m), I was unable to find any possible/suitable
> > way. Do you have any suggestion for this?
> 
> You may need to be a bit more specific for us to help you.
> 
> I assume you've found this:
> 
> http://www.mathworks.com/help/matlab/random-number-generation.html
> 
> and this:
> 
> https://www.stat.auckland.ac.nz/dsc-2007/abstracts/eddelbuettel06Oct16.pdf
> 
> I don't know how much data Dowd gives about what seed and algorithm he 
> is using.  If you can provide a bit more of an example, perhaps I can be 
> of more help.

I realized that if his code is using randn, you may want to go through
this:

http://www.mathworks.com/help/matlab/math/updating-your-random-number-generator-syntax.html

If Dowd's code is using the 'v4', 'v5normal', or 'v5uniform' models,
then I don't think we'll be able to match in R.  In that case, I'd
recommend trying with 'twister' in matlab and the same seed in R, to see
if we can generate the same pseudo-random stream.

Regards,

Brian



More information about the GSoC-Dowd mailing list