14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8 Programming Methods 227<br />

Additional Numeric Operators<br />

F, Beta, Chi-square, t, Gamma, and Weibull distributions are supported for the first arguments in their<br />

Distribution and Quantile functions. If it encounters an expression that it cannot convert, Invert Expr()<br />

returns Empty().<br />

JSL provides a Simplify Expr command that takes a messy, complex formula and tries to simplify it using<br />

various algebraic rules. To use it, submit<br />

or<br />

result = Simplify Expr(expr(expression));<br />

result = Simplify Expr(nameExpr(global));<br />

For example,<br />

Simplify Expr (expr(2*3*a+b*(a+3-c)-a*b));<br />

results in<br />

6*a + 3*b + -1*b*c<br />

Simplify Expr also unwinds nested If expressions. For example:<br />

r = simplifyExpr(<br />

expr(If(cond1,result1,if(cond2,result2,if(cond3,result3,resultElse)))));<br />

results in<br />

If(cond1, result1, cond2, result2, cond3, result3, resultElse);<br />

Maximize and Minimize<br />

The Maximize and Minimize functions find the factor values that optimize an expression. The expression<br />

is assumed to be a continuous function of the factor values.<br />

The form of the call is<br />

result = Maximize(objectiveExpression,{list of factor names},<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!