24 const Handle<Quote>& fxSpotToday,
25 const Array& times,
const Array& sigma,
26 const QuantLib::ext::shared_ptr<Constraint>& sigmaConstraint)
27 : FxBsParametrization(currency, fxSpotToday),
28 PiecewiseConstantHelper1(times, sigmaConstraint) {
32FxBsPiecewiseConstantParametrization::FxBsPiecewiseConstantParametrization(
33 const Currency& currency,
const Handle<Quote>& fxSpotToday,
const std::vector<Date>& dates,
const Array& sigma,
34 const Handle<YieldTermStructure>& domesticTermStructure,
35 const QuantLib::ext::shared_ptr<Constraint>& sigmaConstraint)
36 : FxBsParametrization(currency, fxSpotToday),
37 PiecewiseConstantHelper1(dates, domesticTermStructure, sigmaConstraint) {
41void FxBsPiecewiseConstantParametrization::initialize(
const Array& sigma) {
42 QL_REQUIRE(PiecewiseConstantHelper1::t().size() + 1 == sigma.size(),
43 "alpha size (" << sigma.size() <<
") inconsistent to times size ("
44 << PiecewiseConstantHelper1::t().size() <<
")");
47 for (Size i = 0; i < PiecewiseConstantHelper1::y_->size(); ++i) {
48 PiecewiseConstantHelper1::y_->setParam(i,
inverse(0, sigma[i]));
FxBsPiecewiseConstantParametrization(const Currency ¤cy, const Handle< Quote > &fxSpotToday, const Array ×, const Array &sigma, const QuantLib::ext::shared_ptr< QuantLib::Constraint > &sigmaConstraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >())
piecewise constant model parametrization
QuantLib::SparseMatrix inverse(QuantLib::SparseMatrix m)