Beginner tutorial in progress

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Beginner tutorial in progress

Tawanda Gwena
Hi again,

I am working on a beginner tutorial for quantlib. I don't want other  
people to go through the torture I did. At the moment it's very  
preliminary and full of mistakes (and downright lies). However I would  
like your feedback as I work on it over the next few weeks.

This is NOT meant to compete with Luigi's wonderful Oeuvre, but serve  
as a gentle introduction.

The link to it is

http://sites.google.com/site/tgwena/

It's the QuantLib.pdf file.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Beginner tutorial in progress

Luigi Ballabio
On Mon, 2010-03-15 at 22:49 -0400, Tawanda Gwena wrote:
> I am working on a beginner tutorial for quantlib. I don't want other  
> people to go through the torture I did. At the moment it's very  
> preliminary and full of mistakes (and downright lies). However I would  
> like your feedback as I work on it over the next few weeks.

Great---let me know when you think I can put a link to it on the
QuantLib site.

A piece of feedback: you don't need to create a new process (and a new
engine) to change the underlying value. That's what quotes are about.
You create a process and set the engine once, with:

uQuote = SimpleQuote(underlying)
underlyingH = QuoteHandle(uQuote)
...
bsmProcess = BlackScholesMertonProcess(underlyingH,
                                       dividendYield,
                                       flatTermStructure,
                                       flatVolTS)
europeanOption.setPricingEngine(AnalyticEuropeanEngine(bsmProcess))

after which, you just change the value in the quote and the option
recalculates automatically:

for x in range(20,60):
    uQuote.setValue(x)
    value = europeanOption.NPV()

Luigi



--

The young man knows the rules, but the old man knows the exceptions.
-- O. W. Holmes



------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Beginner tutorial in progress

Tawanda Gwena

Thanks for the feedback Luigi. I've changed the code.


On Mar 16, 2010, at 4:01 AM, Luigi Ballabio wrote:

> On Mon, 2010-03-15 at 22:49 -0400, Tawanda Gwena wrote:
>> I am working on a beginner tutorial for quantlib. I don't want other
>> people to go through the torture I did. At the moment it's very
>> preliminary and full of mistakes (and downright lies). However I  
>> would
>> like your feedback as I work on it over the next few weeks.
>
> Great---let me know when you think I can put a link to it on the
> QuantLib site.
>
> A piece of feedback: you don't need to create a new process (and a new
> engine) to change the underlying value. That's what quotes are about.
> You create a process and set the engine once, with:
>
> uQuote = SimpleQuote(underlying)
> underlyingH = QuoteHandle(uQuote)
> ...
> bsmProcess = BlackScholesMertonProcess(underlyingH,
>                                       dividendYield,
>                                       flatTermStructure,
>                                       flatVolTS)
> europeanOption.setPricingEngine(AnalyticEuropeanEngine(bsmProcess))
>
> after which, you just change the value in the quote and the option
> recalculates automatically:
>
> for x in range(20,60):
>    uQuote.setValue(x)
>    value = europeanOption.NPV()
>
> Luigi
>
>
>
> --
>
> The young man knows the rules, but the old man knows the exceptions.
> -- O. W. Holmes
>
>


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Beginner tutorial in progress

J_Hanna
Also, perhaps you could ensure that the code is not longer than 80 characters as the PDF is not showing all the lines. I haven't had a full go using your tutorial, probably get around to it on the weekend when I can come back with more feedback :-)

On Wed, Mar 17, 2010 at 2:56 AM, Tawanda Gwena <[hidden email]> wrote:

Thanks for the feedback Luigi. I've changed the code.


On Mar 16, 2010, at 4:01 AM, Luigi Ballabio wrote:

> On Mon, 2010-03-15 at 22:49 -0400, Tawanda Gwena wrote:
>> I am working on a beginner tutorial for quantlib. I don't want other
>> people to go through the torture I did. At the moment it's very
>> preliminary and full of mistakes (and downright lies). However I
>> would
>> like your feedback as I work on it over the next few weeks.
>
> Great---let me know when you think I can put a link to it on the
> QuantLib site.
>
> A piece of feedback: you don't need to create a new process (and a new
> engine) to change the underlying value. That's what quotes are about.
> You create a process and set the engine once, with:
>
> uQuote = SimpleQuote(underlying)
> underlyingH = QuoteHandle(uQuote)
> ...
> bsmProcess = BlackScholesMertonProcess(underlyingH,
>                                       dividendYield,
>                                       flatTermStructure,
>                                       flatVolTS)
> europeanOption.setPricingEngine(AnalyticEuropeanEngine(bsmProcess))
>
> after which, you just change the value in the quote and the option
> recalculates automatically:
>
> for x in range(20,60):
>    uQuote.setValue(x)
>    value = europeanOption.NPV()
>
> Luigi
>
>
>
> --
>
> The young man knows the rules, but the old man knows the exceptions.
> -- O. W. Holmes
>
>


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users