I was trying to run some Monte-Carlo simulations and if I used:
rng(seed, 'Twister');
For some reason I would get "Option Values Can not be Negative" errors in the blsimpv function, but if I just use the rand (seed) function, the problem seems to be OK (having everything else the same).
My question is, aren't both of them the similar function? (i.e., generate a whole bunch of random numbers). If so, why is one giving me issues and the other is OK?
I post this is Quant since this is related to the implementation of quant models, hope that is OK.
Thanks in advance!
randwith an integer inputnwill generate ann-by-nmatrix. The integer does not seed the random number generator! – chrisaycock Mar 21 '13 at 12:52