In the Functions
Panel, by selecting the Static UDFs Tab and checking the Use UDFs box, the Static UDFs
frame lights up and you can now add your own user defined functions.
To add a Static UDF (UDF for short) to your modeling kit, just click the Add button on the Static UDFs frame and the
UDF Editor appears with the function header already
in place.
Then you just have to write the body of the function in the code editor. The code must be in JavaScript and can be rapidly tested for compiling
errors by pressing the Test button.
You will notice that the Arity box is disabled and set to zero as all UDFs will occupy leaf nodes in the trees, that is, they behave exactly as terminals.
In the Definition box, you can write a brief description of the UDF for your future reference. The text you write
there will appear in the Definition column of the Static UDFs Tab.
The use of UDFs is a very powerful tool as they allow you to explore inside knowledge about relatively simple relationships that exist between certain variables in your data. For instance, suppose you wanted to explore the fact that the sum of
six of your variables is relevant, say, d0 + d1 + d2 + d3 + d4 + d5. So you design
a UDF to express this relationship, for instance, UDF1 =
d0 + d1 + d2 + d3 + d4 + d5, and use this new UDF as an extra
building block in your modeling kit. The advantage of well designed UDFs is that they make the discovery of more complex models composed of several simpler models much easier.
|