Fit orientation, parametric curves, and geometry

Estimating Y from X is not the same as estimating X from Y. When a curve describes a geometric trajectory instead, it can be better to parameterize both coordinates.

Reference interface: GX-TXT DEV112-P011 · Dataset Curve Fit.

The role of regression orientation

In the Fit model and configuration panel, the Fit orientation control defines the variable to estimate and the one used as predictor. The two main orientations of functional models are Y = f(X) and X = f(Y).

The first looks for the function that predicts the response Y from the X values. The second swaps the roles of the variables in the regression: it uses Y as the predictor and minimizes the errors in the X coordinate. The plot still shows the physical X and Y variables on their axes; rotating the image is not enough to turn one problem into the other.

We use a synthetic Dataset with 13 observations, time in seconds and voltage in volts. The curve is slightly convex, so a straight line is only an approximation of its shape.

Direct regression: Y = f(X)

Open the c12_quadratic_response Dataset, set X = time_s (s) and Y = voltage_v (V), then select Add Dataset curve. In the configuration panel choose Fit orientation = Y = f(X), Model = linear, Fit points = all and Output domain = source.

Figure 1. The direct functional orientation uses time as the predictor of voltage.

Press Preview fit. The estimated model is:

U(t) ≈ ( 0.227390 V/s)·t + 0.115659 V.

Figure 2. The line approximates the response in volts. Vertical deviations are what the direct regression minimizes.

In this configuration Curve Fitter returns RMSE = 0.174106 V and R² = 0.959808. Since the voltage is the dependent variable, the RMSE value is expressed in volts.

Inverse regression: X = f(Y)

Without changing the Dataset or swapping the columns by hand, select Fit orientation → X = f(Y) . Keep Model = linear and request a new Preview; changing the orientation invalidates the previous one.

Figure 3. In the inverse orientation, voltage becomes the independent variable of the regression function.

The result is now a function of the form:

≈ (4.220975 s/V)·U − 0.247043 s.

Figure 4. The Cartesian plane is physically the same, but the coefficients change because the minimized error now refers to the time coordinate.

The inverse regression has RMSE = 0.750125 s and R² = 0.959808. Here R² coincides with the direct one because both are ordinary linear regressions with intercept on the same sample; this does not make the two lines equivalent.

Do not compare 0.174106 V and 0.750125 s directly as if they were errors of the same kind. Moreover, the algebraic inverse of the line obtained from Y=f(X) does not generally coincide with the new X=f(Y) regression: the two procedures minimize different residuals.

When to use inverse regression

The orientation should reflect the experimental problem. If an input quantity is controlled and the response is measured, it is natural to treat the response as a function of the input. If instead you want to estimate an unknown quantity from a measured response, inverse regression can be appropriate, provided you consider the error distribution, the variability of the predictors and the domain in which the inversion makes physical sense.

For a non-monotonic curve, a single Y value can correspond to several X values. In that case the function X=f(Y) may not exist globally: you must restrict the range to an identifiable branch or choose a different geometric model.

When X and Y both depend on a parameter

A geometric curve can be described by a pair of functions:

X = x(u),   Y = y(u), with a dimensionless parameter u ∈ [0, 1].

This representation does not require Y to be a single-valued function of X. It is useful for trajectories, contours, arcs, planar profiles and lines that turn back along one of the axes.

Curve Fitter includes geometric models such as circular_arc, quadratic_bezier, cubic_bezier, parametric_polynomial and parametric_spline. The X and Y coordinates must use physically compatible units if you want to interpret geometric distances and residuals.

An example using a quadratic Bézier curve

Consider a curve built from three control points:

PointX (mm)Y (mm)
P₀10
P₁23
P₂42

The quadratic Bézier curve is defined by the vector equation:

B(u) = (1−u)² P₀ + 2(1−u)u P₁ + u² P₂, for 0 ≤ u ≤ 1.

The c12_quadratic_bezier teaching Dataset contains 41 coordinate pairs, both in millimeters, calculated for uniform values of the parameter u.

Select the Dataset, set X= x_mm, Y= y_mm, load the curve and choose Model = quadratic_bezier. The Viewer automatically switches to the Fit orientation = X=x(t), Y=y(t) mode.

Figure 5. The quadratic Bézier model uses both coordinates as geometric quantities, not as predictor and response of a functional regression.

Request Preview fit. The fitted curve passes through the synthetic points and recovers the three control points defined above.

Figure 6. The parametric curve and the 41 source points coincide within numerical precision. The coefficients refer to the geometric control points.

Interpreting the statistics of a geometric curve

In parametric fitting the residual is not simply the vertical difference between observation and prediction. For a Bézier curve, the quality of the fit is assessed with a geometric distance between the observed point and the curve.

In this example, the Preview returns a Geometric RMSE of about 2.5 × 10⁻¹⁵ mm: the value is practically zero because the data were generated from exactly the same Bézier curve.

Figure 7. Geometric statistics have meanings different from those of a functional regression. The ordinary R² referred to a response Y is reported as not applicable.

The table may label the six coefficients with generic names; to interpret them, refer to the Bézier model and its geometric state. In this example they are the X coordinates of P₀, P₁, P₂, followed by the Y coordinates of the same three points. The geometric unit is the millimeter, as declared by the Dataset.

A geometric dispersion indicator computed on the XY coordinates must not be confused with the R² of the Y=f(X) regression. For a parametric curve, look first at the geometric distance, the shape, the direction and the match with the original points.

Experimental radial orientation

R=f(theta) (experimental) is also available in the orientation selector. This mode expresses the radius as a function of the angle around a user-defined origin. The radial settings include the origin, the zero-angle direction, clockwise or counterclockwise sense, angle units and the branch continuity policy.

To use it, the X and Y coordinates must represent lengths with compatible units. The contour must also be describable with a single radius for each angle in the chosen branch; curves with several points at the same angle may need a parametric representation instead.

This distinction matters: a Cartesian curve, an inverse relationship and a parametric contour are not just three ways of drawing the same plot. They define mathematical problems with different assumptions and residuals.

Choose the appropriate formulation

Use Y=f(X) when you want to estimate the response Y from X; use X=f(Y) when the problem requires estimating X from Y and the relationship is single-valued in the range considered. For contours and trajectories, prefer a parametric or geometric curve when both coordinates play symmetric roles.

Always keep the units, the order of the points and the identity of the Dataset. This information lets you interpret the coefficients and compare different methods without giving an inverse or geometric regression the statistical meaning of an ordinary regression.