### A free/open-source library for quantitative finance

Public Types | Public Member Functions | Protected Member Functions
ReplicatingVarianceSwapEngine Class Reference
Forward option engines

Variance-swap pricing engine using replicating cost,. More...

`#include <ql/pricingengines/forward/replicatingvarianceswapengine.hpp>`

Inheritance diagram for ReplicatingVarianceSwapEngine:
[legend]

List of all members.

## Public Types

typedef std::vector< std::pair < boost::shared_ptr < StrikedTypePayoff >, Real > > | weights_type

## Public Member Functions

| ReplicatingVarianceSwapEngine (const boost::shared_ptr< GeneralizedBlackScholesProcess > &process, Real dk=5.0, const std::vector< Real > &callStrikes=std::vector< Real >(), const std::vector< Real > &putStrikes=std::vector< Real >())
void | calculate () const

## Protected Member Functions

void | computeOptionWeights (const std::vector< Real > &, const Option::Type, weights_type &optionWeights) const
Real | computeLogPayoff (const Real, const Real) const
Real | computeReplicatingPortfolio (const weights_type &optionWeights) const
Rate | riskFreeRate () const
DiscountFactor | riskFreeDiscount () const
Real | underlying () const
Time | residualTime () const

## Detailed Description

Variance-swap pricing engine using replicating cost,.

as described in Demeterfi, Derman, Kamal & Zou, "A Guide to Volatility and Variance Swaps", 1999

Tests:
  returned variances verified against results from literature