Serving the Quantitative Finance Community

 
User avatar
Cuchulainn
Topic Author
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Source Code

March 5th, 2012, 3:09 pm

Here are zip files for PDE and MC. At this moment the numerics and design are taking up my time. When more people give feedback we can devote some time to a standard approach. For the moment this is the approach.MC102 = MC101 + a bunch of well-known, improved and new schemes. Architecture has not changed.Focus MC102 is numerical accuracy. //Here is the source code for 2-factor linear PDE.You can define your PDE (e.g. Heston) and test ADE against it.Some scenarios for you could be:1. does ADE work for your PDE2. Are your PDE BC well-defined3. AccuracyExcel output will show this.You need to create a VS C++ project.BTW I an using domain transformation.
Attachments
TwoFactorADE101.zip
(32.95 KiB) Downloaded 113 times
MC102.zip
(30.95 KiB) Downloaded 112 times
Last edited by Cuchulainn on March 4th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
SierpinskyJanitor
Posts: 1
Joined: March 29th, 2005, 12:55 pm

Source Code

March 5th, 2012, 5:03 pm

Error 9 fatal error C1083: Cannot open include file: 'OptionData.hpp': No such file or directory c:\projects\cuch_mc\montecarlo\mcantitheticvariate.cpp 8 MonteCarlo
 
User avatar
Cuchulainn
Topic Author
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Source Code

March 5th, 2012, 6:42 pm

 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

Source Code

March 6th, 2012, 1:40 am

QuoteOriginally posted by: Cuchulainn... .hpp .... . .using namespace std;
 
User avatar
Cuchulainn
Topic Author
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Source Code

March 6th, 2012, 5:11 am

QuoteOriginally posted by: PolterQuoteOriginally posted by: Cuchulainn... .hpp .... . .using namespace std;Yes, I agree.get it working, get it right, then get it optimised. As I said, the focus is on numerics at this stage. I would like comments on the numerics as well, please. And perhaps, most importantly, using functional programming to create loosely-coupled modules as I claim that this is much easier than with OOP or GP, especially if these modules have been found. Software developers like this approach, I have seen.
Last edited by Cuchulainn on March 5th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
tomodachi
Posts: 1
Joined: February 11th, 2012, 8:37 pm

Source Code

March 7th, 2012, 10:33 pm

QuoteOriginally posted by: CuchulainnHere are zip files for PDE and MC. At this moment the numerics and design are taking up my time. When more people give feedback we can devote some time to a standard approach. For the moment this is the approach.MC102 = MC101 + a bunch of well-known, improved and new schemes. Architecture has not changed.Focus MC102 is numerical accuracy. //Here is the source code for 2-factor linear PDE.You can define your PDE (e.g. Heston) and test ADE against it.Some scenarios for you could be:1. does ADE work for your PDE2. Are your PDE BC well-defined3. AccuracyExcel output will show this.You need to create a VS C++ project.BTW I an using domain transformation.Thanks Cuchulainn. I ran into some problems trying to build. Would it be possible to include the VS C++ project or, better for me, a unix makefile with this? Keep up the good work so that others can play along too!
 
User avatar
SierpinskyJanitor
Posts: 1
Joined: March 29th, 2005, 12:55 pm

Source Code

March 8th, 2012, 10:01 am

Mr. Tomodachi, here´s Dr. Cuch project (VS2008) - mind the various references to the (compiled) Boost libs in the project settings: Tools->Options->Projects&Solutions->VC++Directories.Dr. Cuch is soliciting constructive feedback rgd numerical aspects, that should be the focus ( once you´re able to configure the project ) - do tell whether you prefer a Linux/Unix makefile instead,cheers,Serp
Attachments
MonteCarlo102.zip
(22.19 KiB) Downloaded 108 times
Last edited by SierpinskyJanitor on March 7th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Source Code

March 8th, 2012, 11:07 am

Thanks, Serp.
 
