Difference between revisions of "CubicInterp"
Line 1: | Line 1: | ||
[[Category:Interpolation functions]] | [[Category:Interpolation functions]] | ||
− | [[Category:Doc Status D]] <!-- For Lumina use, do not change --> | + | [[Category:Doc Status D]] |
+ | [[Category:Array Library]] | ||
+ | <!-- For Lumina use, do not change --> | ||
− | == CubicInterp(d,r,x, | + | == CubicInterp(d, r, x, ''i'') == |
+ | Returns the natural cubic spline interpolated values of «r» along «d», interpolating for values of «x». The points ''(r,d)'' that get interpolated are indexed by «i». «d» and «r» must both be indexed by «i», and the values of «d» must be ascending. If «x» is less than the minimum value in «d», it returns the first value in «r»; if «x» is greater than the maximum value in «d», it returns the last value for «r». | ||
− | + | The index «i» is optional when «d» and «r» have only one index is common; however, it is recommended that you explicitly specify «i», since this will enable your expression to array-abstract if any dimension is ever added to «d» and «r» in the future. | |
− | The index | ||
− | + | Points having either «d» or «r» equal to null are ignored. When «x» is null, the result is null. | |
[[Image:Cubicinterp-graph.png]] | [[Image:Cubicinterp-graph.png]] | ||
− | A cubic interpolation can vary wildly from the actual values of the data points. In the above graph, all the | + | A cubic interpolation can vary wildly from the actual values of the data points. In the above graph, all the «r» values are positive, yet the interpolation is as small as -22.5 around x=33. Even if the «r» values are monotonically increasing, this does not mean that the cubic interpolation will be monotonically increasing. The [[MonoCubicInterp]] function is a variation that provides a guarantee of monotonicity. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Example== | ==Example== | ||
Cubicinterp(Index_b, Array_a, 1.5, Index_b) → | Cubicinterp(Index_b, Array_a, 1.5, Index_b) → | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
+ | !! colspan="3" style="text-align: left;" | a ▶ | ||
|- | |- | ||
! scope="col"| a | ! scope="col"| a | ||
Line 44: | Line 28: | ||
| 2.219 | | 2.219 | ||
|} | |} | ||
+ | |||
+ | == History == | ||
+ | *Analytica 4.1+ | ||
+ | **Null values allowed in «d» and «r». | ||
+ | |||
+ | == See also == | ||
+ | * [[MonoCubicInterp]] | ||
+ | * [[LinearInterp]] | ||
+ | * [[StepInterp]] |
Revision as of 07:11, 14 August 2015
CubicInterp(d, r, x, i)
Returns the natural cubic spline interpolated values of «r» along «d», interpolating for values of «x». The points (r,d) that get interpolated are indexed by «i». «d» and «r» must both be indexed by «i», and the values of «d» must be ascending. If «x» is less than the minimum value in «d», it returns the first value in «r»; if «x» is greater than the maximum value in «d», it returns the last value for «r».
The index «i» is optional when «d» and «r» have only one index is common; however, it is recommended that you explicitly specify «i», since this will enable your expression to array-abstract if any dimension is ever added to «d» and «r» in the future.
Points having either «d» or «r» equal to null are ignored. When «x» is null, the result is null.
A cubic interpolation can vary wildly from the actual values of the data points. In the above graph, all the «r» values are positive, yet the interpolation is as small as -22.5 around x=33. Even if the «r» values are monotonically increasing, this does not mean that the cubic interpolation will be monotonically increasing. The MonoCubicInterp function is a variation that provides a guarantee of monotonicity.
Example
Cubicinterp(Index_b, Array_a, 1.5, Index_b) →
a ▶ | ||
---|---|---|
a | b | c |
0.6875 | -2.875 | 2.219 |
History
- Analytica 4.1+
- Null values allowed in «d» and «r».
Enable comment auto-refresher