Re: Implement Bermudan swaption in QuantLibXL

Posted by Hyung-Seok Hahm on
URL: http://quantlib.414.s1.nabble.com/Implement-Bermudan-swaption-in-QuantLibXL-tp291p306.html

Another follow-up question. 

I'm getting the following error. 

"qlCalibratedModelCalibrate - ObjectHandler error: attempt to retrieve object with unknown ID..."

Digging into it a little more, it comes from the auto-generated QuantLibXL\qlxl\functions\model.cpp

  OH_GET_REFERENCE(ObjectIdLibObjPtr, ObjectId,
     QuantLibAddin::CalibratedModel, QuantLib::CalibratedModel)

I had an impression that an object of QuantLibAddin::CalibratedModel was not registered, so what I did was

add the following line in types.xml

<DataType defaultSuperType='objectClass'>QuantLibAddin::CalibratedModel</DataType>

Didn't work out though. Any suggestions?

- Hyung


On Mon, Jul 30, 2012 at 1:21 PM, Hyung-Seok Hahm <[hidden email]> wrote:
Hi Eric,

One piece of a puzzle is missing. 

QuantLibAddin/qlo/valueobjects/vo_model.*pp
QuantLibAddin/qlo/serialization/create/create_model.*pp 
QuantLibAddin/qlo/serialization/register/serialization_model.*pp
 
have not been created. Where should I modify to create them?

- Hyung

On Fri, Jul 27, 2012 at 1:17 PM, Hyung-Seok Hahm <[hidden email]> wrote:
Hi Eric,

Works like a charm. ;-) I'll probably need to overcome a couple of more things to get Bermudan swaptions working in QuantLibXL, but this is a breakthrough. 

Appreciate your help!!

- Hyung

On Thu, Jul 26, 2012 at 9:17 PM, Eric Ehlers <[hidden email]> wrote:
Hi Hyung,


On 2012-07-26 03:07, Hyung-Seok Hahm wrote:
Eric,

I'm still getting  "error C2664: Can't convert
QuantLib::CalibrateModel::calibrate : 'const
QuantLib::OptimizationMethod' to 'QuantLib::OptimizationMethod &'".

It kinda makes sense in that the superType of
QuantLib::OptimizationMethod is set to underlyingClass in model.xml
and according to supertypes.xml, 

    <!-- from ObjectHandler::Object to const QuantLib::xx & -->
    <SuperType name='underlyingClass' nativeType='string'
conversionSuffix='LibObj' memberAccess='.'/>

underlyingClass is supposed to convert to the type of CONST
QUANTLIB::XX &. If I'm right, can you suggest any other superType that
converts to QUANTLIB::XX &? 

There isn't one, because the cases where we need a non-const reference are so rare that we didn't get around to defining the relevant supertype.

Instead we use supertype underlyingClass, then implement a little override as I described in my previous message:


2) QuantLibAddin\gensrc\metadata\rules\excel.xml

In the RuleGroup called referenceConversions, add this line:

     <Rule tensorRank='scalar' superType='underlyingClass'
type='QuantLib::OptimizationMethod' codeID='code49'/>

This works already for QuantLib::SequenceStatistics and you could refer to that example.

I implemented the fix for your code and it seems to work.  Attached are the files that I changed as explained in my previous message.  To try this out, please:

- Do a clean install of 1.1 (full build) as explained here:  http://quantlib.org/quantlibaddin/build_qlxl.html
- Detach the attached file to C:/build_ql_1_1_0/patch.zip and uncompress it there.
- Build C:/build_ql_1_1_0/QuantLibXL/QuantLibXL_full_vc9.sln

That should do it, any problems please let me know.


Kind Regards,
Eric

===================================================
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
* Distributed computing for pricing analytics
* Use Microsoft Excel as a client to the Grid

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users








--

Hyungseok Hahm, PhD, FRM   

Quantitative Analyst 

Industrial Bank of Korea

Trading Department

Tel      : 82-2-729-7081

Fax       : 82-2-729-6084

E-mail  : [hidden email]

Yahoo Msn : hyungseok.hahm

Google Talk : hs.hahm.ibk[hidden email]

LinkedIn: http://kr.linkedin.com/pub/dir/Hyung-seok/Hahm



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users