You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(17) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(23) |
| 2002 |
Jan
(18) |
Feb
(20) |
Mar
(22) |
Apr
(41) |
May
(28) |
Jun
(25) |
Jul
(10) |
Aug
(7) |
Sep
(5) |
Oct
(20) |
Nov
(13) |
Dec
(11) |
| 2003 |
Jan
(28) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(17) |
Jun
(6) |
Jul
(45) |
Aug
(35) |
Sep
(24) |
Oct
(50) |
Nov
(53) |
Dec
(6) |
| 2004 |
Jan
(4) |
Feb
(10) |
Mar
(52) |
Apr
(46) |
May
(8) |
Jun
(25) |
Jul
(12) |
Aug
(6) |
Sep
(8) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
| 2005 |
Jan
(18) |
Feb
(60) |
Mar
(19) |
Apr
(26) |
May
(14) |
Jun
(27) |
Jul
(8) |
Aug
(15) |
Sep
(19) |
Oct
(53) |
Nov
(20) |
Dec
(23) |
| 2006 |
Jan
(16) |
Feb
(27) |
Mar
(33) |
Apr
(51) |
May
(36) |
Jun
(25) |
Jul
(54) |
Aug
(30) |
Sep
(25) |
Oct
(67) |
Nov
(43) |
Dec
(13) |
| 2007 |
Jan
(23) |
Feb
(27) |
Mar
(55) |
Apr
(79) |
May
(60) |
Jun
(66) |
Jul
(46) |
Aug
(30) |
Sep
(90) |
Oct
(49) |
Nov
(85) |
Dec
(74) |
| 2008 |
Jan
(68) |
Feb
(59) |
Mar
(64) |
Apr
(28) |
May
(66) |
Jun
(35) |
Jul
(73) |
Aug
(76) |
Sep
(65) |
Oct
(46) |
Nov
(41) |
Dec
(19) |
| 2009 |
Jan
(46) |
Feb
(90) |
Mar
(51) |
Apr
(104) |
May
(13) |
Jun
(24) |
Jul
(20) |
Aug
(39) |
Sep
(109) |
Oct
(101) |
Nov
(117) |
Dec
(57) |
| 2010 |
Jan
(55) |
Feb
(42) |
Mar
(39) |
Apr
(22) |
May
(33) |
Jun
(41) |
Jul
(25) |
Aug
(52) |
Sep
(75) |
Oct
(60) |
Nov
(62) |
Dec
(52) |
| 2011 |
Jan
(70) |
Feb
(31) |
Mar
(26) |
Apr
(28) |
May
(17) |
Jun
(38) |
Jul
(51) |
Aug
(35) |
Sep
(27) |
Oct
(35) |
Nov
(10) |
Dec
(20) |
| 2012 |
Jan
(21) |
Feb
(29) |
Mar
(13) |
Apr
(37) |
May
(33) |
Jun
(12) |
Jul
(34) |
Aug
(27) |
Sep
(29) |
Oct
(35) |
Nov
(58) |
Dec
(27) |
| 2013 |
Jan
(27) |
Feb
(16) |
Mar
(40) |
Apr
(16) |
May
(34) |
Jun
(37) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(49) |
Nov
(13) |
Dec
(12) |
| 2014 |
Jan
(15) |
Feb
(21) |
Mar
(11) |
Apr
(13) |
May
(27) |
Jun
(60) |
Jul
(19) |
Aug
(29) |
Sep
(20) |
Oct
(28) |
Nov
(41) |
Dec
(15) |
| 2015 |
Jan
(33) |
Feb
(29) |
Mar
(26) |
Apr
(17) |
May
(2) |
Jun
(13) |
Jul
(21) |
Aug
(30) |
Sep
(22) |
Oct
(15) |
Nov
(46) |
Dec
(20) |
| 2016 |
Jan
(6) |
Feb
(5) |
Mar
(9) |
Apr
(15) |
May
(9) |
Jun
(4) |
Jul
(3) |
Aug
(4) |
Sep
(39) |
Oct
(8) |
Nov
(5) |
Dec
(8) |
| 2017 |
Jan
(4) |
Feb
(14) |
Mar
(4) |
Apr
(16) |
May
(5) |
Jun
(10) |
Jul
(25) |
Aug
(2) |
Sep
(5) |
Oct
(11) |
Nov
(8) |
Dec
(11) |
| 2018 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(1) |
May
(4) |
Jun
(21) |
Jul
(8) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(5) |
Mar
(18) |
Apr
(9) |
May
(5) |
Jun
(21) |
Jul
(25) |
Aug
(25) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
(5) |
| 2020 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(6) |
Dec
|
| 2021 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(5) |
| 2022 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(14) |
Nov
|
Dec
(1) |
| 2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(2) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(5) |
Nov
|
Dec
|
| 2024 |
Jan
(8) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(1) |
| 2025 |
Jan
(3) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2026 |
Jan
(1) |
Feb
(12) |
Mar
|
Apr
(2) |
May
(8) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: SourceForge.net <no...@so...> - 2011-04-06 14:52:17
|
Bugs item #3277533, was opened at 2011-04-06 16:52 Message generated for change (Tracker Item Submitted) made by mortoray You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3277533&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: edA-qa mort-ora-y (mortoray) Assigned to: Nobody/Anonymous (nobody) Summary: linking issues with sessionID Initial Comment: Using sessions it is possible to use QuantLib in a threaded program. This is obviously not an ideal solution and becomes very error prone if individual coders don't pay close attention to this. More importantly however, there are a few issues related to doing this: 1. Linking is a serious problem. You cannot use a shared library correctly since the sessionID function needs to be linked. Static libraries kind of work, until you have multiple shared libraries which wish to use QuantLib. 2. Session management is unclear. How can a session be cleaned up? If sessionId simply returns a thread id it means an endless number of sessions are created. I'm not trying to be difficult, but point #1 is a critical issue for us. I have really struggled with both CMake and AutoMake to try and link the library correctly. Currently I'm stuck with automake on Fedora, it just can't resolve the sessionId symbol correctly when using transitive dependencies. I hope I can find a solution. since I understand replacing sessions would be a significant fix, at least drop the need for the sessionId function. Instead have a library calls "createSession" , "setSession", and "deleteSession". This would clear up the linking problems and allow a dynamic library to be shared by multiple libraries at the same time. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3277533&group_id=12740 |
|
From: John M. <jwm...@ya...> - 2011-04-05 17:10:35
|
Luigi- Great. Thanks. As you can see in my post in the User list, I was having trouble getting QuantLib to work using VC 2010 and boost 1.46.1. I'll test it later with my managed wrapper to see how well it works. Regards, John Maiden ________________________________ From: Luigi Ballabio <lui...@gm...> To: John Maiden <jwm...@ya...> Cc: qua...@li... Sent: Tue, April 5, 2011 12:36:54 PM Subject: Re: [Quantlib-dev] Visual Studio 2010 compilation and link problems On Tue, 2011-04-05 at 09:01 +0200, Luigi Ballabio wrote: > On Tue, 2011-04-05 at 03:27 +0000, John Maiden wrote: > > I see a VC 2010 project in the branches/R01010x-branch; which version of >boost > > are you using with this? > > I've been using Boost 1.44, mostly because it was the latest version for > which a binary installer was available and I didn't bother to compile > the thing myself---I'm doing very little development on Windows these > days. I see there's a binary installer for 1.46.1 available now, so I > might try that one instead. I'll let you know if it works. It seems to have worked--I have only compiled the QuantLib solution, though, not the QuantLibAddin stuff. Luigi -- A child of five would understand this. Send someone to fetch a child of five. -- Groucho Marx |
|
From: Luigi B. <lui...@gm...> - 2011-04-05 16:37:05
|
On Tue, 2011-04-05 at 09:01 +0200, Luigi Ballabio wrote: > On Tue, 2011-04-05 at 03:27 +0000, John Maiden wrote: > > I see a VC 2010 project in the branches/R01010x-branch; which version of boost > > are you using with this? > > I've been using Boost 1.44, mostly because it was the latest version for > which a binary installer was available and I didn't bother to compile > the thing myself---I'm doing very little development on Windows these > days. I see there's a binary installer for 1.46.1 available now, so I > might try that one instead. I'll let you know if it works. It seems to have worked--I have only compiled the QuantLib solution, though, not the QuantLibAddin stuff. Luigi -- A child of five would understand this. Send someone to fetch a child of five. -- Groucho Marx |
|
From: Luigi B. <lui...@gm...> - 2011-04-05 07:02:09
|
On Tue, 2011-04-05 at 03:27 +0000, John Maiden wrote: > I see a VC 2010 project in the branches/R01010x-branch; which version of boost > are you using with this? I've been using Boost 1.44, mostly because it was the latest version for which a binary installer was available and I didn't bother to compile the thing myself---I'm doing very little development on Windows these days. I see there's a binary installer for 1.46.1 available now, so I might try that one instead. I'll let you know if it works. Luigi -- The Feynman Problem Solving Algorithm: 1) Write down the problem. 2) Think very hard. 3) Write down the solution. |
|
From: John M. <jwm...@ya...> - 2011-04-05 03:28:08
|
Luigi- I see a VC 2010 project in the branches/R01010x-branch; which version of boost are you using with this? John |
|
From: 蔡宗儒-風險管理處-銀行 <Jas...@si...> - 2011-04-01 03:56:53
|
Hi dears, After survey, I think LM method is goal to "Fitting". Hence,in E2 = -1+x+x^2 (the unexpected solution), LM method min the distance between 0 and -1+x+x^2. Since LM method is to min the distance instead of function value, as your words, it is not suitable for my problem. My conclusion is : 1.When I want to min the math function, I should not choose LM method. 2.When I want to do fitting, LM method can do very well. In testsuite->optimizers.hpp, LM method is essential different from ConjugateGradient,SteepestDescent or BFGS. It is just fortunate to got the min(the example in C# is 1+x+x^2 but not -1+x+x^2). Thanks for your help!! Regards, 蔡宗儒 Jason Tsai 永豐銀行風險管理處 TEL:81618681 FAX:81618482 -----Original Message----- From: Luigi Ballabio [mailto:lui...@gm...] Sent: Thursday, March 31, 2011 5:02 PM To: 蔡宗儒-風險管理處-銀行 Cc: Kim Kuen Tang; qua...@li... Subject: Re: [Quantlib-dev] Hi, I'm the user of QuantLib On Mon, 2011-03-28 at 10:17 +0800, 蔡宗儒-風險管理處-銀行 wrote: > Can you tell me LevenbergMarquardt in Qunatlib is goal to find > min or root? It should be the min, but I'm afraid that the MINPACK routine it calls stops at a root because it minimizes the sum of squares. LevenbergMarquardt is probably not the right optimizer for your problem; I suggest you use another. Luigi -- fix, n.,v. What one does when a problem has been reported too many times to be ignored. -- the Jargon file |
|
From: Luigi B. <lui...@gm...> - 2011-03-31 14:20:34
|
On Thu, 2011-03-10 at 22:08 -0500, Arthur Pham wrote: > Also in the coverage report i saw something wierd : The file > rangeaccrual.cpp in the test suite is not launched from > quantlibtestsuite.cpp. You're right---and surprise, surprise, the range-accrual tests fail if I enable them... Nando, can you look into this? Luigi -- An ideal world is left as an exercise to the reader. -- Paul Graham |
|
From: Luigi B. <lui...@gm...> - 2011-03-31 09:15:14
|
On Thu, 2011-03-24 at 14:11 +0000, Grześ Andruszkiewicz wrote: > I have a bit off topic question maybe, but it seems to be solved in > QuantLib - how do you configure Visual Studio and gcc so that they are > able to work with the same file encoding? I created a toy project in > VS, but it fails to compile in gcc (undel Linux) :( I'm not sure I get the problem. What kind of errors do you get? Luigi -- There is no opinion so absurd that some philosopher will not express it. -- Marcus Tullius Cicero, "Ad familiares" |
|
From: Luigi B. <lui...@gm...> - 2011-03-31 09:02:15
|
On Mon, 2011-03-28 at 10:17 +0800, 蔡宗儒-風險管理處-銀行 wrote: > Can you tell me LevenbergMarquardt in Qunatlib is goal to find > min or root? It should be the min, but I'm afraid that the MINPACK routine it calls stops at a root because it minimizes the sum of squares. LevenbergMarquardt is probably not the right optimizer for your problem; I suggest you use another. Luigi -- fix, n.,v. What one does when a problem has been reported too many times to be ignored. -- the Jargon file |
|
From: gigifaye29 <xin...@td...> - 2011-03-30 17:45:08
|
Hi Pepe, I saw your msg as below...wondering if you guys have done any of these yet on mortgage with prepayment options. Thanks, Xin Jose Aparicio-Navarro wrote: > > Quoting Nathan Abbott <nka...@gm...>: > >> Btw, if anybody is interested in residential prepayments/OAS calculations >> and willing to implement that or is working on that, please contact me >> and >> we can hopefully coordinate. Please note however that we have limited >> (almost zero) expertise on that subject. >> > > I can do the prepayment and default bits if you want, I am familiar with > the > prepayment models. As you suggest this might change your pricing, I could > implement them as a probability of a notional surviving fraction. > We can work out the details. > > Regards > Pepe > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > -- View this message in context: http://old.nabble.com/mortgage-bond-tp22403757p31279693.html Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: Luigi B. <lui...@gm...> - 2011-03-29 13:59:30
|
On Tue, 2011-03-29 at 07:12 -0400, Arthur Pham wrote: > In case you do not know gource, i have generated a video representing > the svn history of the whole quantlib project over 10 years : > > > http://www.youtube.com/watch?v=IS0Bi0aDQSU&hd=1 Cool, thanks. Luigi -- The economy depends about as much on economists as the weather does on weather forecasters. -- Jean-Paul Kauffmann |
|
From: Arthur P. <art...@gm...> - 2011-03-29 11:12:13
|
Hi Quantlib, In case you do not know gource, i have generated a video representing the svn history of the whole quantlib project over 10 years : http://www.youtube.com/watch?v=IS0Bi0aDQSU&hd=1 Cheers, Arthur PHAM art...@gm... |
|
From: 蔡宗儒-風險管理處-銀行 <Jas...@si...> - 2011-03-28 03:57:04
|
Hello,
I deeply appreciate for your reply.(you are right about 0.6180)
Actually, in E1, the root is not real and the min is (-0.5, 0.75)
in E2, the root is (-1.6180,0) ,(0.6180,0) and the min is (-0.5,-1.25)
When using LevenbergMarquardt the result is the min in E1 but root in E2.
When using ConjugateGradient the result is the min in E1 and also min in E2.
I got a little confused about these two optimization method.
The method ConjugateGradient in Qunatlib is actully to find the min.
But I don't know how to read the LevenbergMarquardt result.
Can you tell me LevenbergMarquardt in Qunatlib is goal to find min or root?
Thanks for you reply again!!!!
Here is my code in c#(sorry about not c++)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLNet;
class Program
{
static void Main(string[] args)
{
Vector coefficients = new Vector();
coefficients.Add(-1);
coefficients.Add(1);
coefficients.Add(1);
CostFunction costFunction = new OneDimensionalPolynomialDegreeN(coefficients);
Constraint constraint = new NoConstraint();
Vector initialValue = new Vector(1, 2);
Problem problem = new Problem(costFunction, constraint, initialValue);
double epslon = 1.0e-10;
OptimizationMethod optimizationMethod = new LevenbergMarquardt(epslon, epslon, epslon);
//OptimizationMethod optimizationMethod = new ConjugateGradient();
EndCriteria endCriteria = new EndCriteria(1000, 100, epslon, epslon, epslon);
EndCriteria.Type endCriteriaType = optimizationMethod.minimize(problem, endCriteria);
Vector x = problem.currentValue();
Vector y = problem.values(x);
Console.WriteLine("endCriteriaType : " + endCriteriaType.ToString());
Console.WriteLine("x : " + x[0]);
Console.WriteLine("y : " + y[0]);
Console.Read();
}
public class OneDimensionalPolynomialDegreeN : CostFunction
{
private Vector coefficients_;
private int polynomialDegree_;
public OneDimensionalPolynomialDegreeN(Vector coefficients)
{
coefficients_ = new Vector(coefficients);
polynomialDegree_ = coefficients.size() - 1;
}
public override double value(Vector x)
{
if (x.size() != 1) throw new ApplicationException("independent variable must be 1 dimensional");
double y = 0;
for (int i = 0; i <= polynomialDegree_; ++i)
y += coefficients_[i] * Utils.Pow(x[0], i);
return y;
}
public override Vector values(Vector x)
{
if (x.size() != 1) throw new ApplicationException("independent variable must be 1 dimensional");
Vector y = new Vector(1);
y[0] = value(x);
return y;
}
}
}
Thank you very much!!!!
Regards,
蔡宗儒 Jason Tsai
永豐銀行風險管理處
TEL:81618681
FAX:81618482
________________________________
From: Kim Kuen Tang [mailto:kue...@vo...]
Sent: Monday, March 28, 2011 3:37 AM
To: qua...@li...; 蔡宗儒-風險管理處-銀行
Subject: Re: [Quantlib-dev] Hi, I'm the user of QuantLib
Hi Jason,
can you provide a standalone example the next time?
Am 25.03.2011 05:09, schrieb 蔡宗儒-風險管理處-銀行:
Hello,
I'm the user of QuantLib.
I have some question about optimization.
I use the optimization method LevenbergMarquardt and the cost function OneDimensionalPolynomialDegreeN in optimizers.cpp
I solve the following eqtions seperately(I did not solve together)
E1 = 1+x+x^2
E2 = -1+x+x^2
In E1, I get the right solution, (x ,E1)=(-0.5 , 0.75)
In E2, I get the wrong solution, (x,E2)=(-0.6180 , 0)
I think the reason why E2 get the wrong answear is that LevenbergMarquardt method use "MINPACK.lmdif".The MINPACK.lmdif seems to minize the sum of square.
This is true according to the documentation for minpack subroutine lmdif. So the procedure will terminate when especially a root is founded. This is also the reason why you got 0.6180 ( you really mean 0.6180 and not -0.6180) as a result since this is a root from E2.
Below a standalone example is provided:
# include <iostream>
# include <ql/math/optimization/levenbergmarquardt.hpp>
# include <ql/math/optimization/constraint.hpp>
# include <ql/math/optimization/costfunction.hpp>
# include <boost/foreach.hpp>
using namespace QuantLib;
class OneDimensionalPolynomialDegreeN : public CostFunction {
public:
OneDimensionalPolynomialDegreeN(const Array& coefficients)
: coefficients_(coefficients),
polynomialDegree_(coefficients.size()-1) {}
Real value(const Array& x) const {
QL_REQUIRE(x.size()==1,"independent variable must be 1 dimensional");
Real y = 0;
for (Size i=0; i<=polynomialDegree_; ++i) y += coefficients_[i]*std::pow(x[0],static_cast<int>(i));
return y;
}
Disposable<Array> values(const Array& x) const{
QL_REQUIRE(x.size()==1,"independent variable must be 1 dimensional");
Array y(1);
y[0] = value(x);
return y;
}
private:
Array const coefficients_;
Size const polynomialDegree_;
};
int main()
{
Array c(3, 1.0); c[0]=-1.0;
OneDimensionalPolynomialDegreeN p(c);
NoConstraint n;
Real ps[] = { -3.0,-2.0,-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,3.0 };
std::cout<< "init" << "\t" << "result" << "\t" << "value" << "\t" << "ec" << "\n";
BOOST_FOREACH(Real init,ps)
{
Array i(1, init);
LevenbergMarquardt o;
EndCriteria e(1000, 100, 1e-5, 1e-5, 1e-5);
Problem pp(p, n,i);
EndCriteria::Type ec = o.minimize(pp, e);
Array xM = pp.currentValue();
Array yM = pp.values(xM);
std::cout<< init << "\t" << xM[0] << "\t" << yM[0] << "\t" << ec << "\n";
}
return 1;
}
That means it dose not minize the equation but MSE.
Therefore,I think LevenbergMarquardt in QuantLib seems to min the value (E1-0)^2 in E1 and min the value (E2-0)^2 in E2.Hence I got the wrong solution.
So, did I use the method wrong ?
Or QuantLib use the wrong methd "MINPACK.lmdif" ?
Regards,
蔡宗 儒 Jason Tsai
永豐銀行 風險管理處
TEL:81618681
FAX:81618482
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
QuantLib-dev mailing list
Qua...@li...
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
|
|
From: Eric E. <eri...@na...> - 2011-03-27 21:58:24
|
Hi Peter, > However, if I recompute e.g. cell a2 (the first rate helper) and a9 > afterwards, I see the same effect, i.e. the yield curve object seems to > have received a notification from the recomputed rate helper object? I > thought that recomputation of a cell containing a ql-constructor creates a > new object using the constructor and deletes the previous version of the > object? Obviously this is not the case, but something smarter is going on. > Could you briefly explain please? ObjectHandler has some extra logic to ensure that objects are always kept up to date. For various reasons OH keeps track of all of the relationships between objects. When an object is retrieved, OH verifies that the object is newer than its precedents and if not the object is recreated. This relies on an implementation of the Observer/Observable pattern which is local to OH and separate from QuantLib's use of the same pattern. This logic in OH is also independent of Excel. For more detail see class ObjectWrapper. I recreated your test for the memory leak and was not immediately able to find an explanation or a solution, I continue to investigate and will keep you posted. Many thanks for your feedback. 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 |
|
From: Kim K. T. <kue...@vo...> - 2011-03-27 19:37:26
|
Hi Jason,
can you provide a standalone example the next time?
Am 25.03.2011 05:09, schrieb 蔡宗儒-風險管理處-銀行:
> Hello,
> I'm the user of QuantLib.
> I have some question about optimization.
> I use the optimization method *_LevenbergMarquardt_*and the cost
> function *_OneDimensionalPolynomialDegreeN_*in optimizers.cpp
> I solve the following eqtions seperately(I did not solve together)
> E1 = 1+x+x^2
> E2 = -1+x+x^2
> In E1, I get the right solution, (x ,E1)=(-0.5 , 0.75)
> In E2, I get the *wrong* solution, (x,E2)=(-0.6180 , 0)
> I think the reason why E2 get the wrong answear is that
> *_LevenbergMarquardt_* method use "MINPACK.lmdif".The MINPACK.lmdif
> seems to minize the sum of square.
This is true according to the documentation for minpack subroutine
lmdif. So the procedure will terminate when especially a root is
founded. This is also the reason why you got 0.6180 ( you really mean
0.6180 and not -0.6180) as a result since this is a root from E2.
Below a standalone example is provided:
# include <iostream>
# include <ql/math/optimization/levenbergmarquardt.hpp>
# include <ql/math/optimization/constraint.hpp>
# include <ql/math/optimization/costfunction.hpp>
# include <boost/foreach.hpp>
using namespace QuantLib;
class OneDimensionalPolynomialDegreeN : public CostFunction {
public:
OneDimensionalPolynomialDegreeN(const Array& coefficients)
: coefficients_(coefficients),
polynomialDegree_(coefficients.size()-1) {}
Real value(const Array& x) const {
QL_REQUIRE(x.size()==1,"independent variable must be 1 dimensional");
Real y = 0;
for (Size i=0; i<=polynomialDegree_; ++i) y +=
coefficients_[i]*std::pow(x[0],static_cast<int>(i));
return y;
}
Disposable<Array> values(const Array& x) const{
QL_REQUIRE(x.size()==1,"independent variable must be 1 dimensional");
Array y(1);
y[0] = value(x);
return y;
}
private:
Array const coefficients_;
Size const polynomialDegree_;
};
int main()
{
Array c(3, 1.0); c[0]=-1.0;
OneDimensionalPolynomialDegreeN p(c);
NoConstraint n;
Real ps[] = { -3.0,-2.0,-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,3.0 };
std::cout<< "init" << "\t" << "result" << "\t" << "value" << "\t" <<
"ec" << "\n";
BOOST_FOREACH(Real init,ps)
{
Array i(1, init);
LevenbergMarquardt o;
EndCriteria e(1000, 100, 1e-5, 1e-5, 1e-5);
Problem pp(p, n,i);
EndCriteria::Type ec = o.minimize(pp, e);
Array xM = pp.currentValue();
Array yM = pp.values(xM);
std::cout<< init << "\t" << xM[0] << "\t" << yM[0] << "\t" << ec << "\n";
}
return 1;
}
> That means it dose not minize the equation but MSE.
> Therefore,I think *_LevenbergMarquardt_* in QuantLib seems to min the
> value (E1-0)^2 in E1 and min the value (E2-0)^2 in E2.Hence I got the
> wrong solution.
> So, did I use the method wrong ?
> Or QuantLib use the wrong methd "MINPACK.lmdif" ?
> Regards,
> 蔡宗 儒 Jason Tsai
> 永豐銀行 風險管理處
> TEL:81618681
> FAX:81618482
>
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
>
>
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
|
|
From: Peter C. <pca...@vo...> - 2011-03-25 15:28:50
|
> would you elaborate a little more here.
For simplicity, first replace the references in the rate helpers to the
quotes by simple excel constants, i.e. change the formula in a2 to
=qlDepositRateHelper2("R1";0.02;"2m";2;"TARGET";"MF";;"ACT/360")
Now compute a6 (yield curve) and a9 (discount factor). I get
0.9983375805
Next, change cell a2 to
=qlDepositRateHelper2("R1";0.021;"2m";2;"TARGET";"MF";;"ACT/360")
and compute a9 (a6 is not computed before!). Now I get
0.9982546818
(All this also works when leaving the references to the quotes as they are
and instead of computing cell a2 compute c2)
There is no call of setValue() in this whole procedure. But obviously the
yield curve objects update() method must have been called through computing
a2, otherwise I would not get a different discount factor? But that would
mean that some observable / observer notification takes place and I would
like to understand how exactly.
Thx, Peter
-----Ursprüngliche Nachricht-----
Von: fer...@gm... [mailto:fer...@gm...] Im
Auftrag von Ferdinando Ametrano
Gesendet: Freitag, 25. März 2011 11:06
An: Peter Caspers
Cc: Eric Ehlers; qua...@li...
Betreff: Re: Re: [Quantlib-dev] qlxl dependencies and object updates
Hi Peter
> In fact there may be a problem. I attach an example sheet. [...] During
this I
> observe that more and more memory is used by excel.exe. Escaping the
> loop, the number of objects is 5 (seems ok). If I delete the yield curve
> object (by computing cell b12) the memory allocated before is released.
>
> I am aware that one should not recompute the yield curve object if quotes
> are updated, but rather rely on the implemented observer pattern. However
> the behaviour above should not be as it is, should it?
yes, I think you've found a genuine memory leak. Eric ?
> However, if I recompute e.g. cell a2 (the first rate helper) and a9
> afterwards, I see the same effect, i.e. the yield curve object seems to
> have received a notification from the recomputed rate helper object?
would you elaborate a little more here. I mean there might be a lot
going on under the surface (and undocumented :-), but before
discovering my cards I would need to understand what exactly do you do
in this second case. Namely before recomputing a2 do you setValue ?
What do you mean by "the yield curve object seems to have received a
notification from the recomputed rate helper object"
later
ciao -- Nando
|
|
From: Ferdinando A. <na...@am...> - 2011-03-25 10:06:53
|
Hi Peter > In fact there may be a problem. I attach an example sheet. [...] During this I > observe that more and more memory is used by excel.exe. Escaping the > loop, the number of objects is 5 (seems ok). If I delete the yield curve > object (by computing cell b12) the memory allocated before is released. > > I am aware that one should not recompute the yield curve object if quotes > are updated, but rather rely on the implemented observer pattern. However > the behaviour above should not be as it is, should it? yes, I think you've found a genuine memory leak. Eric ? > However, if I recompute e.g. cell a2 (the first rate helper) and a9 > afterwards, I see the same effect, i.e. the yield curve object seems to > have received a notification from the recomputed rate helper object? would you elaborate a little more here. I mean there might be a lot going on under the surface (and undocumented :-), but before discovering my cards I would need to understand what exactly do you do in this second case. Namely before recomputing a2 do you setValue ? What do you mean by "the yield curve object seems to have received a notification from the recomputed rate helper object" later ciao -- Nando |
|
From: 蔡宗儒-風險管理處-銀行 <Jas...@si...> - 2011-03-25 05:39:39
|
Hello,
I'm the user of QuantLib.
I have some question about optimization.
I use the optimization method LevenbergMarquardt and the cost function OneDimensionalPolynomialDegreeN in optimizers.cpp
I solve the following eqtions seperately(I did not solve together)
E1 = 1+x+x^2
E2 = -1+x+x^2
In E1, I get the right solution, (x ,E1)=(-0.5 , 0.75)
In E2, I get the wrong solution, (x,E2)=(-0.6180 , 0)
I think the reason why E2 get the wrong answear is that LevenbergMarquardt method use "MINPACK.lmdif".The MINPACK.lmdif seems to minize the sum of square.
That means it dose not minize the equation but MSE.
Therefore,I think LevenbergMarquardt in QuantLib seems to min the value (E1-0)^2 in E1 and min the value (E2-0)^2 in E2.Hence I got the wrong solution.
So, did I use the method wrong ?
Or QuantLib use the wrong methd "MINPACK.lmdif" ?
Regards,
蔡宗儒 Jason Tsai
永豐銀行風險管理處
TEL:81618681
FAX:81618482
|
|
From: Eric E. <eri...@na...> - 2011-03-24 20:47:13
|
Hi Nando, > might we call it ohCleanRows or ohRemoveInvalidRows or anything more > descriptive different from ohPack? > > what about adding ohCleanColumns too ? Done. 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 |
|
From: Peter C. <pca...@vo...> - 2011-03-24 19:39:51
|
Hi Eric, Ferdinando, ok, I completely misinterpreted the meaning of the overwrite flag up to now. In fact there may be a problem. I attach an example sheet. Please open it in an excel with automatic calculations disabled. Calling the macro test will create two quotes in cells c2 and c3 and two associated rate helpers in cells a2 and a3. Then a piecewise yield curve object in cell a6 is created and recomputed many times in an infinite loop. During this I observe that more and more memory is used by excel.exe. Escaping the loop, the number of objects is 5 (seems ok). If I delete the yield curve object (by computing cell b12) the memory allocated before is released. I am aware that one should not recompute the yield curve object if quotes are updated, but rather rely on the implemented observer pattern. However the behaviour above should not be as it is, should it? And there is one more thing I do not understand (for today): The update of a quote by the setValue method will force the recomputation of the yield curve (as a lazy object observing the rate helpers), as I can reproduce by computing cell d2 (setValue on Quote) and a9 (get discount factor from yield curve). This is as expected and working just as in a pure C++ world. However, if I recompute e.g. cell a2 (the first rate helper) and a9 afterwards, I see the same effect, i.e. the yield curve object seems to have received a notification from the recomputed rate helper object? I thought that recomputation of a cell containing a ql-constructor creates a new object using the constructor and deletes the previous version of the object? Obviously this is not the case, but something smarter is going on. Could you briefly explain please? Thanks a lot Peter ---------------------------------------------------------------------- From: "Eric Ehlers" <eri...@na...> To: "Peter Caspers" <pca...@vo...> Date: Thu, 24 Mar 2011 01:04:56 +0100 Subject: Re: [Quantlib-dev] qlxl dependencies and object updates > Hi Peter, > > > Eric, thank you very much. I will try to set overwrite to yes in the > > formulas, this is certainly the origin of the problem. Is it by the > > way in general useful _not_ to overwrite objects, i.e. is there a > > special reason why this parameter defaults to false? > > Happy to help. Usually you would allow the overwrite parameter to > default to false. Suppose you create an object with ID foo. Then you > attempt to recreate a new object foo, for example during a recalc. > The system verifies that the new object resides in the same cell as > the existing one, which is the usual case, and the old object is > overwritten by the new one. If the new object resides in a different > cell, this usually indicates an error on the part of the user - you > have tried to create two different objects with the same name - and > the construction of the new object fails with an error message to the > effect that an existing object with the same name resides in a > different cell. If you set overwrite to true then the creation of the > new object will succeed even if the new object resides in a different > cell than the old one. There are not many situations where it is > desirable to set overwrite to true. > > I am worried that you have found a memory leak so I am curious to hear > the results of your investigations. > > 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 > > |
|
From: Ferdinando A. <na...@am...> - 2011-03-24 16:55:11
|
Hi all as a general rule I suggest to avoid to recreate multiple time the same object. If such a need arise it is generally an indication of bad design: an object should be able to alter its state without being recreated. Anyway if you have to recreate an object multiple time this means you create it in a dynamically changing workbook which is open and recalculated: in this case I suggest to keep the object anonymous. Naming it would be useless as you will have to reference it using the cell address (or even better a named range), otherwise Excel won't keep track of the dependency. If you don't use names the overwrite parameter is not effective. ciao -- nando |
|
From: Grześ A. <gan...@gm...> - 2011-03-24 14:11:48
|
Hi, I have a bit off topic question maybe, but it seems to be solved in QuantLib - how do you configure Visual Studio and gcc so that they are able to work with the same file encoding? I created a toy project in VS, but it fails to compile in gcc (undel Linux) :( Grzegorz |
|
From: Eric E. <eri...@na...> - 2011-03-24 00:04:52
|
Hi Peter, > Eric, thank you very much. I will try to set overwrite to yes in the > formulas, this is certainly the origin of the problem. Is it by the > way in general useful _not_ to overwrite objects, i.e. is there a > special reason why this parameter defaults to false? Happy to help. Usually you would allow the overwrite parameter to default to false. Suppose you create an object with ID foo. Then you attempt to recreate a new object foo, for example during a recalc. The system verifies that the new object resides in the same cell as the existing one, which is the usual case, and the old object is overwritten by the new one. If the new object resides in a different cell, this usually indicates an error on the part of the user - you have tried to create two different objects with the same name - and the construction of the new object fails with an error message to the effect that an existing object with the same name resides in a different cell. If you set overwrite to true then the creation of the new object will succeed even if the new object resides in a different cell than the old one. There are not many situations where it is desirable to set overwrite to true. I am worried that you have found a memory leak so I am curious to hear the results of your investigations. 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 |
|
From: Peter C. <pca...@vo...> - 2011-03-23 20:28:29
|
Eric, thank you very much. I will try to set overwrite to yes in the formulas, this is certainly the origin of the problem. Is it by the way in general useful _not_ to overwrite objects, i.e. is there a special reason why this parameter defaults to false? Peter Am 22.03.2011 23:53, schrieb Eric Ehlers: > Hi Peter, > >> 2. If I have a sheet where I construct an object depending on some input >> on the same sheet and these input cells does not change, then the >> version of the object is updated every time I press shift F9. Why is >> that? Excel should think that no recalculation is necessary, i.e. the >> cell should not be dirty in the dependency tree and the version should >> not be updated? > > IIRC cell X's dependencies recalculate whenever cell X recalculates, > whether or not the value in cell X changes. > >> 3. The trigger argument in constructors: Is that purely dummy forcing a >> dependency on excel level > > Yes. > >> 4. Overwrite: I suppose that not specified means true. > > Not specified means false. > >> When I >> recalculate a sheet very often it slows down until it is not usable any >> more. My workaround is to call the delete all objects - method in the oh >> on a suitable position in the recalculation loop. Then it works fine. >> This looks like objects are not overwritten, but new objects are created >> on every update? > > What does ohRepositoryObjectCount() tell you? > > 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 > |
|
From: Ferdinando A. <na...@am...> - 2011-03-23 15:56:37
|
Hi Eric On Wed, Mar 23, 2011 at 1:19 PM, <eri...@us...> wrote: > Revision: 17675 > http://quantlib.svn.sourceforge.net/quantlib/?rev=17675&view=rev > Author: ericehlers > Date: 2011-03-23 12:19:54 +0000 (Wed, 23 Mar 2011) > > Log Message: > ----------- > Implement new function ohPack2(). > [...] > + <Procedure name='ohPack2'> > + <description>trim error/null/empty rows from matrix/vector.</description> might we call it ohCleanRows or ohRemoveInvalidRows or anything more descriptive different from ohPack? what about adding ohCleanColumns too ? ciao -- Nando |