alpha=0.2beta=0.05sigma=0.01r0=0.05epsilon=-0.46NRepl=60NSteps=60T=60dt=T/NStepsmodel='vasicek'rng(75)T=60%t=0:1:60
r = pr_1(r0, alpha, beta, sigma, T, NSteps, NRepl, model)a=mean(r)%r1 = pr(r0, alpha, beta, sigma, T, NSteps, NRepl, model)
%b=mean(r1)
%r2 = pr_2(r0, alpha, beta, sigma, T, NSteps, NRepl, model)
%c=mean(r2)
figure;plot(a,'r')%hold on
%plot(b,'k')
%hold on%plot(c,'b')
%hold off
%%
alpha1=-0.095phi=0.001sigma1=0.001v0=0.00123rng(1075) v= mortalitysimulation(alpha1,phi,sigma1,v0,T, NSteps, NRepl, model) m=mean(v) v2= mortalitysimulation1(alpha1,phi,sigma1,v0,T, NSteps, NRepl, model) z=mean(v2) v1= mortalitysimulation2(alpha1,phi,sigma1,v0,T, NSteps, NRepl, model) l=mean(v1) figure;plot(m)%hold on%plot(z,'--')
%hold on%plot(l,'--')
%hold off%%B=alpha*betaA=-alphasigma1=sigma^2h=3rho=0.05H=h-1/hB1=alpha1*phiA1=-alpha1sigma11=sigma1^2k=1/h%t=1:1:60
d=[epsilon;0]D=d*d'%%ZZ=k*(1/A1)*(B1-(3/4)*k*sigma11/(A1^2))XX=k*(B1-(1/2)*k*sigma11/(A1^2))CC=k*(B1-k*sigma11/(A1^2))*(1/A1)NN=(1/4)*k^2*sigma11/(A1^2)*(1/A1)MM=H*(1/A)*(B-(3/4)*H*sigma1/(A^2))LL=H*(B-(1/2)*H*sigma1/(A^2))KK=H*(B-H*sigma1/(A^2))*(1/A)JJ=1/4*((H^2)*sigma1/(A^2))*(1/A)syms tsyms sfun=@(s) exp(ZZ-XX*s-CC*exp(-A1*s)-NN*exp(-2*A1*s)-k*(1/A1)*(1-exp(-A1*s))*m+MM-LL*(s-t)-KK*exp(-A*(s-t))-JJ*exp(-2*A*(s-t))-H*(1/A)*(1-exp(-A*(s-t))*a-H*(1/2)*epsilon^2*(s-t)-k*rho*s))I=int(fun,s,t,Inf)
MATLAB: How to resolve this integral, i have the function in s and i want to integrate this function between t and infinity and get an explicit solution, can someone help me
mathematicsMATLABnumerical integrationSymbolic Math Toolbox
Best Answer