Hello everyone,
I'm trying to code basket(2 stocks) path generator using MC. Is it alreay implemented in Quantlib? All I found is for 1-D or for no correlation. Regards, Geonhak. Lee ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi,
you could have an idea from the following piece of code, where you can define two correlated stochastic processes. hope it helps you, André // Creation of 2 stocastic processes (BlackScholes) std::vector<boost::shared_ptr<StochasticProcess1D> > processes(noAssets); processes[0] = boost::shared_ptr<StochasticProcess1D>( new BlackScholesProcess(underlyingH1,flatDividendTS1,flatTermStructure1,flatVolTS1)); processes[1] = boost::shared_ptr<StochasticProcess1D>( new BlackScholesProcess(underlyingH2,flatDividendTS2,flatTermStructure2,flatVolTS2)); boost::shared_ptr<StochasticProcess> process = boost::shared_ptr<StochasticProcess>(new StochasticProcessArray(processes, indexStatistics.correlation())); **** > Hello everyone, > > I'm trying to code basket(2 stocks) path generator using MC. > Is it alreay implemented in Quantlib? > All I found is for 1-D or for no correlation. > > Regards, > Geonhak. Lee > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Geonhak Lee
Hi Geonhak,
the class MultiPathGenerator in the file ql\methods\montecarlo\multipathgenerator.hpp will help you to define the monte carlo path generator. You must of course feed him with the correct stochastic process. If you want to see this class in action study the file pathgenerator in the test-suite: test-suite\pathgenerator.cpp. It also includes an example for simulating an n dimensional stochastic process. HTH Kim Tang Geonhak Lee schrieb: > Hello everyone, > > I'm trying to code basket(2 stocks) path generator using MC. > Is it alreay implemented in Quantlib? > All I found is for 1-D or for no correlation. > > Regards, > Geonhak. Lee > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |