It looks that the objective function used in nonlinear optimization routines can only have one input vector. However, what if I need to pass some other parameters to the objective function. For example, I want to minimize the sum of square of difference between a function value and a target value, and the target value is user defined. Let me use a simple case, suppose x is a 3*1 vector I want to find to minimize the following funciton.
z=(x-y)**2 + (x-y)**3 + (x-y)**2, where y is the vector of target specified by users. Therefore, it is better not hard coded in the objective function.
Ideally, the objective function should have two arguments, x and y;
z=(x-y)**2 + (x-y)**3 + (x-y)**2;
The reason I cannot put x and y together as a single vector is that I only need to search for x, for a given y. In MATLAB, all the optimization routines allow passing extra arguements to the objective function. I am not sure if I can do similar things in SAS.
Thanks a bunch.
I am reading your article, once I found there is a similar question posted earlier on the forum. Here is a quick related question. If I have mutiple extra arguments, which are difficult to be written as a single matrix, how should I write the global clause? Should it be like
or global (y1) global (y2) .... ?
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.