finmath / finmath-lib

Mathematical Finance Library: Algorithms and methodologies related to mathematical finance.
Apache License 2.0
488 stars 168 forks source link

Updates to MonteCarloMultiAssetBlackScholesModel #80

Closed rolandbachl closed 4 years ago

rolandbachl commented 4 years ago

What is this PR for?

Andrea encountered a problem with getCloneWithModifed... in MonteCarloMultiAssetBlackScholesModel. Together we determined that the issue is with the finmath-lib itself, so I fixed it. Please have a look.

What type of PR is it?

Bug Fix, Improvement

TODOS

I noticed the static final seed in the class. I think that's a pattern that I have seen in a few places before. Maybe this should be replaced?

cfries commented 4 years ago

Thank you.

cfries commented 4 years ago

A small note: I changed the constructor added in the PR. I believe it is not optimal change the interpretation of a parameter depending on the value of a boolean (I would not exclude that I do it sometimes too, but I try to avoid such constructs). I have replaced it with a constructor consuming the factorLoadings matrix (i.e. F such that F^T F is the Covariance).