User avatar
JamesRI
Posts: 0
Joined: February 13th, 2012, 4:54 pm

Source Code

March 10th, 2012, 2:48 pm

Thanks
 
User avatar
Cuchulainn
Topic Author
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Source Code

March 10th, 2012, 4:55 pm

JamesRI,If you are interested, a good version 2 would be to parallelise MC102. All the modules are in place. For example, using Boost Thread, MKL, PPL.I can give some finance examples as well in order to scale MC102.
Last edited by Cuchulainn on March 9th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
tomodachi
Posts: 1
Joined: February 11th, 2012, 8:37 pm

Source Code

March 12th, 2012, 8:07 pm

Thanks SJ. I don't have VC++ 2008 but I managed to get something running in VC++ 2010. I have added build folders build\vc9 and build\vc10 and added your project.Getting lots of build warnings, but it seems to work.What is the purpose of the signals and slots? If we can get rid of these then we won't need boost at all, it seems. The ublas vectors can be replaced by std::vector and all the random number generator stuff seems to be the same as in <random>, unless I'm missing something. Boost is great, but it is a big dependency. Why not see how far we can get without it?-tomodachiP.S. Zip files are for the birds. Mr. Outrun has set up a lovely subversion repository. Can't we just use that? I still think git is a better choice for a project like this, but I'm getting in at a late date and don't wish to go against the founder's decisions.
Attachments
MC102 (2).zip
(33.9 KiB) Downloaded 102 times
 
User avatar
SierpinskyJanitor
Posts: 1
Joined: March 29th, 2005, 12:55 pm

Source Code

March 12th, 2012, 10:07 pm

Mr. Tomodachi, please read Dr. Cuchs document before posting any further on this. Therein you'll realise why signals&slots were used.
 
User avatar
Cuchulainn
Topic Author
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Source Code

March 13th, 2012, 5:16 am

QuoteOriginally posted by: tomodachiThanks SJ. I don't have VC++ 2008 but I managed to get something running in VC++ 2010. I have added build folders build\vc9 and build\vc10 and added your project.Getting lots of build warnings, but it seems to work.What is the purpose of the signals and slots? If we can get rid of these then we won't need boost at all, it seems. The ublas vectors can be replaced by std::vector and all the random number generator stuff seems to be the same as in <random>, unless I'm missing something. Boost is great, but it is a big dependency. Why not see how far we can get without it?-tomodachiP.S. Zip files are for the birds. Mr. Outrun has set up a lovely subversion repository. Can't we just use that? I still think git is a better choice for a project like this, but I'm getting in at a late date and don't wish to go against the founder's decisions.Thanks for the feedback. As I mentioned, due to time constraints I was unable to use Outrun's setup. I welcome contributions if you wish to take on some of these tasks.Concerning Boost, there is some reading for you to do to understand the design rationale because there are fundamental reasons for using them. Sources are the 2 recent Demming/Duffy books from Datasim Press and also online docs at www.boost.org. These will help you understand the design intent. Boost is best-of-class. As agreed, we use C++03 and no C++ 11 just yet.Signals allows to create loosely coupled systems and is next generation.And we have all agreed on uBLAS as matrix engine. For MC, std::vector is OK but will not work for my PDE101.hthBTW MC102 is a port from a previous traditional OO solution and home-grown NumericMatrix<T>, which is now partially deprecated in my designs and code, in general.
Last edited by Cuchulainn on March 12th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
tomodachi
Posts: 1
Joined: February 11th, 2012, 8:37 pm

Source Code

March 13th, 2012, 12:57 pm

Found the sandbox. When I get my confirmation code I will put everything there. That should make things easier for everyone.Ah. Did not know this project had to be C++2003 compatible. You will definitely need boost for that.Are the signals in the MC project only for giving progress updates on the computation? That seems to have nothing to do with MC itself. Do you think it is possible to factor that out? Maybe a policy class or something might give people more choices.