Data Nodes and Function Nodes


Applies to: 2D, 3D and Studio.

Every node in a notebook holds one of two things: data -- a finite list of values -- or a function, which the program can evaluate at any point you ask for.

TableCurve draws function nodes in blue. Data nodes are in the ordinary colour. The distinction is worth a minute of your attention, because it decides what each node can do.

What Makes a Node Blue

A node is a function node when its result is something that can be evaluated between the data points -- a fitted equation, a spline, an interpolant, or an expression you typed yourself.

2D function nodes:

·    Curve Fit

·    Spline Estimation

·    Smoothing Spline, LOESS and Savitzky-Golay Estimation

·    View Function

3D function nodes:

·    Surface Fit

·    Gridded Estimation

·    Scattered Estimation

·    View Function

Everything else is a data node -- including some results that look as though they ought to be functions. Smooths, FFT and eigenanalysis outputs, and autoregressive predictions are data nodes, because they produce values at the same positions the parent had. There is no "between the points" to ask them about.

The clearest illustration is a pair of procedures whose names differ by one word:

·    Smoothing Spline Estimation is a function node. It gives you a spline, and the spline can be evaluated anywhere.

·    Smoothing is a data node. It gives you the same number of points you started with, smoothed.

Why It Matters

Most procedures work on data. A function node has no data to offer them until you decide at what resolution -- so a function node cannot be fitted, listed, exported or compared as data until it has been digitized.

This is deliberate. A fitted equation is not a list of points, and turning it into one is a decision with a number in it. TableCurve asks you for that number rather than choosing it silently.

Digitizing a Function Node

Select the blue node and choose Data | Generate Discrete XY Data (2D) or Data | Generate Discrete XYZ Data (3D). The same command is on the node's right-click menu. On a data node the menu items appear grayed, which is itself a reminder of the distinction.

Give the range you want, and the density either way round:

·    Total Points -- "give me 500 points"; or

·    Sampling Increment -- "give me a point every 0.1".

In 3D you give both axes: the x and y ranges, and either the point counts or the increments for each.

The button is labelled Plot rather than OK, because what follows is a preview: the points you have asked for, drawn over the live parent curve or surface, so you can see whether the density captures the shape. From the preview you can Add the node, go back to change the numbers, or leave without creating anything. Nothing is written to the notebook until you add it.

The Digitized Node Follows Its Parent

A digitized node does not store a copy of the points. It stores the instructions -- the range and the density -- and re-reads the parent's current function each time it is selected.

So if you refit the equation, or edit the expression the parent came from, the digitized node follows, at the density you chose. It behaves like a formula in a worksheet column, not like a paste.

Digitizing does not consume the function. The blue node stays blue and stays evaluable, and you can create as many digitized children as you like at different densities.

View Function Nodes

One function node is different from the rest, because you wrote it: the View Function node holds up to twenty-five expressions of your own, and draws each as its own curve (2D) or its own pane (3D). It stores the text you typed, so reopening it puts you back in the editor with your work intact.

It can be digitized like any other function node, and it has a shortcut for the common case: the Discrete Data option creates one digitized child per active function in a single step. The same command is on the node's right-click menu as Create Discrete Data Children. By default a 3D function digitizes on a 51 x 51 grid and a 2D function at 1001 points; the density you set is remembered on the node.

Working entirely from View Function nodes and their digitized children -- with no imported data at all -- is a supported way to use TableCurve.

What You Can Do with a Digitized Node

It is data, and every procedure that takes data will take it. Two things are worth knowing:

·    Find Optimum Visualization is offered on a digitized 3D node. Because a digitized node carries its own appearance, the rendering you keep stays on that node and no other node changes -- unlike a raw data node, where the setting is shared.

·    View and Compare Digitized Data Nodes is offered on a View Function parent with two or more digitized children, and is counted separately from any raw data under the same parent. The two kinds are worth looking at apart even when they sit together.

See Also

·    View Function -- writing and viewing your own expressions.

·    View and Compare Multiple 3D Data Sets and View and Compare Multiple 2D Data Sets.