金融工程专业是一个交叉学科,也是学习难度非常大的专业。金融工程专业的知识覆盖了统计学,数学,编程,经济学,金融学等方面的知识,而且国内金融工程人才的培养也远远落后于欧美国家。因此很多在海外留学的同学在写金融工程作业的时候,如果求助于各种代写中介,往往得不到理想的结果。有良心的中介会回复你说这个我们真的做不来,或者有的黑心中介直接收了钱就不管你了,最后赔了夫人又折兵。而我们Essay PhD团队里有很多专业研究金融资产定价和金融数学的PhD,各种金融工程作业代写都能轻松解决,拿到高分。
以我们最近代写的“Computing European Option Prices Under Local Volatility Model With Finite Difference and Monte Carlo Simulation”为例。具体涉及到随机微分方程(Stochastic Differential Equation)的求解,Monte Carlo模拟方法的应用,以及非常复杂的有限差分方法:Explicit finite differences, Implicit finite differences, Crank-Nicolson finite differences, Multi-step finite differences.
我们先做出了一般期权的Monte Carlo模拟程序,同时提供了详实的注释,代码风格也简单易懂。
function Price = MCpricing(K,S0,r,yield,alpha,T,times,numPaths,Type)
% Function to calculate the price of a vanilla European option
% Put or Call
% Price = MCpricing(X,S0,r,sig,Svec,tvec,oType)
%
% Inputs: K - strike
% : S0 - stock price
% : r - risk free interest rate
% : yield - dividend
% : alpha - controls the local volatility function
% : T: time to expiry
% : times: number of times to discretize
% : numPaths: iterations, number of paths
% : Type - must be 'PUT' or 'CALL'.
%
% Output: Price - the option price and standard deviation
S = S0 * ones(numPaths,1);
dt=T/times;
for i=1:times
eps=randn(numPaths,1);
sigmat=0.25*exp(-i*dt)*(100./S).^alpha;
mudt=(r-yield-0.5.*sigmat.^2)*dt;
S=S.*exp(mudt+sqrt(dt)*sigmat.*eps);
end
switch Type
case'PUT'
payoff=max(K-S,0);
case'CALL'
payoff=max(S-K,0);
end
% Calculate the option price
cal=payoff*exp(-r*T);
Price = [mean(cal);std(cal)/sqrt(numPaths)];
通过利用explicit finite difference对随机微分方程的推导,我们得到了如下的期权定价的Monte Carlo模拟程序。最后这份作业拿到了90+的高分,我们认为代码简单易懂,对数学推导的灵活运用,对期权定价的理解,专业的写作和正确的计算结果是高分的关键。金融工程作业代写是代写中介不可能完成的任务,也是代写质量的试金石,我们Essay PhD团队不是中介,没有中间抽成,写手都是PhD兼职,质量保障!
function Price = FDMExplicit(K,S0,r,yield,alpha,Svec,tvec,Type)
% Function to calculate the price of a vanilla European
% Put or Call option using the explicit finite difference method
%
% Price = FDMExplicit(X,r,sig,Svec,tvec,Type)
%
% Inputs: K - strike
% : S0 - stock price
% : r - risk free interest rate
% : yield - dividend
% : alpha - controls the local volatility function
% : T: time to expiry
% : Svec - Vector of stock prices (i.e. grid points)
% : tvec - Vector of times (i.e. grid points)
% : Type - must be 'PUT' or 'CALL'.
%
% Output: Price - the option price
% Get the number of grid points
M = length(Svec)-1;
N = length(tvec)-1;
% Get the grid sizes (assuming equi-spaced points)
dt = tvec(2)-tvec(1);
% Calculate the coefficients
% To do this we need a vector of price paths, j refers to St
j = 1:M-1;
j2 = j.*j;
% Pre-allocate the output
price(1:M+1,1:N+1) = nan;
% Specify the boundary conditions
switch Type
case'CALL'
% Specify the expiry time boundary condition
price(:,end) = max(Svec-K,0);
% Put in the minimum and maximum price boundary conditions
% assuming that the largest value in the Svec is
% chosen so that the following is true for all time
price(1,:) = 0;
price(end,:) = -K*exp(-r*tvec(end:-1:1))+ Svec(1)*exp(-yield*tvec(end:-1:1));
case'PUT'
% Specify the expiry time boundary condition
price(:,end) = max(K-Svec,0);
% Put in the minimum and maximum price boundary conditions
% assuming that the largest value in the Svec is
% chosen so that the following is true for all time
price(1,:) = K*exp(-r*tvec(end:-1:1))- Svec(1)*exp(-yield*tvec(end:-1:1));
price(end,:) = 0;
end
for i = N:-1:1
sig = 0.25*exp(-i*dt).*(100./j).^alpha;
sig2= sig.^2;
aj = 0.5*dt*(sig2.*j2-(r-yield).*j);
bj = 1-dt*(sig2.*j2+r);
cj = 0.5*dt*(sig2.*j2+(r-yield).*j);
% Form the tridiagonal matrix
A = diag(bj); % Diagonal terms
A(2:M:end) = aj(2:end); % terms below the diagonal
A(M:M:end) = cj(1:end-1); % terms above the diagonal
% Calculate the price at all interior nodes
offsetConstants = [aj(1); cj(end)];
price(2:end-1,i) = A*price(2:end-1,i+1);
% Offset the first and last terms
price([2 end-1],i) = price([2 end-1],i) + offsetConstants.*price([1 end],i+1);
end
% Calculate the option price
Price = interp1(Svec,price(:,1),S0)