You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(60) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(18) |
Feb
(4) |
Mar
(6) |
Apr
(2) |
May
|
Jun
(12) |
Jul
(48) |
Aug
(6) |
Sep
(3) |
Oct
(24) |
Nov
(15) |
Dec
(18) |
| 2002 |
Jan
(39) |
Feb
(12) |
Mar
(80) |
Apr
(72) |
May
(46) |
Jun
(27) |
Jul
(23) |
Aug
(34) |
Sep
(65) |
Oct
(71) |
Nov
(19) |
Dec
(14) |
| 2003 |
Jan
(44) |
Feb
(59) |
Mar
(18) |
Apr
(62) |
May
(54) |
Jun
(27) |
Jul
(46) |
Aug
(15) |
Sep
(44) |
Oct
(36) |
Nov
(19) |
Dec
(12) |
| 2004 |
Jan
(26) |
Feb
(33) |
Mar
(47) |
Apr
(63) |
May
(36) |
Jun
(65) |
Jul
(80) |
Aug
(163) |
Sep
(65) |
Oct
(39) |
Nov
(36) |
Dec
(39) |
| 2005 |
Jan
(97) |
Feb
(78) |
Mar
(64) |
Apr
(64) |
May
(48) |
Jun
(55) |
Jul
(89) |
Aug
(57) |
Sep
(51) |
Oct
(111) |
Nov
(86) |
Dec
(76) |
| 2006 |
Jan
(84) |
Feb
(103) |
Mar
(143) |
Apr
(92) |
May
(55) |
Jun
(58) |
Jul
(71) |
Aug
(57) |
Sep
(74) |
Oct
(59) |
Nov
(8) |
Dec
(32) |
| 2007 |
Jan
(60) |
Feb
(40) |
Mar
(50) |
Apr
(26) |
May
(61) |
Jun
(120) |
Jul
(119) |
Aug
(48) |
Sep
(121) |
Oct
(66) |
Nov
(103) |
Dec
(43) |
| 2008 |
Jan
(60) |
Feb
(109) |
Mar
(92) |
Apr
(106) |
May
(82) |
Jun
(59) |
Jul
(67) |
Aug
(118) |
Sep
(131) |
Oct
(56) |
Nov
(37) |
Dec
(69) |
| 2009 |
Jan
(75) |
Feb
(76) |
Mar
(103) |
Apr
(78) |
May
(61) |
Jun
(35) |
Jul
(66) |
Aug
(69) |
Sep
(166) |
Oct
(46) |
Nov
(72) |
Dec
(65) |
| 2010 |
Jan
(48) |
Feb
(57) |
Mar
(93) |
Apr
(85) |
May
(123) |
Jun
(82) |
Jul
(98) |
Aug
(121) |
Sep
(146) |
Oct
(86) |
Nov
(72) |
Dec
(34) |
| 2011 |
Jan
(96) |
Feb
(55) |
Mar
(73) |
Apr
(57) |
May
(33) |
Jun
(74) |
Jul
(89) |
Aug
(71) |
Sep
(103) |
Oct
(76) |
Nov
(52) |
Dec
(61) |
| 2012 |
Jan
(48) |
Feb
(54) |
Mar
(78) |
Apr
(60) |
May
(75) |
Jun
(59) |
Jul
(33) |
Aug
(66) |
Sep
(43) |
Oct
(46) |
Nov
(75) |
Dec
(51) |
| 2013 |
Jan
(112) |
Feb
(72) |
Mar
(49) |
Apr
(48) |
May
(42) |
Jun
(44) |
Jul
(80) |
Aug
(19) |
Sep
(33) |
Oct
(37) |
Nov
(38) |
Dec
(98) |
| 2014 |
Jan
(113) |
Feb
(93) |
Mar
(49) |
Apr
(106) |
May
(97) |
Jun
(155) |
Jul
(87) |
Aug
(127) |
Sep
(85) |
Oct
(48) |
Nov
(41) |
Dec
(37) |
| 2015 |
Jan
(34) |
Feb
(50) |
Mar
(104) |
Apr
(80) |
May
(82) |
Jun
(66) |
Jul
(41) |
Aug
(84) |
Sep
(37) |
Oct
(65) |
Nov
(83) |
Dec
(52) |
| 2016 |
Jan
(68) |
Feb
(35) |
Mar
(42) |
Apr
(35) |
May
(54) |
Jun
(75) |
Jul
(45) |
Aug
(52) |
Sep
(60) |
Oct
(52) |
Nov
(36) |
Dec
(64) |
| 2017 |
Jan
(92) |
Feb
(59) |
Mar
(35) |
Apr
(53) |
May
(83) |
Jun
(43) |
Jul
(65) |
Aug
(68) |
Sep
(46) |
Oct
(75) |
Nov
(40) |
Dec
(49) |
| 2018 |
Jan
(68) |
Feb
(54) |
Mar
(48) |
Apr
(58) |
May
(51) |
Jun
(44) |
Jul
(40) |
Aug
(68) |
Sep
(35) |
Oct
(15) |
Nov
(7) |
Dec
(37) |
| 2019 |
Jan
(43) |
Feb
(7) |
Mar
(22) |
Apr
(21) |
May
(31) |
Jun
(39) |
Jul
(73) |
Aug
(45) |
Sep
(47) |
Oct
(89) |
Nov
(19) |
Dec
(69) |
| 2020 |
Jan
(52) |
Feb
(63) |
Mar
(45) |
Apr
(59) |
May
(42) |
Jun
(57) |
Jul
(30) |
Aug
(29) |
Sep
(75) |
Oct
(64) |
Nov
(96) |
Dec
(22) |
| 2021 |
Jan
(14) |
Feb
(24) |
Mar
(35) |
Apr
(58) |
May
(36) |
Jun
(15) |
Jul
(18) |
Aug
(31) |
Sep
(30) |
Oct
(33) |
Nov
(27) |
Dec
(16) |
| 2022 |
Jan
(35) |
Feb
(22) |
Mar
(14) |
Apr
(20) |
May
(44) |
Jun
(53) |
Jul
(25) |
Aug
(56) |
Sep
(11) |
Oct
(47) |
Nov
(22) |
Dec
(36) |
| 2023 |
Jan
(30) |
Feb
(17) |
Mar
(31) |
Apr
(48) |
May
(31) |
Jun
(7) |
Jul
(25) |
Aug
(26) |
Sep
(61) |
Oct
(66) |
Nov
(19) |
Dec
(21) |
| 2024 |
Jan
(37) |
Feb
(29) |
Mar
(26) |
Apr
(26) |
May
(34) |
Jun
(9) |
Jul
(27) |
Aug
(13) |
Sep
(15) |
Oct
(25) |
Nov
(13) |
Dec
(8) |
| 2025 |
Jan
(13) |
Feb
(1) |
Mar
(16) |
Apr
(17) |
May
(8) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(6) |
Oct
(15) |
Nov
(6) |
Dec
|
| 2026 |
Jan
(6) |
Feb
(4) |
Mar
(20) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Dirk E. <ed...@de...> - 2025-01-13 18:46:46
|
I was a little late getting going but '1.36.99' (for 1.37-rc, respecting our sorting rules and versioning requirements) is now in Debian, and on my PPA for Ubuntu 24.04. No issues whatsoever, RQuantLib also builds and tests unchanged. Dirk -- dirk.eddelbuettel.com | @eddelbuettel | ed...@de... |
|
From: Luigi B. <lui...@gm...> - 2025-01-09 08:02:29
|
A prerelease Python wheel can also be installed from TestPyPI with
pip install -i https://test.pypi.org/simple/ QuantLib==1.37rc0
I also uploaded a prerelease nupkg at
https://int.nugettest.org/packages/QuantLib/1.37.0-rc but it doesn't seem
to be indexed and available yet. Keep an eye on that page if you want to
try it out, or download the nupkg and install it manually (which seems to
be possible). Thanks!
Luigi
On Wed, Jan 8, 2025 at 9:22 AM Luigi Ballabio <lui...@gm...>
wrote:
> Hi all,
> a release candidate for QuantLib 1.37 is available at <
> https://github.com/lballabio/QuantLib/releases/tag/1.37rc>. If you have
> some time, please try it out and report any problems here on the mailing
> list. Thanks!
>
> Luigi
>
>
|
|
From: Luigi B. <lui...@gm...> - 2025-01-08 08:22:37
|
Hi all, a release candidate for QuantLib 1.37 is available at < https://github.com/lballabio/QuantLib/releases/tag/1.37rc>. If you have some time, please try it out and report any problems here on the mailing list. Thanks! Luigi |
|
From: Luigi B. <lui...@gm...> - 2024-12-27 10:11:44
|
Hello,
instructions for building the wrappers are at
https://www.quantlib.org/install/windows-python.shtml but they don't cover
building in debug mode.
If I had to do something like that, I'd probably try to isolate the code to
debug in a small script and translate that to a small C++ program I could
debug more easily.
Hope this helps,
Luigi
Il Mar 26 Nov 2024, 17:57 Ming Zhu <mag...@ou...> ha scritto:
> Dear all,
>
> I am reaching out to seek guidance on a development workflow:
>
> 1. Make changes to QuantLib C++ with Visual Studio 2022.
> 2. Build QuantLib Python module.
> 3. Test changes in either Python script or Jupyter notebook with
> Visual Studio Code. In particular, set breakpoints in Python and debug
> underlying calculations in QuantLib C++ with Visual Studio 2022.
>
> I have QuantLib C++ and Boost libraries installed, and can run QuantLib
> with Visual Studio 2022. But I am not sure how to do the step 2 (using
> QuantLib-SWIG) and step 3 (attach vscode to vs). Really appreciate any
> detailed advice and instructions.
>
> My development setup is Windows 11, boost 1.86, QuantLib C++ 1.35, Conda,
> Visual Studio Community 2022 Version 17.12.1, and Visual Studio Code 1.95.3.
>
> Many thanks,
>
> Ming
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Luigi B. <lui...@gm...> - 2024-12-18 15:25:57
|
Here is one introduction: https://www.fluentcpp.com/2021/08/13/how-template-template-parameters-can-simplify-template-classes/ There is one difference with our case, though: in the post above, template template parameters are used to simplify the declaration but ordinary templates would work as well. In our case, we could not use ordinary templates because we would run into an infinite cycle: - the PiecewiseYieldCurve class needs Bootstrap as a template argument, because we might use different algorithms (the default, IterativeBootstrap, but also others); - IterativeBootstrap also needs the curve as a template argument, because it works with interest-rate curves but also default-probability curves, inflation curves etc.. Thus, using simple templates would lead to an infinite declaration: auto curve = PiecewiseYieldCurve<Discount, Linear, IterativeBootstrap<PiecewiseYieldCurve<Discount, Linear, IterativeBootstrap<... Passing the bootstrap class as a template template parameter breaks the cycle, Hope this helps, Luigi On Wed, Dec 18, 2024 at 1:44 PM Ming Zhu <mag...@ou...> wrote: > Dear all, > > In the definition of the PiecewiseYieldCurve class, I am puzzled by the > type definitions below: > > typedef PiecewiseYieldCurve<Traits,Interpolator,Bootstrap> this_curve; > > typedef Bootstrap<this_curve> bootstrap_type; > > Bootstrap is a template class taking one parameter. What template > parameter is used for Bootstrap in this_curve (i.e. > PiecewiseYieldCurve<Traits,Interpolator,Bootstrap>) in typedef > Bootstrap<this_curve> bootstrap_type? Can anyone recommend any reference > or book which explains the technique used here? > > Many thanks and happy holidays! > > Ming > > template <class Traits, class Interpolator, > template <class> class Bootstrap = IterativeBootstrap> > class PiecewiseYieldCurve > : public Traits::template curve<Interpolator>::type, > public LazyObject { > private: > typedef typename Traits::template curve<Interpolator>::type > base_curve; > typedef PiecewiseYieldCurve<Traits,Interpolator,Bootstrap> this_curve; > public: > typedef Traits traits_type; > typedef Interpolator interpolator_type; > typedef Bootstrap<this_curve> bootstrap_type; > > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Ming Z. <mag...@ou...> - 2024-12-18 12:41:11
|
Dear all,
In the definition of the PiecewiseYieldCurve class, I am puzzled by the
type definitions below:
typedef PiecewiseYieldCurve<Traits,Interpolator,Bootstrap> this_curve;
typedef Bootstrap<this_curve> bootstrap_type;
Bootstrap is a template class taking one parameter. What template
parameter is used for Bootstrap in this_curve (i.e.
PiecewiseYieldCurve<Traits,Interpolator,Bootstrap>) in typedef
Bootstrap<this_curve> bootstrap_type? Can anyone recommend any reference
or book which explains the technique used here?
Many thanks and happy holidays!
Ming
template <class Traits, class Interpolator,
template <class> class Bootstrap = IterativeBootstrap>
class PiecewiseYieldCurve
: public Traits::template curve<Interpolator>::type,
public LazyObject {
private:
typedef typename Traits::template curve<Interpolator>::type base_curve;
typedef PiecewiseYieldCurve<Traits,Interpolator,Bootstrap> this_curve;
public:
typedef Traits traits_type;
typedef Interpolator interpolator_type;
typedef Bootstrap<this_curve> bootstrap_type;
|
|
From: Luigi B. <lui...@gm...> - 2024-12-06 15:58:35
|
You can choose the calibration method (see https://github.com/lballabio/QuantLib/blob/v1.36/ql/termstructures/yield/nonlinearfittingmethods.hpp#L99) but if none is given, it uses the Simplex method. Luigi On Fri, Dec 6, 2024 at 3:35 PM philippe hatstadt <pha...@ma...> wrote: > Thanks Luigi. Do you know what calibration method is used, as I find that > it has a hard time finding a good global calibration. Furrhermore, the > solution is unstable to minor changes in inputs if I don’t pass an initial > guess. > > Regards > > Philippe Hatstadt > +1-203-252-0408 > > > On Dec 6, 2024, at 7:08 AM, Luigi Ballabio <lui...@gm...> > wrote: > > > Hello Philippe, > no way to fix a single parameter, I'm afraid. If you have a set of > calibrated parameters and want to use them without performing the > calibration, you can pass maxEvaluations=0 to achieve that but you'll still > have to pass at least one helper in order to establish a max date. > Starting from next release, there will be another constructor available > that takes no helpers and an explicit max date and does the same. > > Hope this helps, > Luigi > > > On Mon, Dec 2, 2024 at 4:15 PM Philippe Hatstadt via QuantLib-users < > qua...@li...> wrote: > >> Is there a way to fix one or more parameters when calibrating NS from the >> python API? >> Specifically, I would like to fix the exponential decay lambda parameter. >> >> After building instrument helpers, I use this call: >> ql.FittedBondDiscountCurve(*params, ql.NelsonSiegelFitting(),, accuracy, >> numIter, guess, simplex_lambda) >> >> I looked at the c++ code, and it seems that there is a array parameter >> that represents weights, but I didn't see anything related to freezing one >> parameter. >> >> Also, I was looking for a way to just build a NS curve by passing all >> parameters, and not perform any calibration, but I didn't see one. It's >> easy to implement, but wondering as the solution might be related to my >> first question? >> >> >> >> Best regards Philippe Hatstadt 203-252-0408 >> https://www.linkedin.com/in/philippe-hatstadt/ >> >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: philippe h. <pha...@ma...> - 2024-12-06 14:35:29
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Thanks Luigi. Do you know what calibration method is used, as I find that it has a hard time finding a good global calibration. Furrhermore, the solution is unstable to minor changes in inputs if I don’t pass an initial guess.<div><br id="lineBreakAtBeginningOfSignature"><div dir="ltr">Regards<div><br></div><div>Philippe Hatstadt</div><div>+1-203-252-0408</div><div><br></div></div><div dir="ltr"><br><blockquote type="cite">On Dec 6, 2024, at 7:08 AM, Luigi Ballabio <lui...@gm...> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Hello Philippe,<div> no way to fix a single parameter, I'm afraid. If you have a set of calibrated parameters and want to use them without performing the calibration, you can pass maxEvaluations=0 to achieve that but you'll still have to pass at least one helper in order to establish a max date. Starting from next release, there will be another constructor available that takes no helpers and an explicit max date and does the same.</div><div><br></div><div>Hope this helps,</div><div> Luigi</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 2, 2024 at 4:15 PM Philippe Hatstadt via QuantLib-users <<a href="mailto:qua...@li...">qua...@li...</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div>Is there a way to fix one or more parameters when calibrating NS from the python API?<br></div><div>Specifically, I would like to fix the exponential decay lambda parameter.<br></div><div><br></div><div>After building instrument helpers, I use this call:<br></div><div>ql.FittedBondDiscountCurve(*params, ql.NelsonSiegelFitting(),, accuracy, numIter, guess, simplex_lambda)<br></div><div><br></div><div>I looked at the c++ code, and it seems that there is a array parameter that represents weights, but I didn't see anything related to freezing one parameter.<br></div><div><br></div><div>Also, I was looking for a way to just build a NS curve by passing all parameters, and not perform any calibration, but I didn't see one. It's easy to implement, but wondering as the solution might be related to my first question?</div><div><br></div><div><br></div><div><br></div><div style="white-space:pre-wrap">Best regards Philippe Hatstadt 203-252-0408 <a href="https://www.linkedin.com/in/philippe-hatstadt/" rel="noopener noreferrer" target="_blank">https://www.linkedin.com/in/philippe-hatstadt/</a><br></div><div><br></div></div><div><br></div></div>_______________________________________________<br> QuantLib-users mailing list<br> <a href="mailto:Qua...@li..." target="_blank">Qua...@li...</a><br> <a href="https://lists.sourceforge.net/lists/listinfo/quantlib-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/quantlib-users</a><br> </blockquote></div> </div></blockquote></div></body></html> |
|
From: Luigi B. <lui...@gm...> - 2024-12-06 12:08:02
|
Hello Philippe,
no way to fix a single parameter, I'm afraid. If you have a set of
calibrated parameters and want to use them without performing the
calibration, you can pass maxEvaluations=0 to achieve that but you'll still
have to pass at least one helper in order to establish a max date.
Starting from next release, there will be another constructor available
that takes no helpers and an explicit max date and does the same.
Hope this helps,
Luigi
On Mon, Dec 2, 2024 at 4:15 PM Philippe Hatstadt via QuantLib-users <
qua...@li...> wrote:
> Is there a way to fix one or more parameters when calibrating NS from the
> python API?
> Specifically, I would like to fix the exponential decay lambda parameter.
>
> After building instrument helpers, I use this call:
> ql.FittedBondDiscountCurve(*params, ql.NelsonSiegelFitting(),, accuracy,
> numIter, guess, simplex_lambda)
>
> I looked at the c++ code, and it seems that there is a array parameter
> that represents weights, but I didn't see anything related to freezing one
> parameter.
>
> Also, I was looking for a way to just build a NS curve by passing all
> parameters, and not perform any calibration, but I didn't see one. It's
> easy to implement, but wondering as the solution might be related to my
> first question?
>
>
>
> Best regards Philippe Hatstadt 203-252-0408
> https://www.linkedin.com/in/philippe-hatstadt/
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Luigi B. <lui...@gm...> - 2024-12-02 16:25:44
|
Hello Théodore,
if you want to retrieve forwards from the curve, using piecewise flat
spreads on the zero rates is probably not the best choice. Given your
setup, on the 9th of December the zero rates jump by 9 bps from one day
to the next. Since the forward rate is the derivative of zt (the zero rate
multiplied by time) the jump causes a spike in the forward for that day.
Depending on what you're trying to model, you might want to use another
interpolation between the spreads; for instance linear interpolation, which
wouldn't cause the jump. It's also possible that what you wanted was to
apply the spreads on the forwards, but there's no such curve at this time;
if that's the case, you can open an issue.
Hope this helps,
Luigi
On Fri, Nov 22, 2024 at 1:29 PM Théodore Montel <the...@gm...>
wrote:
> Hi,
>
> I am trying to build a short term curve and would like to add a flat
> time-dependent spread on top. I am however observing an odd feature where
> there is a significant jump at the date where the spread starts, and I am
> wondering if I am doing something wrong or if there's a bug. Please see
> example code below and observe the 1 day forward rate on 9dec2024
> specifically
>
> import matplotlib.pyplot as plt
> import QuantLib as ql
> evaldate = ql.Date(22, 11, 2024)
> ql.Settings.instance().setEvaluationDate(evaldate)
> curve = ql.FlatForward(evaldate, ql.QuoteHandle(ql.SimpleQuote(0.01)),
> ql.Actual360())
> dates = [ql.Date(9, 12, 2024), ql.Date(16, 11, 2025)]
> spreads = [ql.QuoteHandle(ql.SimpleQuote(s/10000) )for s in [13, 22]]
> handle = ql.YieldTermStructureHandle(curve)
> spreadcurve = ql.SpreadedBackwardFlatZeroInterpolatedTermStructure(handle,
> spreads, dates)
> spreadcurve.enableExtrapolation()
> #fig, ax = utils.plot()
> fwd_dates = [evaldate + ql.Period(i, ql.Days) for i in range(100)]
> fwd_rates = [spreadcurve.forwardRate(fwd_dates[i - 1], fwd_dates[i],
> ql.Actual360(), ql.Simple).rate() for i in
> range(1, 100)]
> #utils.plot_curve(ax, fwd_dates[1:], [(fwd_rates, '-')], format_rates=True)
>
> Kind regards,
> Théodore
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Philippe H. <pha...@ma...> - 2024-12-02 15:12:47
|
Is there a way to fix one or more parameters when calibrating NS from the python API? Specifically, I would like to fix the exponential decay lambda parameter. After building instrument helpers, I use this call: ql.FittedBondDiscountCurve(*params, ql.NelsonSiegelFitting(),, accuracy, numIter, guess, simplex_lambda) I looked at the c++ code, and it seems that there is a array parameter that represents weights, but I didn't see anything related to freezing one parameter. Also, I was looking for a way to just build a NS curve by passing all parameters, and not perform any calibration, but I didn't see one. It's easy to implement, but wondering as the solution might be related to my first question? Best regards Philippe Hatstadt 203-252-0408 https://www.linkedin.com/in/philippe-hatstadt/ |
|
From: Ming Z. <mag...@ou...> - 2024-11-26 16:54:43
|
Dear all,
I am reaching out to seek guidance on a development workflow:
1. Make changes to QuantLib C++ with Visual Studio 2022.
2. Build QuantLib Python module.
3. Test changes in either Python script or Jupyter notebook with Visual
Studio Code. In particular, set breakpoints in Python and debug
underlying calculations in QuantLib C++ with Visual Studio 2022.
I have QuantLib C++ and Boost libraries installed, and can run QuantLib
with Visual Studio 2022. But I am not sure how to do the step 2 (using
QuantLib-SWIG) and step 3 (attach vscode to vs). Really appreciate any
detailed advice and instructions.
My development setup is Windows 11, boost 1.86, QuantLib C++ 1.35,
Conda, Visual Studio Community 2022 Version 17.12.1, and Visual Studio
Code 1.95.3.
Many thanks,
Ming
|
|
From: Théodore M. <the...@gm...> - 2024-11-22 12:26:31
|
Hi,
I am trying to build a short term curve and would like to add a flat
time-dependent spread on top. I am however observing an odd feature where
there is a significant jump at the date where the spread starts, and I am
wondering if I am doing something wrong or if there's a bug. Please see
example code below and observe the 1 day forward rate on 9dec2024
specifically
import matplotlib.pyplot as plt
import QuantLib as ql
evaldate = ql.Date(22, 11, 2024)
ql.Settings.instance().setEvaluationDate(evaldate)
curve = ql.FlatForward(evaldate, ql.QuoteHandle(ql.SimpleQuote(0.01)),
ql.Actual360())
dates = [ql.Date(9, 12, 2024), ql.Date(16, 11, 2025)]
spreads = [ql.QuoteHandle(ql.SimpleQuote(s/10000) )for s in [13, 22]]
handle = ql.YieldTermStructureHandle(curve)
spreadcurve = ql.SpreadedBackwardFlatZeroInterpolatedTermStructure(handle,
spreads, dates)
spreadcurve.enableExtrapolation()
#fig, ax = utils.plot()
fwd_dates = [evaldate + ql.Period(i, ql.Days) for i in range(100)]
fwd_rates = [spreadcurve.forwardRate(fwd_dates[i - 1], fwd_dates[i],
ql.Actual360(), ql.Simple).rate() for i in
range(1, 100)]
#utils.plot_curve(ax, fwd_dates[1:], [(fwd_rates, '-')], format_rates=True)
Kind regards,
Théodore
|
|
From: Wei Li <ttl...@gm...> - 2024-11-05 13:00:14
|
Hello Luigi, Thank you for your reply, I'll give it a try. Cheers, Wei On Tue, Nov 5, 2024, 18:35 Luigi Ballabio <lui...@gm...> wrote: > Hi, > there's no helper that does the whole work directly; but you could > calculate zero-coupon prices from the discount factors and then pass them > to the BondHelper class. > > Luigi > > On Tue, Nov 5, 2024 at 3:34 AM Wei Li <ttl...@gm...> wrote: > >> Hello Luigi, >> >> Thank you for your reply. I guess I didn't look through all the >> constructors so I missed the ones with settlementDays as input. I have >> another question though: is there any workaround to make the >> InterpolatedDiscountCurve reference-date-dependent (like I mentioned, we >> construct some curves by giving discount factors and the discounting dates >> that we calculated somewhere else)? I remember I have read from the >> maillist that this is not supported. But I also see that there are some >> constructors with settlementDays as input if the constructors of this >> class, although they are marked as protected and they do not take discount >> factors as input. If that is not possible, is there some rate helper class >> that can construct zero coupon bonds from the discount factors and use >> those instruments to construct the curve? >> >> Cheers, >> Wei >> >> On Mon, Nov 4, 2024 at 6:40 PM Luigi Ballabio <lui...@gm...> >> wrote: >> >>> Hello Wei Li, >>> PiecewiseYieldCurve can be moving or not, depending on how you build >>> it. If you're passing a reference date as the first argument to its >>> constructor, then the curve will stay fixed at that reference date. If >>> you're passing a number of days and a calendar instead, the curve will move >>> with the evaluation date. >>> >>> Luigi >>> >>> >>> On Fri, Nov 1, 2024 at 11:20 AM Wei Li <ttl...@gm...> wrote: >>> >>>> Dear all, >>>> >>>> When I am developing using ql, I learned that with *moving *term >>>> structures (whose moving_ property are set to true and are basically >>>> constructed without using specific dates), I can calculate the theta per >>>> day measurement by bumping the evaluation date to the next business day. >>>> >>>> However, I am not sure what are the examples of such moving term >>>> structures. So far our project uses exclusively *InterpolatedDiscountCurve >>>> *and *PiecewiseYieldCurve : *we construct the first class by giving >>>> the specific dates and discount factors (calculated somewhere else) on such >>>> dates, and construct the second class with market quotes of different types >>>> of instruments and do the bootstrapping on the fly. As far as I know, >>>> neither of these two is a moving term structure. As a result, I can't get >>>> the expected theta per day by just bumping the evaluation date. Our >>>> portfolio is mainly composed of FX and fixed income exotic options and the >>>> hedging instruments so the valuation relies heavily on the yield term >>>> structures. >>>> >>>> So I was wondering, if we want to get such theta per day measurement, >>>> what would be the proper classes that we should use? Thank you very much! >>>> >>>> Cheers, >>>> Wei >>>> >>>> >>>> _______________________________________________ >>>> QuantLib-users mailing list >>>> Qua...@li... >>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>> >>> |
|
From: Luigi B. <lui...@gm...> - 2024-11-05 10:35:13
|
Hi,
there's no helper that does the whole work directly; but you could
calculate zero-coupon prices from the discount factors and then pass them
to the BondHelper class.
Luigi
On Tue, Nov 5, 2024 at 3:34 AM Wei Li <ttl...@gm...> wrote:
> Hello Luigi,
>
> Thank you for your reply. I guess I didn't look through all the
> constructors so I missed the ones with settlementDays as input. I have
> another question though: is there any workaround to make the
> InterpolatedDiscountCurve reference-date-dependent (like I mentioned, we
> construct some curves by giving discount factors and the discounting dates
> that we calculated somewhere else)? I remember I have read from the
> maillist that this is not supported. But I also see that there are some
> constructors with settlementDays as input if the constructors of this
> class, although they are marked as protected and they do not take discount
> factors as input. If that is not possible, is there some rate helper class
> that can construct zero coupon bonds from the discount factors and use
> those instruments to construct the curve?
>
> Cheers,
> Wei
>
> On Mon, Nov 4, 2024 at 6:40 PM Luigi Ballabio <lui...@gm...>
> wrote:
>
>> Hello Wei Li,
>> PiecewiseYieldCurve can be moving or not, depending on how you build
>> it. If you're passing a reference date as the first argument to its
>> constructor, then the curve will stay fixed at that reference date. If
>> you're passing a number of days and a calendar instead, the curve will move
>> with the evaluation date.
>>
>> Luigi
>>
>>
>> On Fri, Nov 1, 2024 at 11:20 AM Wei Li <ttl...@gm...> wrote:
>>
>>> Dear all,
>>>
>>> When I am developing using ql, I learned that with *moving *term
>>> structures (whose moving_ property are set to true and are basically
>>> constructed without using specific dates), I can calculate the theta per
>>> day measurement by bumping the evaluation date to the next business day.
>>>
>>> However, I am not sure what are the examples of such moving term
>>> structures. So far our project uses exclusively *InterpolatedDiscountCurve
>>> *and *PiecewiseYieldCurve : *we construct the first class by giving the
>>> specific dates and discount factors (calculated somewhere else) on such
>>> dates, and construct the second class with market quotes of different types
>>> of instruments and do the bootstrapping on the fly. As far as I know,
>>> neither of these two is a moving term structure. As a result, I can't get
>>> the expected theta per day by just bumping the evaluation date. Our
>>> portfolio is mainly composed of FX and fixed income exotic options and the
>>> hedging instruments so the valuation relies heavily on the yield term
>>> structures.
>>>
>>> So I was wondering, if we want to get such theta per day measurement,
>>> what would be the proper classes that we should use? Thank you very much!
>>>
>>> Cheers,
>>> Wei
>>>
>>>
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> Qua...@li...
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>
|
|
From: Wei Li <ttl...@gm...> - 2024-11-05 02:35:04
|
Hello Luigi, Thank you for your reply. I guess I didn't look through all the constructors so I missed the ones with settlementDays as input. I have another question though: is there any workaround to make the InterpolatedDiscountCurve reference-date-dependent (like I mentioned, we construct some curves by giving discount factors and the discounting dates that we calculated somewhere else)? I remember I have read from the maillist that this is not supported. But I also see that there are some constructors with settlementDays as input if the constructors of this class, although they are marked as protected and they do not take discount factors as input. If that is not possible, is there some rate helper class that can construct zero coupon bonds from the discount factors and use those instruments to construct the curve? Cheers, Wei On Mon, Nov 4, 2024 at 6:40 PM Luigi Ballabio <lui...@gm...> wrote: > Hello Wei Li, > PiecewiseYieldCurve can be moving or not, depending on how you build > it. If you're passing a reference date as the first argument to its > constructor, then the curve will stay fixed at that reference date. If > you're passing a number of days and a calendar instead, the curve will move > with the evaluation date. > > Luigi > > > On Fri, Nov 1, 2024 at 11:20 AM Wei Li <ttl...@gm...> wrote: > >> Dear all, >> >> When I am developing using ql, I learned that with *moving *term >> structures (whose moving_ property are set to true and are basically >> constructed without using specific dates), I can calculate the theta per >> day measurement by bumping the evaluation date to the next business day. >> >> However, I am not sure what are the examples of such moving term >> structures. So far our project uses exclusively *InterpolatedDiscountCurve >> *and *PiecewiseYieldCurve : *we construct the first class by giving the >> specific dates and discount factors (calculated somewhere else) on such >> dates, and construct the second class with market quotes of different types >> of instruments and do the bootstrapping on the fly. As far as I know, >> neither of these two is a moving term structure. As a result, I can't get >> the expected theta per day by just bumping the evaluation date. Our >> portfolio is mainly composed of FX and fixed income exotic options and the >> hedging instruments so the valuation relies heavily on the yield term >> structures. >> >> So I was wondering, if we want to get such theta per day measurement, >> what would be the proper classes that we should use? Thank you very much! >> >> Cheers, >> Wei >> >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: Luigi B. <lui...@gm...> - 2024-11-04 17:15:16
|
No problem, glad it worked!
On Mon, Nov 4, 2024 at 6:11 PM Matthew Hancock <mat...@gm...>
wrote:
> Hi Luigi,
>
> I installed a new version of python compiled for arm and also installed
> via the wheel as suggested and now QuantLib is importing correctly. Thanks
> for your help!!
>
> Best
> Matthew
>
> On Nov 4, 2024, at 9:14 AM, Luigi Ballabio <lui...@gm...>
> wrote:
>
> Hi, there might be a couple of things you can try.
>
> The first is checking if the problem is the mismatch between x86 and arm:
> is the Python coming with Anaconda compiled for x86? If so, and if you
> can't upgrade to a version for arm, you can try cross-compiling QuantLib
> for x86 so it matches the architecture. Running
>
> ./configure --with-boost-include=/opt/homebrew/include/ \
> --prefix=${HOME}/Documents/QuantLib-1.36_build
> --disable-shared \
> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9 -arch
> x86_64' \
> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9 -arch x86_64’
>
> should do that.
>
> The second thing is to try to build a wheel instead, and install that. As
> of 1.36, the commands would be
>
> cd QuantLib-SWIG-1.36
> ./configure \
> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9’ \
> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’ \
> PYTHON=/Users/matthew/opt/anaconda3/envs/py39/bin/python3
> make -C Python
>
> To make it work, you might have to `pip install build` in your
> environment, or whatever conda requires to install modules.
> When the make step completes, you should have a QuantLib wheel
> in QuantLib-SWIG-1.36/Python/dist that you can try installing with pip or
> conda instead of running "python setup.py install" (that I don't trust a
> lot).
>
> Let me know how it goes.
>
> Luigi
>
>
>
> On Mon, Nov 4, 2024 at 3:06 PM Matthew Hancock <mat...@gm...>
> wrote:
>
>> Hi Luigi,
>>
>> Thanks for your response. I am attempting to build QuantLib myself to
>> turn on higher-resolution dates for intraday analysis.
>>
>> Here are the commands I am using to build QuantLib:
>>
>> (base) matthew@Matthews-MacBook-Pro-5 Documents % tar xzvf
>> QuantLib-1.36.tar.gz
>>
>> (base) matthew@Matthews-MacBook-Pro-5 Documents % cd QuantLib-1.36
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % ./configure
>> --with-boost-include=/opt/homebrew/include/ \
>> --prefix=${HOME}/Documents/QuantLib-1.36_build
>> --disable-shared \
>> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \
>> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % make -j8
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % make install
>>
>> I can compile and run the C++ examples successfully.
>>
>> I then try and build QuantLib-SWIG-1.36:
>>
>> (base) matthew@Matthews-MacBook-Pro-5 Documents % tar xzf
>> QuantLib-SWIG-1.36.tar.gz
>>
>> (base) matthew@Matthews-MacBook-Pro-5 Documents % cd
>> QuantLib-SWIG-1.36/Python
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-SWIG-1.36 % export
>> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9’
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-SWIG-1.36 % export
>> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’
>>
>> Here I am using a conda python39 environment to build/install:
>>
>> (py39) matthew@Matthews-MacBook-Pro-5 Python %
>> /Users/matthew/opt/anaconda3/envs/py39/bin/python3 setup.py build
>>
>> This generates some warnings related to compatibility between arm and x86
>> (I’m building on M1):
>>
>> running build
>> running build_py
>> creating build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
>> copying src/QuantLib/__init__.py ->
>> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
>> copying src/QuantLib/QuantLib.py ->
>> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
>> running build_ext
>> building 'QuantLib._QuantLib' extension
>> creating build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib
>> clang++ -O2 -stdlib=libc++ -mmacosx-version-min=10.9
>> -DPy_LIMITED_API=0x03080000 -DNDEBUG
>> -I/Users/matthew/Documents/QuantLib-1.36_build/include
>> -I/Users/matthew/opt/anaconda3/envs/py39/include/python3.9 -c
>> src/QuantLib/quantlib_wrap.cpp -o
>> build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib/quantlib_wrap.o
>> -std=c++17 -Wno-unused -O2 -stdlib=libc++ -mmacosx-version-min=10.9
>> clang++ -O2 -stdlib=libc++ -mmacosx-version-min=10.9 -bundle -undefined
>> dynamic_lookup -stdlib=libc++ -mmacosx-version-min=10.9 -O2 -stdlib=libc++
>> -mmacosx-version-min=10.9
>> build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib/quantlib_wrap.o
>> -L/Users/matthew/Documents/QuantLib-1.36_build/lib -lQuantLib -o
>> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib/_QuantLib.abi3.so
>> <http://quantlib.abi3.so/> -stdlib=libc++ -mmacosx-version-min=10.9
>> ld: warning: ignoring file
>> /Users/matthew/Documents/QuantLib-1.36_build/lib/libQuantLib.a, building
>> for macOS-x86_64 but attempting to link with file built for macOS-arm64
>>
>> (py39) matthew@Matthews-MacBook-Pro-5 Python %
>> /Users/matthew/opt/anaconda3/envs/py39/bin/python3 setup.py install
>>
>> This appears to run successfully (though the package name contains x86):
>>
>> Installed
>> /Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg
>> Processing dependencies for QuantLib==1.36
>> Finished processing dependencies for QuantLib==1.36
>>
>> Then trying to import QuantLib raises an error:
>>
>> (py39) matthew@Matthews-MacBook-Pro-5 Python % python
>> Python 3.9.20 (main, Oct 3 2024, 02:27:54)
>> [Clang 14.0.6 ] :: Anaconda, Inc. on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import QuantLib as ql
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File
>> "/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/__init__.py",
>> line 19, in <module>
>> from .QuantLib import *
>> File
>> "/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/QuantLib.py",
>> line 10, in <module>
>> from . import _QuantLib
>> ImportError:
>> dlopen(/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/_
>> QuantLib.abi3.so <http://quantlib.abi3.so/>, 0x0002): symbol not found
>> in flat namespace ‘__ZN8QuantLib12SmileSection6updateEv'
>>
>> Thanks for your help!
>>
>> Best
>> Matthew
>>
>>
>> On Nov 4, 2024, at 4:38 AM, Luigi Ballabio <lui...@gm...>
>> wrote:
>>
>> Hi Matthew,
>> I assume you've changed something in the library so you can't just
>> use `pip install QuantLib`, correct?
>> May you post the exact commands you're using to build the library and
>> Python module? Thanks!
>>
>> Luigi
>>
>>
>> On Sun, Nov 3, 2024 at 2:30 AM Matthew Hancock <
>> mat...@gm...> wrote:
>>
>>> Hi QuantLib team,
>>>
>>> I am running into an issue building QuantLib-SWIG-1.36 on a Mac M1
>>> running Mac OS 10.14. I am using an Anaconda version of Python 3.8.
>>>
>>> I can build QuantLib-1.36 with no issue (I added the --disabled-shared
>>> flag).
>>>
>>> However, when I build QuantLib-SWIG-1.36 and try to import the Python
>>> library, I get an import error:
>>>
>>> >>> import QuantLib
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in <module>
>>> File
>>> "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/__init__.py",
>>> line 19, in <module>
>>> from .QuantLib import *
>>> File
>>> "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/QuantLib.py",
>>> line 10, in <module>
>>> from . import _QuantLib
>>> ImportError:
>>> dlopen(/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/_
>>> QuantLib.abi3.so <http://quantlib.abi3.so/>, 0x0002): symbol not found
>>> in flat namespace '__ZN8QuantLib12SmileSection6updateEv'
>>>
>>> Any help would be much appreciated, thanks!
>>>
>>> Best
>>> Matthew
>>>
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> Qua...@li...
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>
>>
>
|
|
From: Matthew H. <mat...@gm...> - 2024-11-04 17:11:22
|
Hi Luigi,
I installed a new version of python compiled for arm and also installed via the wheel as suggested and now QuantLib is importing correctly. Thanks for your help!!
Best
Matthew
> On Nov 4, 2024, at 9:14 AM, Luigi Ballabio <lui...@gm...> wrote:
>
> Hi, there might be a couple of things you can try.
>
> The first is checking if the problem is the mismatch between x86 and arm: is the Python coming with Anaconda compiled for x86? If so, and if you can't upgrade to a version for arm, you can try cross-compiling QuantLib for x86 so it matches the architecture. Running
>
> ./configure --with-boost-include=/opt/homebrew/include/ \
> --prefix=${HOME}/Documents/QuantLib-1.36_build --disable-shared \
> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9 -arch x86_64' \
> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9 -arch x86_64’
>
> should do that.
>
> The second thing is to try to build a wheel instead, and install that. As of 1.36, the commands would be
>
> cd QuantLib-SWIG-1.36
> ./configure \
> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9’ \
> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’ \
> PYTHON=/Users/matthew/opt/anaconda3/envs/py39/bin/python3
> make -C Python
>
> To make it work, you might have to `pip install build` in your environment, or whatever conda requires to install modules.
> When the make step completes, you should have a QuantLib wheel in QuantLib-SWIG-1.36/Python/dist that you can try installing with pip or conda instead of running "python setup.py install" (that I don't trust a lot).
>
> Let me know how it goes.
>
> Luigi
>
>
>
> On Mon, Nov 4, 2024 at 3:06 PM Matthew Hancock <mat...@gm... <mailto:mat...@gm...>> wrote:
>> Hi Luigi,
>>
>> Thanks for your response. I am attempting to build QuantLib myself to turn on higher-resolution dates for intraday analysis.
>>
>> Here are the commands I am using to build QuantLib:
>>
>> (base) matthew@Matthews-MacBook-Pro-5 Documents % tar xzvf QuantLib-1.36.tar.gz
>>
>> (base) matthew@Matthews-MacBook-Pro-5 Documents % cd QuantLib-1.36
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % ./configure --with-boost-include=/opt/homebrew/include/ \
>> --prefix=${HOME}/Documents/QuantLib-1.36_build --disable-shared \
>> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \
>> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % make -j8
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % make install
>>
>> I can compile and run the C++ examples successfully.
>>
>> I then try and build QuantLib-SWIG-1.36:
>>
>> (base) matthew@Matthews-MacBook-Pro-5 Documents % tar xzf QuantLib-SWIG-1.36.tar.gz
>>
>> (base) matthew@Matthews-MacBook-Pro-5 Documents % cd QuantLib-SWIG-1.36/Python
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-SWIG-1.36 % export CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9’
>>
>> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-SWIG-1.36 % export LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’
>>
>> Here I am using a conda python39 environment to build/install:
>>
>> (py39) matthew@Matthews-MacBook-Pro-5 Python % /Users/matthew/opt/anaconda3/envs/py39/bin/python3 setup.py build
>>
>> This generates some warnings related to compatibility between arm and x86 (I’m building on M1):
>>
>> running build
>> running build_py
>> creating build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
>> copying src/QuantLib/__init__.py -> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
>> copying src/QuantLib/QuantLib.py -> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
>> running build_ext
>> building 'QuantLib._QuantLib' extension
>> creating build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib
>> clang++ -O2 -stdlib=libc++ -mmacosx-version-min=10.9 -DPy_LIMITED_API=0x03080000 -DNDEBUG -I/Users/matthew/Documents/QuantLib-1.36_build/include -I/Users/matthew/opt/anaconda3/envs/py39/include/python3.9 -c src/QuantLib/quantlib_wrap.cpp -o build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib/quantlib_wrap.o -std=c++17 -Wno-unused -O2 -stdlib=libc++ -mmacosx-version-min=10.9
>> clang++ -O2 -stdlib=libc++ -mmacosx-version-min=10.9 -bundle -undefined dynamic_lookup -stdlib=libc++ -mmacosx-version-min=10.9 -O2 -stdlib=libc++ -mmacosx-version-min=10.9 build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib/quantlib_wrap.o -L/Users/matthew/Documents/QuantLib-1.36_build/lib -lQuantLib -o build/lib.macosx-10.15-x86_64-cpython-39/QuantLib/_QuantLib.abi3.so <http://quantlib.abi3.so/> -stdlib=libc++ -mmacosx-version-min=10.9
>> ld: warning: ignoring file /Users/matthew/Documents/QuantLib-1.36_build/lib/libQuantLib.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
>>
>> (py39) matthew@Matthews-MacBook-Pro-5 Python % /Users/matthew/opt/anaconda3/envs/py39/bin/python3 setup.py install
>>
>> This appears to run successfully (though the package name contains x86):
>>
>> Installed /Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg
>> Processing dependencies for QuantLib==1.36
>> Finished processing dependencies for QuantLib==1.36
>>
>> Then trying to import QuantLib raises an error:
>>
>> (py39) matthew@Matthews-MacBook-Pro-5 Python % python
>> Python 3.9.20 (main, Oct 3 2024, 02:27:54)
>> [Clang 14.0.6 ] :: Anaconda, Inc. on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import QuantLib as ql
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File "/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/__init__.py", line 19, in <module>
>> from .QuantLib import *
>> File "/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/QuantLib.py", line 10, in <module>
>> from . import _QuantLib
>> ImportError: dlopen(/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/_QuantLib.abi3.so <http://quantlib.abi3.so/>, 0x0002): symbol not found in flat namespace ‘__ZN8QuantLib12SmileSection6updateEv'
>>
>> Thanks for your help!
>>
>> Best
>> Matthew
>>
>>
>>> On Nov 4, 2024, at 4:38 AM, Luigi Ballabio <lui...@gm... <mailto:lui...@gm...>> wrote:
>>>
>>> Hi Matthew,
>>> I assume you've changed something in the library so you can't just use `pip install QuantLib`, correct?
>>> May you post the exact commands you're using to build the library and Python module? Thanks!
>>>
>>> Luigi
>>>
>>>
>>> On Sun, Nov 3, 2024 at 2:30 AM Matthew Hancock <mat...@gm... <mailto:mat...@gm...>> wrote:
>>>> Hi QuantLib team,
>>>>
>>>> I am running into an issue building QuantLib-SWIG-1.36 on a Mac M1 running Mac OS 10.14. I am using an Anaconda version of Python 3.8.
>>>>
>>>> I can build QuantLib-1.36 with no issue (I added the --disabled-shared flag).
>>>>
>>>> However, when I build QuantLib-SWIG-1.36 and try to import the Python library, I get an import error:
>>>>
>>>> >>> import QuantLib
>>>> Traceback (most recent call last):
>>>> File "<stdin>", line 1, in <module>
>>>> File "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/__init__.py", line 19, in <module>
>>>> from .QuantLib import *
>>>> File "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/QuantLib.py", line 10, in <module>
>>>> from . import _QuantLib
>>>> ImportError: dlopen(/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/_QuantLib.abi3.so <http://quantlib.abi3.so/>, 0x0002): symbol not found in flat namespace '__ZN8QuantLib12SmileSection6updateEv'
>>>>
>>>> Any help would be much appreciated, thanks!
>>>>
>>>> Best
>>>> Matthew
>>>>
>>>> _______________________________________________
>>>> QuantLib-users mailing list
>>>> Qua...@li... <mailto:Qua...@li...>
>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
|
|
From: Luigi B. <lui...@gm...> - 2024-11-04 15:14:40
|
Hi, there might be a couple of things you can try.
The first is checking if the problem is the mismatch between x86 and arm:
is the Python coming with Anaconda compiled for x86? If so, and if you
can't upgrade to a version for arm, you can try cross-compiling QuantLib
for x86 so it matches the architecture. Running
./configure --with-boost-include=/opt/homebrew/include/ \
--prefix=${HOME}/Documents/QuantLib-1.36_build --disable-shared
\
CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9 -arch
x86_64' \
LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9 -arch x86_64’
should do that.
The second thing is to try to build a wheel instead, and install that. As
of 1.36, the commands would be
cd QuantLib-SWIG-1.36
./configure \
CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9’ \
LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’ \
PYTHON=/Users/matthew/opt/anaconda3/envs/py39/bin/python3
make -C Python
To make it work, you might have to `pip install build` in your environment,
or whatever conda requires to install modules.
When the make step completes, you should have a QuantLib wheel
in QuantLib-SWIG-1.36/Python/dist that you can try installing with pip or
conda instead of running "python setup.py install" (that I don't trust a
lot).
Let me know how it goes.
Luigi
On Mon, Nov 4, 2024 at 3:06 PM Matthew Hancock <mat...@gm...>
wrote:
> Hi Luigi,
>
> Thanks for your response. I am attempting to build QuantLib myself to turn
> on higher-resolution dates for intraday analysis.
>
> Here are the commands I am using to build QuantLib:
>
> (base) matthew@Matthews-MacBook-Pro-5 Documents % tar xzvf
> QuantLib-1.36.tar.gz
>
> (base) matthew@Matthews-MacBook-Pro-5 Documents % cd QuantLib-1.36
>
> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % ./configure
> --with-boost-include=/opt/homebrew/include/ \
> --prefix=${HOME}/Documents/QuantLib-1.36_build
> --disable-shared \
> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \
> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’
>
> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % make -j8
>
> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % make install
>
> I can compile and run the C++ examples successfully.
>
> I then try and build QuantLib-SWIG-1.36:
>
> (base) matthew@Matthews-MacBook-Pro-5 Documents % tar xzf
> QuantLib-SWIG-1.36.tar.gz
>
> (base) matthew@Matthews-MacBook-Pro-5 Documents % cd
> QuantLib-SWIG-1.36/Python
>
> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-SWIG-1.36 % export
> CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9’
>
> (base) matthew@Matthews-MacBook-Pro-5 QuantLib-SWIG-1.36 % export
> LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’
>
> Here I am using a conda python39 environment to build/install:
>
> (py39) matthew@Matthews-MacBook-Pro-5 Python %
> /Users/matthew/opt/anaconda3/envs/py39/bin/python3 setup.py build
>
> This generates some warnings related to compatibility between arm and x86
> (I’m building on M1):
>
> running build
> running build_py
> creating build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
> copying src/QuantLib/__init__.py ->
> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
> copying src/QuantLib/QuantLib.py ->
> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
> running build_ext
> building 'QuantLib._QuantLib' extension
> creating build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib
> clang++ -O2 -stdlib=libc++ -mmacosx-version-min=10.9
> -DPy_LIMITED_API=0x03080000 -DNDEBUG
> -I/Users/matthew/Documents/QuantLib-1.36_build/include
> -I/Users/matthew/opt/anaconda3/envs/py39/include/python3.9 -c
> src/QuantLib/quantlib_wrap.cpp -o
> build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib/quantlib_wrap.o
> -std=c++17 -Wno-unused -O2 -stdlib=libc++ -mmacosx-version-min=10.9
> clang++ -O2 -stdlib=libc++ -mmacosx-version-min=10.9 -bundle -undefined
> dynamic_lookup -stdlib=libc++ -mmacosx-version-min=10.9 -O2 -stdlib=libc++
> -mmacosx-version-min=10.9
> build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib/quantlib_wrap.o
> -L/Users/matthew/Documents/QuantLib-1.36_build/lib -lQuantLib -o
> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib/_QuantLib.abi3.so
> -stdlib=libc++ -mmacosx-version-min=10.9
> ld: warning: ignoring file
> /Users/matthew/Documents/QuantLib-1.36_build/lib/libQuantLib.a, building
> for macOS-x86_64 but attempting to link with file built for macOS-arm64
>
> (py39) matthew@Matthews-MacBook-Pro-5 Python %
> /Users/matthew/opt/anaconda3/envs/py39/bin/python3 setup.py install
>
> This appears to run successfully (though the package name contains x86):
>
> Installed
> /Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg
> Processing dependencies for QuantLib==1.36
> Finished processing dependencies for QuantLib==1.36
>
> Then trying to import QuantLib raises an error:
>
> (py39) matthew@Matthews-MacBook-Pro-5 Python % python
> Python 3.9.20 (main, Oct 3 2024, 02:27:54)
> [Clang 14.0.6 ] :: Anaconda, Inc. on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import QuantLib as ql
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/__init__.py",
> line 19, in <module>
> from .QuantLib import *
> File
> "/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/QuantLib.py",
> line 10, in <module>
> from . import _QuantLib
> ImportError:
> dlopen(/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/_
> QuantLib.abi3.so, 0x0002): symbol not found in flat namespace
> ‘__ZN8QuantLib12SmileSection6updateEv'
>
> Thanks for your help!
>
> Best
> Matthew
>
>
> On Nov 4, 2024, at 4:38 AM, Luigi Ballabio <lui...@gm...>
> wrote:
>
> Hi Matthew,
> I assume you've changed something in the library so you can't just use
> `pip install QuantLib`, correct?
> May you post the exact commands you're using to build the library and
> Python module? Thanks!
>
> Luigi
>
>
> On Sun, Nov 3, 2024 at 2:30 AM Matthew Hancock <mat...@gm...>
> wrote:
>
>> Hi QuantLib team,
>>
>> I am running into an issue building QuantLib-SWIG-1.36 on a Mac M1
>> running Mac OS 10.14. I am using an Anaconda version of Python 3.8.
>>
>> I can build QuantLib-1.36 with no issue (I added the --disabled-shared
>> flag).
>>
>> However, when I build QuantLib-SWIG-1.36 and try to import the Python
>> library, I get an import error:
>>
>> >>> import QuantLib
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File
>> "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/__init__.py",
>> line 19, in <module>
>> from .QuantLib import *
>> File
>> "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/QuantLib.py",
>> line 10, in <module>
>> from . import _QuantLib
>> ImportError:
>> dlopen(/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/_
>> QuantLib.abi3.so <http://quantlib.abi3.so/>, 0x0002): symbol not found
>> in flat namespace '__ZN8QuantLib12SmileSection6updateEv'
>>
>> Any help would be much appreciated, thanks!
>>
>> Best
>> Matthew
>>
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
>
|
|
From: Matthew H. <mat...@gm...> - 2024-11-04 14:06:36
|
Hi Luigi,
Thanks for your response. I am attempting to build QuantLib myself to turn on higher-resolution dates for intraday analysis.
Here are the commands I am using to build QuantLib:
(base) matthew@Matthews-MacBook-Pro-5 Documents % tar xzvf QuantLib-1.36.tar.gz
(base) matthew@Matthews-MacBook-Pro-5 Documents % cd QuantLib-1.36
(base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % ./configure --with-boost-include=/opt/homebrew/include/ \
--prefix=${HOME}/Documents/QuantLib-1.36_build --disable-shared \
CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9' \
LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’
(base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % make -j8
(base) matthew@Matthews-MacBook-Pro-5 QuantLib-1.36 % make install
I can compile and run the C++ examples successfully.
I then try and build QuantLib-SWIG-1.36:
(base) matthew@Matthews-MacBook-Pro-5 Documents % tar xzf QuantLib-SWIG-1.36.tar.gz
(base) matthew@Matthews-MacBook-Pro-5 Documents % cd QuantLib-SWIG-1.36/Python
(base) matthew@Matthews-MacBook-Pro-5 QuantLib-SWIG-1.36 % export CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.9’
(base) matthew@Matthews-MacBook-Pro-5 QuantLib-SWIG-1.36 % export LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.9’
Here I am using a conda python39 environment to build/install:
(py39) matthew@Matthews-MacBook-Pro-5 Python % /Users/matthew/opt/anaconda3/envs/py39/bin/python3 setup.py build
This generates some warnings related to compatibility between arm and x86 (I’m building on M1):
running build
running build_py
creating build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
copying src/QuantLib/__init__.py -> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
copying src/QuantLib/QuantLib.py -> build/lib.macosx-10.15-x86_64-cpython-39/QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
creating build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib
clang++ -O2 -stdlib=libc++ -mmacosx-version-min=10.9 -DPy_LIMITED_API=0x03080000 -DNDEBUG -I/Users/matthew/Documents/QuantLib-1.36_build/include -I/Users/matthew/opt/anaconda3/envs/py39/include/python3.9 -c src/QuantLib/quantlib_wrap.cpp -o build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib/quantlib_wrap.o -std=c++17 -Wno-unused -O2 -stdlib=libc++ -mmacosx-version-min=10.9
clang++ -O2 -stdlib=libc++ -mmacosx-version-min=10.9 -bundle -undefined dynamic_lookup -stdlib=libc++ -mmacosx-version-min=10.9 -O2 -stdlib=libc++ -mmacosx-version-min=10.9 build/temp.macosx-10.15-x86_64-cpython-39/src/QuantLib/quantlib_wrap.o -L/Users/matthew/Documents/QuantLib-1.36_build/lib -lQuantLib -o build/lib.macosx-10.15-x86_64-cpython-39/QuantLib/_QuantLib.abi3.so -stdlib=libc++ -mmacosx-version-min=10.9
ld: warning: ignoring file /Users/matthew/Documents/QuantLib-1.36_build/lib/libQuantLib.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
(py39) matthew@Matthews-MacBook-Pro-5 Python % /Users/matthew/opt/anaconda3/envs/py39/bin/python3 setup.py install
This appears to run successfully (though the package name contains x86):
Installed /Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg
Processing dependencies for QuantLib==1.36
Finished processing dependencies for QuantLib==1.36
Then trying to import QuantLib raises an error:
(py39) matthew@Matthews-MacBook-Pro-5 Python % python
Python 3.9.20 (main, Oct 3 2024, 02:27:54)
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import QuantLib as ql
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/__init__.py", line 19, in <module>
from .QuantLib import *
File "/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/QuantLib.py", line 10, in <module>
from . import _QuantLib
ImportError: dlopen(/Users/matthew/opt/anaconda3/envs/py39/lib/python3.9/site-packages/QuantLib-1.36-py3.9-macosx-10.15-x86_64.egg/QuantLib/_QuantLib.abi3.so, 0x0002): symbol not found in flat namespace ‘__ZN8QuantLib12SmileSection6updateEv'
Thanks for your help!
Best
Matthew
> On Nov 4, 2024, at 4:38 AM, Luigi Ballabio <lui...@gm...> wrote:
>
> Hi Matthew,
> I assume you've changed something in the library so you can't just use `pip install QuantLib`, correct?
> May you post the exact commands you're using to build the library and Python module? Thanks!
>
> Luigi
>
>
> On Sun, Nov 3, 2024 at 2:30 AM Matthew Hancock <mat...@gm... <mailto:mat...@gm...>> wrote:
>> Hi QuantLib team,
>>
>> I am running into an issue building QuantLib-SWIG-1.36 on a Mac M1 running Mac OS 10.14. I am using an Anaconda version of Python 3.8.
>>
>> I can build QuantLib-1.36 with no issue (I added the --disabled-shared flag).
>>
>> However, when I build QuantLib-SWIG-1.36 and try to import the Python library, I get an import error:
>>
>> >>> import QuantLib
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/__init__.py", line 19, in <module>
>> from .QuantLib import *
>> File "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/QuantLib.py", line 10, in <module>
>> from . import _QuantLib
>> ImportError: dlopen(/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/_QuantLib.abi3.so <http://quantlib.abi3.so/>, 0x0002): symbol not found in flat namespace '__ZN8QuantLib12SmileSection6updateEv'
>>
>> Any help would be much appreciated, thanks!
>>
>> Best
>> Matthew
>>
>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li... <mailto:Qua...@li...>
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
|
|
From: Luigi B. <lui...@gm...> - 2024-11-04 10:40:42
|
Hello Wei Li,
PiecewiseYieldCurve can be moving or not, depending on how you build
it. If you're passing a reference date as the first argument to its
constructor, then the curve will stay fixed at that reference date. If
you're passing a number of days and a calendar instead, the curve will move
with the evaluation date.
Luigi
On Fri, Nov 1, 2024 at 11:20 AM Wei Li <ttl...@gm...> wrote:
> Dear all,
>
> When I am developing using ql, I learned that with *moving *term
> structures (whose moving_ property are set to true and are basically
> constructed without using specific dates), I can calculate the theta per
> day measurement by bumping the evaluation date to the next business day.
>
> However, I am not sure what are the examples of such moving term
> structures. So far our project uses exclusively *InterpolatedDiscountCurve
> *and *PiecewiseYieldCurve : *we construct the first class by giving the
> specific dates and discount factors (calculated somewhere else) on such
> dates, and construct the second class with market quotes of different types
> of instruments and do the bootstrapping on the fly. As far as I know,
> neither of these two is a moving term structure. As a result, I can't get
> the expected theta per day by just bumping the evaluation date. Our
> portfolio is mainly composed of FX and fixed income exotic options and the
> hedging instruments so the valuation relies heavily on the yield term
> structures.
>
> So I was wondering, if we want to get such theta per day measurement, what
> would be the proper classes that we should use? Thank you very much!
>
> Cheers,
> Wei
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Luigi B. <lui...@gm...> - 2024-11-04 10:38:26
|
Hi Matthew,
I assume you've changed something in the library so you can't just use
`pip install QuantLib`, correct?
May you post the exact commands you're using to build the library and
Python module? Thanks!
Luigi
On Sun, Nov 3, 2024 at 2:30 AM Matthew Hancock <mat...@gm...>
wrote:
> Hi QuantLib team,
>
> I am running into an issue building QuantLib-SWIG-1.36 on a Mac M1 running
> Mac OS 10.14. I am using an Anaconda version of Python 3.8.
>
> I can build QuantLib-1.36 with no issue (I added the --disabled-shared
> flag).
>
> However, when I build QuantLib-SWIG-1.36 and try to import the Python
> library, I get an import error:
>
> >>> import QuantLib
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/__init__.py",
> line 19, in <module>
> from .QuantLib import *
> File
> "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/QuantLib.py",
> line 10, in <module>
> from . import _QuantLib
> ImportError:
> dlopen(/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/_
> QuantLib.abi3.so, 0x0002): symbol not found in flat namespace
> '__ZN8QuantLib12SmileSection6updateEv'
>
> Any help would be much appreciated, thanks!
>
> Best
> Matthew
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Matthew H. <mat...@gm...> - 2024-11-03 01:27:42
|
Hi QuantLib team,
I am running into an issue building QuantLib-SWIG-1.36 on a Mac M1 running Mac OS 10.14. I am using an Anaconda version of Python 3.8.
I can build QuantLib-1.36 with no issue (I added the --disabled-shared flag).
However, when I build QuantLib-SWIG-1.36 and try to import the Python library, I get an import error:
>>> import QuantLib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/__init__.py", line 19, in <module>
from .QuantLib import *
File "/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/QuantLib.py", line 10, in <module>
from . import _QuantLib
ImportError: dlopen(/Users/matthew/opt/anaconda3/lib/python3.8/site-packages/QuantLib-1.36-py3.8-macosx-10.9-x86_64.egg/QuantLib/_QuantLib.abi3.so, 0x0002): symbol not found in flat namespace '__ZN8QuantLib12SmileSection6updateEv'
Any help would be much appreciated, thanks!
Best
Matthew
|
|
From: Wei Li <ttl...@gm...> - 2024-11-01 10:16:50
|
Dear all, When I am developing using ql, I learned that with *moving *term structures (whose moving_ property are set to true and are basically constructed without using specific dates), I can calculate the theta per day measurement by bumping the evaluation date to the next business day. However, I am not sure what are the examples of such moving term structures. So far our project uses exclusively *InterpolatedDiscountCurve *and *PiecewiseYieldCurve : *we construct the first class by giving the specific dates and discount factors (calculated somewhere else) on such dates, and construct the second class with market quotes of different types of instruments and do the bootstrapping on the fly. As far as I know, neither of these two is a moving term structure. As a result, I can't get the expected theta per day by just bumping the evaluation date. Our portfolio is mainly composed of FX and fixed income exotic options and the hedging instruments so the valuation relies heavily on the yield term structures. So I was wondering, if we want to get such theta per day measurement, what would be the proper classes that we should use? Thank you very much! Cheers, Wei |
|
From: philippe h. <pha...@ma...> - 2024-10-16 18:57:23
|
Very convincing argument!! Regards Philippe Hatstadt +1-203-252-0408 > On Oct 16, 2024, at 7:20 AM, Tom Anderson <tw...@ur...> wrote: > > On Tue, 15 Oct 2024, philippe hatstadt wrote: > >> I suppose I could bootstrap a linear or stepwise convexity adjustment of futures and calibrate it so that I reprice OIS swaps for which there are market quotes? > > Indeed. > >> Or I might as well just build my curve with the latter and price forwards from it. > > Indeed! > > You may feel there are advantages to going the indirect route and using futures plus a calibrated convexity adjustment. For example, there is solid market data for futures at three-month intervals out for the first few years. How confident are you that OIS quotes at corresponding points represent real, tradeable prices, rather than figments of dealers' imaginations? In calibrating the convexity, you could stick to more reliable benchmark points for the OIS side, while the final curve gains greater granularity from the futures. You may or may not find this argument convincing! > > tom > >> Regards >> >> Philippe Hatstadt >> +1-203-252-0408 >> >> >>>> On Oct 15, 2024, at 9:36 AM, Tom Anderson <tw...@ur...> wrote: >>> >>> On Mon, 14 Oct 2024, philippe hatstadt via QuantLib-users wrote: >>> >>>> Does QuantLib have the ability to build a SOFR curve by bootstrapping SOfR futures in the front. and swaps in the back? >>> >>> Yes. Just use the appropriate combination of rate helpers: >>> >>> https://www.quantlib.org/reference/class_quant_lib_1_1_overnight_index_future_rate_helper.html >>> >>> https://www.quantlib.org/reference/class_quant_lib_1_1_o_i_s_rate_helper.html >>> >>>> What about convexity adjustment for futures versus forwards? >>> >>> There is a convexityAdjustment parameter to the OvernightIndexFutureRateHelper constructor. >>> >>>> Is there a closed form aproximate on available? >>> >>> HullWhite::convexityBias can give you a convexity adjustment given a volatility and some other parameters, if that's what you're after: >>> >>> https://rkapl123.github.io/QLAnnotatedSource/db/df5/class_quant_lib_1_1_hull_white.html#a61adab892d30472df50fa149f29478e7 >>> >>> Although i'm not sure it's the correct calculation for accruing futures like SOFR - this dates from the LIBOR era. >>> >>> Also, in my experience, this sort of thing doesn't work. Market prices for futures plus market quotes for volatility do not result in forwards compatible with market prices for swaps. There are other forces at work which push swaps and futures prices around independently. >>> >>>> Lastly what about options on SOFR futures? >>> >>> QuantLib has extensive support for various sorts of work with options but i've never used any of it. >>> >>> tom >>> >>> -- >>> Interesting, but possibly aimed at madmen. -- Charlie Brooker, on >>> Torchwood >> > > -- > The book reminds me of reading unformatted code, something from a > decompiler. -- dade_, on 'Infinite Jest' |