Hey is anyone has an idea about how to code or spot the mistake in the statement below in coding a mixed negative binomial distribution .The code has two data col1 and new_data_1 and in the proc nlmixed a likelihood function is created with those different parameters and it supposed to return me the maximum
***************CODE***************************************
proc NLMIXED data=call.Merging;
parms gam0=.1,gam1=0.1,gam2=0.1,gam3=0.1,
gam4=.1,sig0=.1,sig1=.1,sig2=.1,sig3=.1,
sig4=.1,ome0=.1,ome1=.1,ome2=.1,ome3=.1,
ome4=.1,bet0=.1,bet1=.1,bet2=.1,bet3=.1,bet4=.1
phi=.1,p=.1;tho=.1;
array gamma{5};
array oldg{5};
array sigma{5};
array omega{5};
array beta{5};
gamma{1} = gam0; sigma{1} = sig0; omega{1} = ome0; beta{1} = bet0;
gamma{2} = gam1; sigma{2} = sig1; omega{2} = ome1; beta{2} = bet1;
gamma{3} = gam2; sigma{3} = sig2; omega{3} = ome2; beta{3} = bet2;
gamma{4} = gam3; sigma{4} = sig3; omega{4} = ome3; beta{4} = bet3;
gamma{5} = gam4; sigma{5} = sig4; omega{5} = ome4; beta{5} = bet4;
oldg{1}=gamma{1};
do i=2 to 5;
*gamma{i}+gamma{i-1};
temp = gamma{i};
gamma{i} = temp + gamma{i-1};
oldg{i}=gamma{i}-gamma{i-1};
end;
thoat=(1-tho)**new_data_1;
j=1;
fS=0;
sS=0;
do j=1 to 5;
*temp=gamma{i};
fS+(thoat)*((p*gamma{j}+1-p)**new_data_1);
k=j;
do k =j to 5;
/*ol=oldg{k};sig=sigma{k};omeg=omega{k};bet=beta{k};*/
sS+oldg{k}*(1/sigma{k})*phi*((log(omega{k})-log(col1))/sigma{k});
end;
II=fS*p*sS*beta{j};
logII=log(II);
end;
model new_data_1~General(logII);
run;
********************************log message error***************************
The log message is a note :
NOTE: Execution error for observation 1.
NOTE: PROCEDURE NLMIXED used (Total process time):
real time 1.19 seconds
cpu time 0.18 seconds