Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15682/qlo
Modified Files:
smilesection.cpp smilesection.hpp
Log Message:
switching to standard deviation instead of vol
Index: smilesection.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/smilesection.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** smilesection.cpp 6 Dec 2006 18:18:35 -0000 1.6
--- smilesection.cpp 11 Dec 2006 17:57:51 -0000 1.7
***************
*** 26,66 ****
namespace QuantLibAddin {
! InterpolatedSmileSection::InterpolatedSmileSection(
! const QuantLib::Date& optionDate,
! const std::vector<QuantLib::Rate>& s,
! const std::vector<QuantLib::Handle<QuantLib::Quote> >& volatilitiesHandles,
! const QuantLib::DayCounter& dc) {
! libraryObject_ = boost::shared_ptr<QuantLib::SmileSection>(
! new QuantLib::InterpolatedSmileSection<>(optionDate, s, volatilitiesHandles, dc));
! }
!
! FlatSmileSection::FlatSmileSection(
const QuantLib::Date& optionDate,
QuantLib::Volatility v,
const QuantLib::DayCounter& dc,
! const QuantLib::Date& refDate) {
! libraryObject_ = boost::shared_ptr<QuantLib::SmileSection>(
! new QuantLib::FlatSmileSection(optionDate, v, dc, refDate));
}
SabrSmileSection::SabrSmileSection(
! const QuantLib::Time expiry,
! const std::vector<QuantLib::Rate>& strikes,
! const std::vector<QuantLib::Handle<QuantLib::Quote> >&
! volatilitiesHandles,
! QuantLib::Real forward,
! QuantLib::Real alpha,
! QuantLib::Real beta,
! QuantLib::Real nu,
! QuantLib::Real rho,
! bool isAlphaFixed,
! bool isBetaFixed,
! bool isNuFixed,
! bool isRhoFixed,
! bool vegaWeighted,
! const boost::shared_ptr<QuantLib::OptimizationMethod>
! method) {
!
QuantLib::SABR sabrInterpolationFactory(expiry, forward, alpha, beta,
nu, rho, isAlphaFixed, isBetaFixed, isNuFixed,
--- 26,66 ----
namespace QuantLibAddin {
! FlatSmileSection::FlatSmileSection(
const QuantLib::Date& optionDate,
QuantLib::Volatility v,
const QuantLib::DayCounter& dc,
! const QuantLib::Date& refDate)
! {
! libraryObject_ = boost::shared_ptr<QuantLib::SmileSection>(new
! QuantLib::FlatSmileSection(optionDate, v, dc, refDate));
! }
! InterpolatedSmileSection::InterpolatedSmileSection(
! const QuantLib::Date& optionDate,
! const std::vector<QuantLib::Rate>& s,
! const std::vector<QuantLib::Handle<QuantLib::Quote> >& stdDevs,
! const QuantLib::DayCounter& dc)
! {
! libraryObject_ = boost::shared_ptr<QuantLib::SmileSection>(new
! QuantLib::InterpolatedSmileSection<>(optionDate, s,
! stdDevs, dc));
}
SabrSmileSection::SabrSmileSection(
! const QuantLib::Time expiry,
! const std::vector<QuantLib::Rate>& strikes,
! const std::vector<QuantLib::Handle<QuantLib::Quote> >& stdDevs,
! QuantLib::Real forward,
! QuantLib::Real alpha,
! QuantLib::Real beta,
! QuantLib::Real nu,
! QuantLib::Real rho,
! bool isAlphaFixed,
! bool isBetaFixed,
! bool isNuFixed,
! bool isRhoFixed,
! bool vegaWeighted,
! const boost::shared_ptr<QuantLib::OptimizationMethod> method)
! {
QuantLib::SABR sabrInterpolationFactory(expiry, forward, alpha, beta,
nu, rho, isAlphaFixed, isBetaFixed, isNuFixed,
***************
*** 69,78 ****
QuantLib::InterpolatedSmileSection<QuantLib::SABR>*
genericInterpolatedSmileSection = new
! QuantLib::InterpolatedSmileSection<QuantLib::SABR>(expiry,
! strikes, volatilitiesHandles, sabrInterpolationFactory);
libraryObject_ = boost::shared_ptr<
! QuantLib::InterpolatedSmileSection<QuantLib::SABR> >
! (genericInterpolatedSmileSection);
}
--- 69,78 ----
QuantLib::InterpolatedSmileSection<QuantLib::SABR>*
genericInterpolatedSmileSection = new
! QuantLib::InterpolatedSmileSection<QuantLib::SABR>(
! expiry, strikes, stdDevs, sabrInterpolationFactory);
libraryObject_ = boost::shared_ptr<
! QuantLib::InterpolatedSmileSection<QuantLib::SABR> >(
! genericInterpolatedSmileSection);
}
Index: smilesection.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/smilesection.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** smilesection.hpp 6 Dec 2006 18:18:35 -0000 1.6
--- smilesection.hpp 11 Dec 2006 17:57:51 -0000 1.7
***************
*** 28,33 ****
class SmileSection :
! public ObjHandler::LibraryObject<QuantLib::SmileSection> {
! };
class FlatSmileSection : public SmileSection {
--- 28,32 ----
class SmileSection :
! public ObjHandler::LibraryObject<QuantLib::SmileSection> {};
class FlatSmileSection : public SmileSection {
***************
*** 41,68 ****
class InterpolatedSmileSection : public SmileSection {
public:
! InterpolatedSmileSection(const QuantLib::Date& optionDate,
! const std::vector<QuantLib::Rate>& strikes,
! const std::vector<QuantLib::Handle<QuantLib::Quote> >& volatilitiesHandles,
! const QuantLib::DayCounter& dc);
};
class SabrSmileSection: public SmileSection{
public:
! SabrSmileSection(const QuantLib::Time expiry,
! const std::vector<QuantLib::Rate>& strikes,
! const std::vector<QuantLib::Handle<QuantLib::Quote> >& volatilitiesHandles,
! QuantLib::Real forward,
! QuantLib::Real alpha,
! QuantLib::Real beta,
! QuantLib::Real nu,
! QuantLib::Real rho,
! bool isAlphaFixed,
! bool isBetaFixed,
! bool isNuFixed,
! bool isRhoFixed,
! bool vegaWeighted = false,
! const boost::shared_ptr<QuantLib::OptimizationMethod>
! method
! = boost::shared_ptr<QuantLib::OptimizationMethod>());
};
--- 40,68 ----
class InterpolatedSmileSection : public SmileSection {
public:
! InterpolatedSmileSection(
! const QuantLib::Date& optionDate,
! const std::vector<QuantLib::Rate>& strikes,
! const std::vector<QuantLib::Handle<QuantLib::Quote> >& stdDevs,
! const QuantLib::DayCounter& dc);
};
class SabrSmileSection: public SmileSection{
public:
! SabrSmileSection(
! const QuantLib::Time expiry,
! const std::vector<QuantLib::Rate>& strikes,
! const std::vector<QuantLib::Handle<QuantLib::Quote> >& stdDevs,
! QuantLib::Real forward,
! QuantLib::Real alpha,
! QuantLib::Real beta,
! QuantLib::Real nu,
! QuantLib::Real rho,
! bool isAlphaFixed,
! bool isBetaFixed,
! bool isNuFixed,
! bool isRhoFixed,
! bool vegaWeighted = false,
! const boost::shared_ptr<QuantLib::OptimizationMethod>
! method = boost::shared_ptr<QuantLib::OptimizationMethod>());
};
|