Creating a matrix of random numbers

Creating a matrix of random numbers

Postby Cuchulainn » Mon Mar 12, 2007 4:47 pm

let's say I wihs to create a matrix of Rns; the rows correspond to a single path in MC and the full matrix contains all the paths based on so many simulations.



Question: what's the best way in the sense that;



- each path is independent of the others?

- the paths don't give the same nunmbers?



I use rand(), RAND_MAX and srand() (basic and not really random, I know but will change it later)



I have it running but sometimes the numbers from one path to the next are the same.
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Return to Monte Carlo

Who is online

Users browsing this forum: No registered users and 1 guest

cron