hey guys,
I put a matrix as an arguement in the start finish module, but it seems to exist some problem, that some loops work but some not. Can I set a matrix as an arguement in the start-finish module?
%macro calculate();
%do i=1 %to 2320;
%let e=%sysfunc(cat(&i));
%let first="spl1.split";
%let name="";
data _null_;
b=&e;
a=&first;
x=strip(a)||strip(b);
call symput("name",x);
run;
%put &name;
proc iml;
load D;
load LL;
start LLH(st,fi,S);
b_1=(S[st:(fi-1),4]`)*S[(st+1):fi,4]/((S[st:(fi-1),4]`)*S[st:(fi-1),4]);
b_2s=S[(st+1):fi,4]-b_1*S[st:(fi-1),4];
b_2=b_2s[:];
sigma_s1=S[(st+1):fi,4]-b_1*S[st:(fi-1),4]-b_2;
sigma_s2=sigma_s1##J((fi-st),1,2);
sigma=(fi-st-1)/(fi-st-2)*sigma_s2[:];
LLF=(-0.5*(fi-st-1))*log(2*arcos(-1)*(sigma))-1/(2*sigma)*((S[st:(fi-1),4]`)*S[st:(fi-1),4]);
return(LLF);
finish LLH;
use &name;
%do t=1 %to 120;
g=D[&t,1];
read all where(COL2=g) into SS;
LL[&i,&t]=LLH(1,15,SS);
%end;
store LL;
quit;
%end;
%mend;
%calculate();