Functions | |
void | a_poly_swap (a_real *a, a_size n) |
swap between | |
void | a_poly_swap_ (a_real *a, a_real *b) |
a_real | a_poly_eval (a_real const *a, a_size n, a_real x) |
horner function for polynomial | |
a_real | a_poly_eval_ (a_real const *a, a_real const *b, a_real x) |
a_real | a_poly_evar (a_real const *a, a_size n, a_real x) |
horner function for polynomial | |
a_real | a_poly_evar_ (a_real const *a, a_real const *b, a_real x) |
void | a_poly_xTx (a_uint m, a_real const *x, a_uint n, a_real *A) |
compute the matrix A^T * A for polynomial fitting. | |
void | a_poly_xTy (a_uint m, a_real const *x, a_real const *y, a_uint n, a_real *b) |
compute the vector A^T * y for polynomial fitting. | |
compute the matrix A^T * A for polynomial fitting.
This function computes the product of the transpose of a design matrix A with itself (A^T * A), which is used in the normal equations for polynomial fitting using least squares method. The matrix A is implicitly defined by the input vector x, where each element of x corresponds to a data point.
[in] | m | number of data points (rows in matrix A). |
[in] | x | points to an array of size m containing the data points. |
[in] | n | degree of the polynomial plus one (columns in matrix A). |
[out] | A | points to an array of size n*n where the result A^T * A will be stored. |
compute the vector A^T * y for polynomial fitting.
This function computes the product of the transpose of a design matrix A with a vector y (A^T * y), which is used in the normal equations for polynomial fitting using least squares method. The matrix A is implicitly defined by the input vector x, where each element of x corresponds to a data point.
[in] | m | number of data points (rows in matrix A). |
[in] | x | points to an array of size m containing the data points. |
[in] | y | points to an array of size m containing the target values. |
[in] | n | degree of the polynomial plus one (columns in matrix A). |
[out] | b | points to an array of size n where the result A^T * y will be stored. |