VanillaMain2.cpp

This forum is to discuss the book "C++ design patterns and derivatives pricing."

VanillaMain2.cpp

Postby WilliamY » Wed Mar 03, 2010 5:44 pm

Professor: How come the first and second call price are different? I used 100,000,000 paths. If it's because the random number generator, how come the first and second call price stay the same across runs? Thank you.
WilliamY
 
Posts: 7
Joined: Mon Mar 01, 2010 5:57 am

Re: VanillaMain2.cpp

Postby mj » Thu Mar 04, 2010 4:08 am

your compiler probably sets the seed to always be the same at the start of each run of the program.

Try using srand to set the seed before each call .
mj
Site Admin
 
Posts: 792
Joined: Fri Jul 27, 2007 7:21 am


Return to C++ design patterns and derivatives pricing

Who is online

Users browsing this forum: No registered users and 1 guest