The Cholesky decomposition can be used in a data step by defined it within fcmp. Also see
https://bbs.pinggu.org/thread-1129334-1-1.html
proc fcmp outlib=sasuser.funcs.temp;;
subroutine Choleskydecom (mat[*,*],lmat[*,*] );
outargs lmat;
call chol(mat, lmat);
endsub;
run;
quit;
options cmplib=sasuser.funcs;
data _null_;
array a(5,5) _temporary_ (
0.9858668 0.9832139 0.8740793 0.9125018 0.8980966,
0.9832139 2.0058248 2.0107842 2.0543280 2.0244553,
0.8740793 2.0107842 99.1966824 99.1846182 99.0462248,
0.9125018 2.0543280 99.1846182 100.1625760 100.0319877,
0.8980966 2.0244553 99.0462248 100.0319877 100.8799631
);
array b(5,5) _temporary_ ;
call Choleskydecom (a, b);
do i=1 to dim1(b);
do j=1 to dim2(b);
pos=1+13*j;
put b[j,i] @pos @;
end;
put;
end;
run;
***check with iml;
proc iml;
a={ 0.9858668 0.9832139 0.8740793 0.9125018 0.8980966,
0.9832139 2.0058248 2.0107842 2.0543280 2.0244553,
0.8740793 2.0107842 99.1966824 99.1846182 99.0462248,
0.9125018 2.0543280 99.1846182 100.1625760 100.0319877,
0.8980966 2.0244553 99.0462248 100.0319877 100.8799631
};
b=root(a);
print b;
quit;