Login  Register

Re: New Basket Option Code and question about StochasticProcessArray

Posted by Luigi Ballabio on Mar 12, 2007; 6:46pm
URL: http://quantlib.414.s1.nabble.com/New-Basket-Option-Code-and-question-about-StochasticProcessArray-tp9247p9248.html

On Thu, 2007-03-08 at 11:20 -0600, Joseph Wang wrote:
> I did a backward compatible refactoring of the basket option code that makes
> it relatively easy to add new types of basket options.  Instead of using a
> enum to define the basket option, the code now allows you to subclass
> BasketOptionType which contains code on how to calculate the price of that
> option.  There are now AverageBasketOptionType, MinBasketOptionType, and
> MaxBasketOptionType, and by moving the option calculation code out of the
> engines, any new basket options can be calculated automatically by the monte
> carlo code.

Joe,
        first of all, thanks for the effort---I've meant to do something of the
sort for a long time but never got around to implement it.
Just for clarity though, I'd call the base class BasketOptionPayoff
(same for the children.) Since next release's purpose will be to get
closer to release 1.0 (more on this later) we're not much concerned with
backward compatibility at this time---in fact, we're trying to change a
number of things that seemed right at some time, that we wanted to
change after a while, but that weren't easy to change while maintaining
backward compatibility.

We'll care again for compatibility starting with the release after this
one.


> I'm now in the process of putting together some swig wrappers for all of this.
>
> I do have a question about StochasticProcessArray.  Right now you have to
> define a vector of StochasticProcesses and then put that into the constructor
> of the array.  Would it be better to add a "push_back" method to the
> StochasticProcessArray so that you create an array object and then insert
> processes to it?

My 2 cents are that I'd like to keep objects as immutable as possible.
For instance, I wouldn't like the possibility to add processes to a
StochasticProcessArray _after_ it has been passed to an instrument.

Later,
        Luigi


----------------------------------------

Brady's First Law of Problem Solving:
When confronted by a difficult problem, you can solve it more
easily by reducing it to the question, "How would the Lone
Ranger have handled this?"



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev