Emara,
There's a quite similar posting about this on comp.soft-sys.sas which I believe is from you as well.
I've responded in the newsgroup but will respond here also in the interest of getting the information
to as many interested parties as possible.
Thanks for posting this question. The best way to do this currently
is to use PROC NLP along with PROC FCMP (a Base SAS procedure) to
define the objective function. I consulted with one of our developers
on this question and he sent some sample code which uses this approach
for a problem that's pretty similar to yours. It's included at the
end of this email.
PROC OPTMODEL in SAS/OR is the successor to PROC NLP (it handles
not only nonlinear but also linear, mixed integer, and quadratic optimization).
However OPTMODEL is not yet FCMP-enabled and so it's best, given your
requirements, for you to stick with PROC NLP for now.
If you have any questions please feel free to contact me.
Thanks,
Ed Hughes
SAS/OR Product Manager
919-531-6916
Ed.Hughes@sas.com
Sample code follows:
data barddata;
input y @@;
datalines;
0.14 0.18 0.22 0.25 0.29 0.32 0.35 0.39
0.37 0.58 0.73 0.96 1.34 2.10 4.39
;
proc fcmp outlib=work.myfuncs.test;
function bard(x1, x2, x3);
array y[15] /nosymbols ;
rc = read_array('barddata', y);
fx = 0;
do k = 1 to 15;
vk = 16 - k;
wk = min(k,vk);
fxk = y - (x1 + k/(vk*x2 + wk*x3));
fx = fx + fxk**2;
end;
return (0.5*fx);
endsub;
run;
options cmplib = work.myfuncs;
proc nlp;
parms x1 x2 x3 = 1.0;
bounds 0 <= x1 <= 10,
0 <= x2 <= 10,
0 <= x3 <= 10;
min bardfn;
bardfn = bard(x1,x2,x3);
run;