在Matlab中用一个相当复杂的方程求解3个变量

在Matlab中用一个相当复杂的方程求解3个变量,matlab,Matlab,试图在泊松混合模型上找到三个参数(ω、θ和σ)的值,这三个参数与第三行中泊松方程的输出值相匹配。每当我运行这个程序时,我会得到一个非常非常长的条件列表,我试着把它全部放到假设条件中,结果没有什么不同。有人知道发生了什么事,或者我怎样才能让这一切顺利进行吗 Matlab将打印条件列表,因为您没有添加分号。为了避免打印条件列表,只需添加如下分号: syms omega j theta sigma k=[90 94 98 102 106 110]; % Strike prices putprices=

试图在泊松混合模型上找到三个参数(ω、θ和σ)的值,这三个参数与第三行中泊松方程的输出值相匹配。每当我运行这个程序时,我会得到一个非常非常长的条件列表,我试着把它全部放到假设条件中,结果没有什么不同。有人知道发生了什么事,或者我怎样才能让这一切顺利进行吗

Matlab将打印条件列表,因为您没有添加分号。为了避免打印条件列表,只需添加如下分号:

syms omega j theta sigma
k=[90 94 98 102 106 110]; % Strike prices
putprices=[.1606 .2806 .9285 2.8801 6.1523 10.0147]; % Put prices at each strike
mustar = log(100)-sigma.^2/2-omega.*(exp(-theta)-1); % risk-neutral mean
Es1j=exp(mustar-theta.*j+sigma.^2./2); % Expected value of stock price at state j 1 period from now
x1=(log(k)-(mustar-theta.*j))./sigma; % the first normcdf value
x2=(log(k)-(mustar-theta.*j)-sigma.^2)./sigma; % the second normcdf value
qpkandj = k.*normcdf(x1)-Es1j.*normcdf(x2); % combination of normcdfs and strike prices and expected value of stock price 1 peroid from now
qpk=exp(-omega).*omega.^j./factorial(j).*qpkandj; % Poisson formula
eqns = symsum(qpk,j,0,inf)== putprices % Continuation of Poisson formula
assume(omega > 0)
assume(theta, 'real') 
assume(sigma, 'real')
S = solve(eqns, [omega theta sigma], 'Real', true, 'ReturnConditions', true)
S.omega
S.theta
S.sigma
eqns = symsum(qpk,j,0,inf) == putprices; % Continuation of Poisson formula