Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes for AAD #2056

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ql/experimental/credit/spotlosslatentmodel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ namespace QuantLib {
{
Real sumMs =
std::inner_product(this->factorWeights_[iName].begin(),
this->factorWeights_[iName].end(), m.begin(), 0.);
this->factorWeights_[iName].end(), m.begin(), Real(0.));
Real res = this->cumulativeZ((invCumYProb - sumMs) /
this->idiosyncFctrs_[iName] );
#if defined(QL_EXTRA_SAFETY_CHECKS)
Expand Down Expand Up @@ -236,12 +236,12 @@ namespace QuantLib {
//Size iRR = iName + basket_->size();// should be live pool
const Real sumMs =
std::inner_product(fctrs_[iName].begin(), fctrs_[iName].end(),
mktFactors.begin(), 0.);
mktFactors.begin(), Real(0.));
const Real sumBetaLoss =
std::inner_product(fctrs_[iName + numNames_].begin(),
fctrs_[iName + numNames_].end(),
fctrs_[iName + numNames_].begin(),
0.);
Real(0.));
return this->cumulativeZ((sumMs + std::sqrt(1.-crossIdiosyncFctrs_[iName])
* std::sqrt(1.+modelA_*modelA_) *
invUncondRR
Expand All @@ -264,7 +264,7 @@ namespace QuantLib {
basket_->defaultKeys()[iName]);
const Probability pdef = dfts->defaultProbability(d, true);
// before asking for -\infty
if (pdef < 1.e-10) return 0.;
if (pdef < 1.e-10) return Real(0.);

Size iRecovery = iName + numNames_;// should be live pool
return cumulativeY(
Expand Down Expand Up @@ -361,7 +361,7 @@ namespace QuantLib {
\sum_k a^2_{i,k} a^2_{N+i,k}
*/
{
Real cumul = 0.;
Real cumul = Real(0.);
for(Size iB=0; iB<factorWeights[iName].size(); iB++)
// actually this size is unique
cumul += factorWeights[iName][iB] *
Expand Down
2 changes: 1 addition & 1 deletion ql/pricingengines/blackformula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ namespace QuantLib {

namespace {

boost::math::normal_distribution<double> normal_dist;
boost::math::normal_distribution<Real> normal_dist;

Real phi(const Real x) {
return boost::math::pdf(normal_dist, x);
Expand Down
Loading