hi,
I am trying to solve the following problem
The initial point is =(0 0 0)
My code is the following
proc optmodel; var x{1..3}; min f = x[1]^2 + 2*x[2]^2 + 5*x[3]^2 - 4*x[1] - 20*x[2] - 20*x[3] ; /* starting point */ x[1]= 0; x[2]= 0; x[3]=0; solve; print x[1] x[2] x[3] x[1].dual x[2].dual x[3].dual; quit;
is this code right or am I making any mistake?
Please help
I think you can do this.
proc optmodel; var x{1..3} init 0; min f = x[1]^2 + 2*x[2]^2 + 5*x[3]^2 - 4*x[1] - 20*x[2] - 20*x[3] ; solve; print x[1] x[2] x[3] x[1].dual x[2].dual x[3].dual; quit;
That is correct. You can also do:
print x x.dual;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.