public HullWhiteProcess Calibrate(DiscountCurve disc) { //preset parameters, calibrating these is skipped due to the lack of openly accessible market data //might worth implementing later double a = 0.31, sigma = 0.008; //market instantaneous forward rate ForwardRate = disc.ForwardRate; Theta = t => Utils.Derive(x => ForwardRate(x), t) + a * ForwardRate(t) + sigma * sigma / (2.0 * a * a) * (1.0 - Math.Exp(-2.0 * a * t)); Func <double, double> alpha = t => a *ForwardRate(t) + sigma * sigma / (2.0 * a * a) * (1.0 - Math.Exp(-2.0 * a * t)); return(new HullWhiteProcess(Theta, a, sigma)); }
public double Price(PricingRequest request) { DiscountCurve dc = (DiscountCurve)request.Ycs.get(); IProcess calibratedProcess = RSCalibrator.Calibrate(dc); double r0 = dc.ForwardRate(0.01); return(request.Instrument.Price(calibratedProcess, new RSProcess.State(r0, 0), 0, step, n)); }
public static RSProcess Calibrate(DiscountCurve dc) { return(new RSProcess(0.31, 0.008, dc.ForwardRate)); }