Dear All,
I am using fminsearch to minimize this function:
function Yield_Final = bond3(def_ind)
global sig
global beta
global alpha
global dis_free
N=51;
Bonds=zeros(1,N);
%%%constant%%%%
f_b=0.01;
f_gb=0.02;
K=(1+ f_b + f_gb);
phi=sqrt(2*sig^2*K + beta^2);
k=(beta + phi)/( betaphi);
t=0;
dt=1/360;
T=50;
%%%%Loop%%%%%
summm3=0;
for i=5:5:50
a1_a(1,i+1)=((1k)/(1k*exp(phi*((i+1)./5t))))^(2*alpha/(sig^2)) * exp(alpha*(beta+ phi)*((i+1)./5t)*(1/sig^2));
a2_a(1,i+1)=((phibeta)/(sig^2*K))+ (2*phi/(sig^2*K*(k*exp(phi*((i+1)./5t))1)));
def(1,i+1)=a1_a(1,i+1t)* exp(a2_a(1,it)*def_ind*K);
summm3= summm3+ def(1,i+1)
end
Yield_Final=summm3;
I would like to minimize this function with respect to the parameter "def_ind" but my function doesnt minimize. IS it because of the loop? my function is the sum of "def"...so it is one value but the parameters is inside the loop and i dont understand why the function doesnt change value when fimisearch algorithm runs..Please any help or suggestion would very welcomed thanks a lot
S
