#223 closed defect (fixed)
psVectorFitSpline1D() args
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | IPP SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Is the x argument redundant? What should we do if the xargument is non-Null,
but it does agree with the domains member of the psSpline argument? Should we
ensure that they are the same?
How are we to use the yErr argument?
What whould happen if the psSpline argument is NULL? Should I assume that the
spline alloc functions have already generated this argument?
Do you have a preference for the alogrithm used to implement this? I pretty
much rehashed the Numerical Recipes algorithm. This works. However, it
requires the number of splines to be equal to the number of data points in x and y.
Change History (7)
comment:1 by , 22 years ago
| Owner: | changed from to |
|---|
comment:2 by , 22 years ago
| Status: | new → assigned |
|---|
comment:3 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
We've concluded that errors (in the knot positions) should be ignored when doing
spline fitting --- it just isn't clear how to best treat the errors.
Accordingly, I have altered the API in the SDRS:
psSpline1D *psVectorFitSpline1D(psSpline1D *mySpline,
const psVector *x,
const psVector *y);
comment:4 by , 22 years ago
| bug_group: | IPP-doc? |
|---|---|
| Resolution: | fixed |
| Status: | closed → reopened |
What should we do if the x-argument is non-NULL and does not agree with the
"domain" member of the psSpline struct? For example, the "x" argument and the
"domain" member might be of different size, or they might be the same size, but
have different values.
What should be done if the psSpline argument is NULL?
comment:5 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
The vector x should be used to set the knots for the psSpline (the "domains").
Hence the input spline is modified (if input as NULL, then allocate it).
Updated the definition of psSpline1D to use "knots" instead of "domains" (better
choice of word):
typedef struct {
int n; /< Number of spline pieces
psPolynomial1D spline; /< Array of n pointers to splines
float *knots; /< The boundaries between each spline
piece. Size is n+1.
} psSpline1D;
Here is the description of psVectorFitSpline1D in the current SDRS:
psSpline1D *psVectorFitSpline1D(psSpline1D *mySpline,
const psVector *x,
const psVector *y);
\code{psVectorFitSpline} shall return the spline that best fits the
given combination of ordinates (\code{x}) and coordinates (\code{y}).
The function shall construct a new \code{psSpline1D} based on knots
determined from \code{x}: the domain boundaries are the data values in
\code{x}. As is the case for \code{psVectorFitPolynomial1D}, if
\code{x} is \code{NULL}, then the index of \code{y} shall be used as
the ordinate. This function must be valid only for types
\code{psF32}, \code{psF64}.
comment:6 by , 22 years ago
| Keywords: | VERIFIED added |
|---|
Closing subsequent to release of SDRS-08, ADD-07.
comment:7 by , 22 years ago
| Keywords: | VERIFIED removed |
|---|

psVectorFitSpline1D should construct the psSpline1D on the basis of the input
vectors. The domains should be based on the values in x. the spline coeffs
should be chosen to make the spline fit the data. The boundaries should be the
data values.
We need to clarify how the fit is done in the presence of errors. this will be
added to the ADD.
The user of this function should have performed any rebinning needed to reduce
the domain to an appropriate number of bins.
the SDRS draft has been clarified.