• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Calibration with Matlab

Joined
4/1/12
Messages
2
Points
11
Hi all,

I have to calibrate with matlab a model that calculates the prices of a down and out digital barrier option written on an underlying that follows a geometric brownian motion dynamics.

In practice I know that I have to find the parameters (sigma and the low barrier level L) minimizing the square difference between market price and model price for these options. My problem is how to write this in matlab.

Usually when I know the parameters I call the pde solver in this way in order to obtain model prices:

sol = pdepe(m,@pdefun_gbm,@pdeic,@pdebc,x,t1,[],r,sigma);

where x is the price grid: x= 15:0.5:50,so in this case L=15. How can I rearrange the formula above to take into account that now L and Sigma are for the moment unknown?

Any comments is really appreciate!!!
Thanks
 
I'm sorry maybe the suited section was the "Computing" one, how can I move the post there?
 
if you're trying to do a least squares solver, i think there is a better way to solve for these params. Do a search for one of my earlier posts, about bond pricing models and code i wrote for a thesis. In my code, you'll find examples of fittign to curves solving for unknown parameters using various matlab libraries (vasicek interest rate model, and two bond pricing models)... that should give you a starting point.
 
Hi all,

I have to calibrate with matlab a model that calculates the prices of a down and out digital barrier option written on an underlying that follows a geometric brownian motion dynamics.

......

sol = pdepe(m,@pdefun_gbm,@pdeic,@pdebc,x,t1,[],r,sigma);

where x is the price grid: x= 15:0.5:50,so in this case L=15. How can I rearrange the formula above to take into account that now L and Sigma are for the moment unknown?

Any comments is really appreciate!!!
Thanks

I would write a new function as m-file:

C++:
function y = barrier(sigma, L)
 
r=.... %all given parameters
 
y = pdepe(m,@pdefun_gbm,@pdeic,@pdebc,x,t1,[],r,sigma);
 
Back
Top