Programming the statistical procedures from SAS

Have anyone developed a desirability function for regression optimization in SAS?

Reply
New Contributor
Posts: 2

Have anyone developed a desirability function for regression optimization in SAS?

I would like to optimize the performance of the production processes with multiple objectives.  Have anyone had experience in developing desirability function in SAS?  Thanks.

Trusted Advisor
Posts: 1,659

Re: Have anyone developed a desirability function for regression optimization in SAS?

You mean like the one in the JMP Prediction Profiler?

Yes, I developed such a thing in SAS a long time ago, and it now belongs to the company I worked for at that time, so I can't share it with you (I can't even use it myself). But in PROC IML, you would create a desirability function, and then use one of the Non-Linear Optimization functions in PROC IML to find the maximum desirability.

But honestly, if you have a copy of JMP, you'd be wise just to export your data to JMP, fit the model there and use the built-in optimization tools there. It's sooo much easier, and a very nice user interface.

Super User
Posts: 9,766

Re: Have anyone developed a desirability function for regression optimization in SAS?

You'd better take a look at IML . In its documentation , there is indeed a REG function writing by IML . More efficient is using IML's function SOLVE().

Post it at  IML  forum . Rick might give you some better idea.

Xia Keshan

Trusted Advisor
Posts: 1,659

Re: Have anyone developed a desirability function for regression optimization in SAS?

Not sure what you mean by "a REG function writing by IML"

SOLVE() doesn't really apply here anyway, it applies to solving a system of linear equations; the desirability function that the OP mentioned is a non-linear function and we want to find a maximum.

Super User
Posts: 9,766

Re: Have anyone developed a desirability function for regression optimization in SAS?

Well. I should clarify something . It is from documentation.


proc iml;
x = {1 1 1,
1 2 4,
1 3 9,
1 4 16,
1 5 25};
y = {1, 5, 9, 23, 36};
b = inv(x` * x) * x` * y;
print b;
yhat = x * b;
r = y-yhat;
print yhat r;
sse = ssq(r);
dfe = nrow(x)-ncol(x);
mse = sse/dfe;
print sse dfe mse;


start Regress; /* begin module */
xpxi = inv(x` * x); /* inverse of X'X */
beta = xpxi * (x` * y); /* parameter estimate */
yhat = x * beta; /* predicted values */
resid = y-yhat; /* residuals */
sse = ssq(resid); /* SSE */
n = nrow(x); /* sample size */
dfe = nrow(x)-ncol(x); /* error DF */
mse = sse/dfe; /* MSE */
cssy = ssq(y-sum(y)/n); /* corrected total SS */
rsquare = (cssy-sse)/cssy; /* RSQUARE */
results = sse || dfe || mse || rsquare;
print results[c={"SSE" "DFE" "MSE" "RSquare"}
L="Regression Results"];
stdb = sqrt(vecdiag(xpxi) * mse); /* std of estimates */
t = beta/stdb; /* parameter t tests */
prob = 1-probf(t#t,1,dfe); /* p-values */
paramest = beta || stdb || t || prob;
print paramest[c={"Estimate" "StdErr" "t" "Pr>|t|"}
L="Parameter Estimates" f=Best6.];
print y yhat resid;
finish Regress; /* end module */


Trusted Advisor
Posts: 1,659

Re: Have anyone developed a desirability function for regression optimization in SAS?

I don't think this is what the original question asked for. The question wasn't about fitting a regression model, it was about maximizing a desirability function (which would have to use the fitted regression equation plus additional user-supplied desirabilities)

Super User
Posts: 9,766

Re: Have anyone developed a desirability function for regression optimization in SAS?

Ha. IML have a couple of functions to do such optimization question . One of my favorite is GA .

New Contributor
Posts: 2

Re: Have anyone developed a desirability function for regression optimization in SAS?

Hi Paige,

Thank you for your help.  I have several questions.

(1) Do you still remember which non-linear optimization function you used in your project? 

(2) How much time did you spend in developing this desirability function feature roughly?

(3) Did you develop this under the SAS PROC IML environment or strictly under SAS/IML?

Thanks a lot!

Trusted Advisor
Posts: 1,659

Re: Have anyone developed a desirability function for regression optimization in SAS?

1) Nelder-Mead

2) A lot (roughly)

3) PROC IML

Ask a Question
Discussion stats
  • 8 replies
  • 578 views
  • 4 likes
  • 3 in conversation