#include <AMA.h>
Functions | |
long int | AMA_UnvMonoApprox (AMA_OPTIONS *options, long int n, double *x, double *z, double *epsilon, long int degree, AMA_SPLINE **spline) |
Monotonic Approximation of Univariate Data More... | |
long int AMA_UnvMonoApprox | ( | AMA_OPTIONS * | options, |
long int | n, | ||
double * | x, | ||
double * | z, | ||
double * | epsilon, | ||
long int | degree, | ||
AMA_SPLINE ** | spline | ||
) |
Monotonic Approximation of Univariate Data
For a given set of data and approximation tolerances , for , this function employs cnspla to compute the spline
that minimizes
subject to the approximation constraints
for , and the local monotonicity constraints
for . If for some the above conditions are not met, then the intervals and intersect and the constraint can be imposed over the interval . However, it is possible for the intervals and to intersect, for each and ; without an intersection existing between all the intervals. In this case the equality constraint is inconsistent with the approximation constraints
for ; and, therefore, can not be imposed over the interval . Hence, instead of imposing an equality constraint this function minimizes over all intervals for which the intervals and intersect.
In the above definition of the , for , are the coefficients of the univariate B-splines of degree which are based on the knot vector . The knot vector depends on the independent variable data, the degree and the continuity of the spline at the interior data points. This function computes a spline which satisfies either the full or reduced continuity condition at the interior data points, as well as, the approximation and local monotonicity constraints. The knot vector is defined by AMA_LamdaMonoInterp().
The following table summarizes the continuity of , for , and the number of coefficients, , for a spline that satisfies the full and reduced continuity conditions.
Degree | Full Continuity | Reduced Continuity | ||
---|---|---|---|---|
Linear | is continuous for | is continuous for | ||
Quadratic | is continuous for | is continuous for | ||
Cubic | is continuous for | is continuous for | ||
Quartic | is continuous for | is continuous for | ||
Quintic | is continuous for | is continuous for |
This function performs the follow tasks:
options | [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_UnvMonoApprox(). |
n | [in] The number of data points . Must satisfy n . |
x | [in] Array of size n containing the independent variable data , for . Must be in strictly ascending order. |
z | [in] Array of size n containing the dependent variable data , for . |
epsilon | [in] Array of size n containing the approximation tolerances , for . Must satisfy for all . If epsilon = NULL, then this function uses for all . |
degree | [in] The degree . Must satisfy degree . |
spline | [out] Pointer to AMA_SPLINE pointer containing the monotonic spline approximation. Must satisfy spline NULL. |
User Callable Function - Documented 101715