next up previous contents index
Next: Alternatives to the Black Up: A general approach to Previous: Pricing   Contents   Index

Improving the estimates, control variates.

To improve on the simulation, we can use the control variate technique.



// file simulate_general_control_variate.cc

#include "fin_algoritms.h"
#include <math.h>

double derivative_price_european_simulated_control_variate ( 
   double S,
   double r,
   double sigma,
   double time,
   double payoff(vector<double>& prices),
   int no_steps,
   int no_sims) 
{
    double X = S;
    double c_bs = option_price_call_black_scholes(S,X,r,sigma,time);
    vector <double> prices(no_steps,0.0);
    double sum_payoffs=0;
    double sum_payoffs_bs=0;
    for (int n=0; n<no_sims; n++) {
       simulate_price_sequence(S,r,sigma,time,no_steps,prices);
       sum_payoffs += payoff(prices);
       sum_payoffs_bs += payoff_european_call(prices.back(),X);
    };
    double c_sim = exp(-r*time) * (sum_payoffs/no_sims); 
    double c_bs_sim = exp(-r*time) * (sum_payoffs_bs/no_sims); 
    c_sim += (c_bs-c_bs_sim); 
    return c_sim;
};



next up previous contents index
Next: Alternatives to the Black Up: A general approach to Previous: Pricing   Contents   Index
Bernt Arne Odegaard
1999-09-09