I am trying to compare option price given by Carr and Madan method using fft with value generated by BS model and find out the error between the two method. I want to plot this error graph(3d graph as a function of S,k,T) in matlab so error = Call(S,k,T)-CallBS(S,k,T) [where 1st is using carr and madan calculated by implementing fft in MATLAB] How should i go about it?
- This question does not appear to be about quantitative finance within the scope defined in the help center.
For a 3D graph, your data can only have two independent dimensions. In case of option prices, its probably the strike or moneyness on one axis and the time to maturity on the other. The third axis is for the values to be plotted; in your case that would be the error values.
I think what you are looking for is the surf function. Assuming error is a matrix (if not, use the reshape command), you can get a 3D surface plot with the command surf(error). You can use meshgrid to generate the appropriate matrices for the independent axes.