#include <AMA.h>
Functions | |
long int | AMA_MltvGrdLstsqr (AMA_OPTIONS *options, long int nind, long int *ng, double **x, double *z, double *wht, long int *degree, long int *mlamda, double **lamda, double theta, AMA_SPLINE **spline) |
Least Squares Approximation of Multivariate Gridded Data More... | |
long int AMA_MltvGrdLstsqr | ( | AMA_OPTIONS * | options, |
long int | nind, | ||
long int * | ng, | ||
double ** | x, | ||
double * | z, | ||
double * | wht, | ||
long int * | degree, | ||
long int * | mlamda, | ||
double ** | lamda, | ||
double | theta, | ||
AMA_SPLINE ** | spline | ||
) |
Least Squares Approximation of Multivariate Gridded Data
This function employs cnspla to compute a least squares spline approximation of independent variable data and dependent variable data . The independent variable data is given as , for and , and it defines the rectilinear grid
The dependent variable data lies on the grid and is given as , for ; that is, there are dependent variable values.
For a given set of data this function employs cnspla to compute the spline
that minimizes
for .
In the above definition of the , for and , are the coefficients of the tensor product B-splines
where are the univariate B-splines of degree defined by the knot vector . The knot vector is given as
where the knots must satisfy the conditions
If the knot vector is represented by its distinct knot vector
and its knot multiplicity vector
then the aforementioned conditions are
Also the first and last distinct knots must satisfy the conditions and , respectively. In this case the number of knots is .
For convenience this function does not require the definition of the order knots at the left and right hand endpoints and also accepts the knot vector given as
where the knots satisfy the conditions
If the knot vector is represented by its distinct knot vector
and its knot multiplicity vector
then the aforementioned conditions are
As before, the first and last distinct knots must satisfy the conditions and , respectively. In this case the number of knots is .
This function employs an efficient algorithm for computing least squares spline approximations of multivariate gridded data. The algorithm consists of computing the splines
for . The coefficients of are the coefficients of the tensor product B-splines
where are the univariate B-splines of degree defined by the knot vector . The degree is
the number of coefficients is
and the knot vector is
The spline is based on the spline and is defined by setting its coefficents for and . The spline is defined through multiple invocations of AMA_UnvLstsqr() in the following manner.
First, the spline is defined by invoking AMA_UnvLstsqr() times to compute the univariate spline
that minimizes
Computing the univariate splines , for and , defines the coefficients of .
After computing the splines , for , are defined by invoking AMA_UnvLstsqr() times to compute the univariate spline
that minimizes
Computing the univariate splines , for when and for when , defines the coefficients of .
In total this algorithm consists of invocations of AMA_UnvLstsqr() to compute a least squares spline approximation.
This function does the following:
Parameter Note: In the parameters description given below the limits on are , k = and N .
options | [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvGrdLstsqr(). |
nind | [in] The number of independent variables . Must satisfy nind AMA_MXNIND. |
ng | [in] Array of size nind containing the number of points where ng[k] . Must satisfy ng[k] . |
x | [in] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data , for . The values of x[k] must be in ascending order. |
z | [in] Array of size N containing the dependent variable data , for . |
wht | [in] Array of size N containing the weights , for . Must satisfy for all . If wht = NULL, then this function uses . |
degree | [in] Array of size nind containing the degree where degree[k] . Must satisfy degree[k] . |
mlamda | [in] Array of size nind containing the number of knots where mlamda[k] . Must satisfy mlamda[k] . |
lamda | [in] Array of size nind containing arrays of size mlamda[k] where lamda[k] contains the knot vector or . |
theta | [in] The penalty term weight . Must satisfy theta . |
spline | [out] Pointer to AMA_SPLINE pointer containing the least squares spline approximation. Must satisfy spline NULL. |
User Callable Function - Documented 103015