Which Class Should I Use?
ChebyshevSharp has four approximation families. Choose by the shape of your function first, then tune node counts, knots, groups, or TT rank.
The main questions are:
- Is the function smooth on one rectangular domain?
- Is the full grid size,
prod(n_i), feasible to evaluate and store? - If the full grid is too large, are variable interactions weak, grouped, or fully coupled?
Decision Map
Can you afford the dense grid prod(n_i)?
yes:
smooth on one box -> ChebyshevApproximation
known kinks, jumps, barriers, or regime boundaries -> ChebyshevSpline
no:
variables are additive or can be grouped -> ChebyshevSlider
variables have general cross-coupling -> ChebyshevTT with method: "cross"
Do you already have values on a Chebyshev grid?
dense full-grid values -> ChebyshevApproximation.FromValues
piecewise full-grid values -> ChebyshevSpline.FromValues
high-dimensional dense values -> ChebyshevTT.FromValues only if the dense
tensor is intentionally feasible
Class Comparison
| Class | Choose it when | Avoid it when | Derivatives | Next guide |
|---|---|---|---|---|
ChebyshevApproximation |
The function is smooth and the dense grid prod(n_i) is feasible. |
Dimension or node counts make the dense tensor too large. | Analytical spectral derivatives. | Getting Started, Error-Driven Construction |
ChebyshevSpline |
Smoothness breaks at known knots: strikes, barriers, jumps, or regime boundaries. | Trouble locations are unknown or too numerous to split cleanly. | Analytical inside each piece; nonzero derivatives at knots are undefined. | Piecewise Chebyshev Interpolation, Special Points, Adaptive Refinement |
ChebyshevSlider |
High dimensions can be partitioned into weakly interacting groups. | Cross-group interactions or cross-group Greeks are important. | Spectral inside each slide; cross-group mixed derivatives are zero by construction. | Sliding Technique, Performance |
ChebyshevTT |
High-dimensional variables are coupled and a dense grid is infeasible. | You need exact spectral derivatives or frequent dense tensor materialization. | Finite differences on the TT interpolant. | Tensor Train Interpolation, Testing & Validation |
Cost Rules
The dense classes build from a tensor grid. With n_i nodes in each dimension,
the function-evaluation count is:
This is why a 4D grid with 15 nodes per dimension is usually manageable
(50,625 values), while a 7D grid with 35 nodes per dimension is not.
Splines multiply that dense-grid cost by the number of pieces:
where k_i is the number of interior knots in dimension i.
Slider replaces one full grid with a sum of smaller group grids:
The leading 1 is the pivot evaluation. The public TotalBuildEvals property
reports only the slide-grid sum.
TT-Cross avoids dense-grid materialization and targets approximately
O(d * n * r^2) function evaluations for bounded rank r, but rank growth,
seeds, and stopping tolerances still affect accuracy and reproducibility.
Practical Defaults
- Start with
ChebyshevApproximationfor smooth functions when the dense grid is affordable. Dimension count is only a proxy; the real limit isprod(n_i). - Use
ChebyshevSplinewhen global error stays high near a known kink, jump, or barrier. If the location is not known, first use held-out samples and the error-driven workflow to find where the error concentrates. - Use
ChebyshevSliderwhen you can explain a grouping of variables. Validate it with points far from the pivot, because the reported interpolation error does not include cross-group decomposition error. - Use
ChebyshevTTwhen cross-variable coupling matters and the dense grid is too large. PreferBuild(method: "cross")for high-dimensional work. - Avoid
ToDense(), TT-SVD, andChebyshevTT.FromValues()unless the full tensor is intentionally small enough to materialize. - If you need precomputed values, use Pre-computed Values and confirm that your node ordering matches ChebyshevSharp's Type-I root nodes.
Validation Checklist
After choosing a class:
- Compare held-out true function values against interpolated values.
- Increase node counts, split knots, regroup variables, or raise TT rank and check whether the error decreases for the expected reason.
- For splines, inspect each piece separately; one bad interval can dominate the global error.
- For sliders, test points that move several groups away from the pivot.
- For TT-Cross, start with a fixed seed, then retry multiple seeds when rank is near the cap or error is unstable.
- Save and reload one model in tests when the interpolant is used outside the build process.
See Error Estimation, Testing & Validation, and Performance before treating a class choice as final.