那位大侠帮我看看这段matlab程序错在哪里

function[tv,Xt,CXt]=SimCompPoiss(lambda,T,jumpType,m,v)%returnsatrajectoryofacompound... function [tv,Xt,CXt]=SimCompPoiss(lambda,T,jumpType,m,v)
% returns a trajectory of a compound Poisson process
% the returned trajectories are with drift and compensated, i.e. martingale behavior
% input:
% lambda the jump intensity
% T the length of time
% jumpType is the type of required jumps.
% if equals to 0 then use normal distribution with mean m and variance v
% if different from 0 then use constant jumps, of size jumpType
%
% general parameters
% N the number of discrete steps over which to decompose [0,T]
N=1000;

if jumpType == 0; %normal case
mu=lambda*m; % compensator
else
mu=lambda*jumpType;
end

nJ = poissrnd(lambda*T,1,1) % one draw to determine number of jumps
dt=T/N;
tv = 0:dt:T; tv=tv'; % time
N=rows(tv);
jv=1:1:N; jv=jv'; % discrete grid
u = rand(nJ,1);
Xt = zeros(N,1);

if nJ>0
jIdx = unifUnique(nJ,1,N); % nJ unique uniformly distributed numbers between 1 and N
if jumpType==0
jS = m + randn(nJ,1)*sqrt(v); % the jump size
else
jS = jumpType*ones(nJ,1);
end

for i=1:nJ
Xt(jIdx(i):N) = Xt(jIdx(i):N) + jS(i)*ones(N-jIdx(i)+1,1);
end

end

CXt = Xt - mu*tv

错误提示
??? Input argument 'jumpType' is undefined.

Error in ==> D:\MATLAB6p5\work\SimCompPoiss.m
On line 15 ==> if jumpType == 0; %normal case
展开
 我来答
txy356
2007-09-05
知道答主
回答量:10
采纳率:0%
帮助的人:0
展开全部
你在程序里没有定义 'jumpType' ,将if jumpType == 0; 去掉“;”试试看
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式