Closed Mattyuan98 closed 1 year ago
Thanks. I will look at this later today or at the weekend. D
Hi - I fixed it - it was wrong as you said. I will push a new version over the weekend. Thanks. If you use it can you add a test case to TestFinFXVanillaOption.py under golden. That would be very helpful. D
Thank you professor. I will take time to look at the script and add a test case afterwards.
Best, Puen
Hello Professor,
I found some slight issues when I tried to use SABR volatility in the valuation of FX vanilla option. After investigation, the input argument type in SABR model in the fx_vanilla_option scipt seems wrong:
fx_vanilla_option.py: ... 300 elif type(model) == SABR: 301 volatility = vol_function_sabr(model.alpha, 302 model.beta, 303 model.rho, 304 model.nu, 305 F0T, K, tdel) ...
vol_function_sabr(params, f, k, t) actually takes only 4 arguments and the first params is supposed to be an array while we see 7 arguments in the scipt above. Also, the attributes of model should be 'model._alpha' i/o 'model.alpha' according to what I see from the SABR module.
I changed the script into below and works on my side:
elif type(model) == SABR: sabr_params = np.array([model._alpha,model._beta,model._rho,model._nu]) volatility = vol_function_sabr(sabr_params,F0T, K, tdel)
Could you please kindly confirm if such issue exists?
Thanks and regards, Puen YUAN