Hi,
I'm trying to use fzero to find the implied asset value of a firm. My function to calculate the asset value is:
Function F = myKMV1(x,st,vol,D,r)x = x^2 ;%used to prevent negative numbers
d1 = log(x/D)+r+0.5*(vol*vol)/vol ;d2 = d1 - vol ;F = st - x*normcdf(d1)+D*exp(-r)*normcdf(d2);
I have to iterate through a vector with different share prices and for each share price there should be a different implied asset value. However, fzero always gives the same result even though the share price is changing? The code running the function is as follows:
fun = @(x) myKMV1(x, st1, vol1,D11, r1)volNew = 1;vol1 = AssetVolatility; %this is equal to 0.0582
D11 = D1; %this is equal to 88500000
r1 = UkGilt; % this is equal to 0.0185
while abs(vol1 - volNew) > 0.00001 vol1 = VolNew ; for n = 1:252 st1 = st(n); x(n) = fzero(fun, 1000) endend
Thanks for any help in advance!
Best Answer