Skip to content

Commit

Permalink
Merge branch 'master' into tidy-18
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Aug 19, 2024
2 parents ff8fa36 + 174d36e commit 8113ea8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
7 changes: 2 additions & 5 deletions ql/experimental/math/hybridsimulatedannealing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,15 @@ namespace QuantLib {
ResetScheme resetScheme = ResetToBestPoint,
Size resetSteps = 150,
ext::shared_ptr<OptimizationMethod> localOptimizer =
ext::shared_ptr<OptimizationMethod>(),
ext::make_shared<LevenbergMarquardt>(),
LocalOptimizeScheme optimizeScheme = EveryBestPoint)
: sampler_(sampler), probability_(probability), temperature_(std::move(temperature)),
reannealing_(reannealing), startTemperature_(startTemperature),
endTemperature_(endTemperature),
reAnnealSteps_(reAnnealSteps == 0 ? QL_MAX_INTEGER : reAnnealSteps),
resetScheme_(resetScheme), resetSteps_(resetSteps == 0 ? QL_MAX_INTEGER : resetSteps),
localOptimizer_(localOptimizer),
optimizeScheme_(localOptimizer != nullptr ? optimizeScheme : NoLocalOptimize) {
if (!localOptimizer)
localOptimizer = ext::make_shared<LevenbergMarquardt>();
}
optimizeScheme_(localOptimizer != nullptr ? optimizeScheme : NoLocalOptimize) {}

EndCriteria::Type minimize(Problem& P, const EndCriteria& endCriteria) override;

Expand Down
25 changes: 13 additions & 12 deletions ql/termstructures/yield/nonlinearfittingmethods.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace QuantLib {
//! Exponential-splines fitting method
/*! Fits a discount function to the exponential form
\f[
d(t) = \sum_{i=1}^9 c_i \exp^{-kappa i t}
d(t) = \sum_{i=1}^9 c_i e^{-\kappa_i t}
\f]
where the constants \f$ c_i \f$ and \f$ \kappa \f$ are to be
determined. See:Li, B., E. DeWetering, G. Lucas, R. Brenner
Expand Down Expand Up @@ -82,10 +82,10 @@ namespace QuantLib {

//! Nelson-Siegel fitting method
/*! Fits a discount function to the form
\f$ d(t) = \exp^{-r t}, \f$ where the zero rate \f$r\f$ is defined as
\f$ d(t) = e^{-r t}, \f$ where the zero rate \f$r\f$ is defined as
\f[
r \equiv c_0 + (c_1 + c_2)*(1 - exp^{-\kappa*t})/(\kappa t) -
c_2 exp^{ - \kappa t}.
r \equiv c_0 + (c_1 + c_2) \left( \frac{1 - e^{-\kappa t}}{\kappa t} \right) -
c_2 e^{ - \kappa t}.
\f]
See: Nelson, C. and A. Siegel (1985): "Parsimonious modeling of yield
curves for US Treasury bills." NBER Working Paper Series, no 1594.
Expand All @@ -112,11 +112,11 @@ namespace QuantLib {

//! Svensson Fitting method
/*! Fits a discount function to the form
\f$ d(t) = \exp^{-r t}, \f$ where the zero rate \f$r\f$ is defined as
\f$ d(t) = e^{-r t}, \f$ where the zero rate \f$r\f$ is defined as
\f[
r \equiv c_0 + (c_0 + c_1)(\frac {1 - exp^{-\kappa t}}{\kappa t})
- c_2exp^{ - \kappa t}
+ c_3{(\frac{1 - exp^{-\kappa_1 t}}{\kappa_1 t} -exp^{-\kappa_1 t})}.
r \equiv c_0 + (c_1 + c_2) \left( \frac {1 - e^{-\kappa t}}{\kappa t} \right)
- c_2 e^{ - \kappa t}
+ c_3 \left( \frac{1 - e^{-\kappa_1 t}}{\kappa_1 t} -e^{-\kappa_1 t} \right).
\f]
See: Svensson, L. (1994). Estimating and interpreting forward
interest rates: Sweden 1992-4.
Expand Down Expand Up @@ -146,7 +146,7 @@ namespace QuantLib {
/*! Fits a discount function to a set of cubic B-splines
\f$ N_{i,3}(t) \f$, i.e.,
\f[
d(t) = \sum_{i=0}^{n} c_i * N_{i,3}(t)
d(t) = \sum_{i=0}^{n} c_i \times N_{i,3}(t)
\f]
See: McCulloch, J. 1971, "Measuring the Term Structure of
Expand Down Expand Up @@ -192,9 +192,9 @@ namespace QuantLib {


//! Simple polynomial fitting method
/* Fits a discount function to the simple polynomial form:
/*! Fits a discount function to the simple polynomial form:
\f[
d(t) = \sum_{i=0}^{degree} c_i * t^{i}
d(t) = \sum_{i=0}^{degree} c_i t^{i}
\f]
where the constants \f$ c_i \f$ are to be determined.
Expand Down Expand Up @@ -227,7 +227,8 @@ namespace QuantLib {


//! Spread fitting method helper
/* Fits a spread curve on top of a discount function according to given parametric method
/*! Fits a spread curve on top of a discount function according
to the given parametric method
*/
class SpreadFittingMethod
: public FittedBondDiscountCurve::FittingMethod {
Expand Down

0 comments on commit 8113ea8

Please sign in to comment.