Custom Expression Editor

There are many sections in Rational Will where you can use Custom expressions. For example, the Probability Distribution modeling tool supports custom piecewise expressions for custom Density function. Utility Function editor supports custom expression for defining your very custom utility function. The custom expression editor looks like this:

Custom Expression editor in Decision Tree Analyzer, used to author piecewise density functions and custom utility functions across the application.

The expression you see in the above screenshot, means,

Mathematical rendering of the example piecewise expression: a normal density centered at 150 with standard deviation 25 when x is at least 125, and 0 otherwise.

Explanation:

When x >= 125, f(x) = e^(-0.5 * ((x - 150) / 25)^2) / (sqrt(2 * pi) * 25) .

Otherwise, f(x) = 0.

Quick Tip

You can see the supported functions anytime by clicking the info button as shown below:

Inline help panel for the Custom Expression editor showing supported syntax, operators, and the names of mathematical functions available in expressions.

List of supported functions


  • exp(x), you can also use e^x.
  • log10(x)
  • sin(x)
  • cos(x)
  • tan(x)
  • sqrt(x)
  • abs(x)
  • pow(x,5) where x is the base and 5 is just a number for example, that raises on x as an exponent. You can also use an expression like x^5 which is also recognized.
  • round(x)
  • ln(x)
  • factorial(x)
  • gamma(x)
  • beta(x)
  • binomial(x,2)
  • erf(x)
  • arcsin(x)
  • arccos(x)
  • arctan(x)


Supported Constants

  • pi
  • e

Supported Operators

  • +
  • -
  • *
  • /
  • ^
  • (
  • )

Boolean Expressions

In the condition section, you can use the same functions that you can use in the expression section. Also, a various boolean combination can be used. For example:

  • (x > 5) AND (x < 10) which is equivalent to (x > 5) && (x < 10). You can use either of these styles, your choice.
  • (x >= 2) OR (x ==7), which is equivalent to (x >= 2) || (x == 7). You can use either of these styles.

Last updated on Feb 16, 2020