Gradient Based Pnl Attribution

Overview


Gradient Based

Attribution Methodologies



let bs = await import('/lib/finance/derivatives/black-scholes/v1.0.0/black-scholes.mjs');
let att = await import('/lib/attribution/v1.0.0/attribution.mjs');

let price = function(S, sigma, r, t){
  let K = 100;
  return bs.call(S,K,sigma,r,t);
}

let S0 = 100;
let S1 = 105;

let sigma0= 0.16;
let sigma1 = 0.17;

let r0 = 0.05;
let r1 = 0.048;

let t0 = 1;
let t1 = 0.95

let attribution = att.gradient(price, [S0,sigma0,r0,t0],[S1,sigma1,r1,t1]);
					

Contents