Compute a polynomial fit of the form sum[X(i)*t**i] = d, that is solve for coefficients X given a set of data pairs (t,d). The dimension of X is n, the degree of the polynomial.
Definition at line 73 of file PolyFit.hpp.
#include <PolyFit.hpp>
Public Member Functions | |
void | Add (const std::vector< T > &d, const std::vector< T > &t) |
Add a std::vector of data to the estimation. More... | |
void | Add (const Vector< T > &d, const Vector< T > &t) |
Add a gnsstk::Vector of data to the estimation. More... | |
void | Add (T d, T t, T w=T(1)) |
Add a single (optional: weighted) datum to the estimation. More... | |
Matrix< T > | Covariance (void) |
get the covariance matrix More... | |
unsigned int | Degree (void) const |
get the degree of the polynomial More... | |
Vector< T > | Evaluate (const Vector< T > &Vt) |
T | Evaluate (T t) |
bool | isSingular (void) |
is the problem singular? More... | |
unsigned int | N (void) const |
get the number of data points processed More... | |
PolyFit () | |
Empty constructor. More... | |
PolyFit (unsigned int n) | |
Constructor given an initial size. More... | |
void | Reset (unsigned int n=0) |
Vector< T > | Solution (void) |
get the solution vector (coefficients) More... | |
Private Member Functions | |
void | Solve (void) |
Invert the equation. More... | |
Private Attributes | |
Matrix< T > | Cov |
Covariance matrix. More... | |
Vector< T > | InfData |
information data = inverse(Cov)*X = sum[transpose(P)*data]. More... | |
Matrix< T > | InfMatrix |
information matrix = inverse(Cov) = sum[transpose(P)*P], P=partials. More... | |
bool | Inverted |
flag indicating problem has been inverted. More... | |
unsigned int | n_ |
degree of polynomial to be fit (dimension of state). More... | |
unsigned int | Npts |
number of data points added to the estimation so far. More... | |
bool | Singular |
flag indicating problem is singular. More... | |
Vector< T > | X |
State vector (array of polynomial coefficients) of size n_. More... | |
|
inline |
Empty constructor.
Definition at line 77 of file PolyFit.hpp.
|
inline |
Constructor given an initial size.
Definition at line 79 of file PolyFit.hpp.
|
inline |
Add a std::vector of data to the estimation.
Definition at line 152 of file PolyFit.hpp.
|
inline |
Add a gnsstk::Vector of data to the estimation.
Definition at line 129 of file PolyFit.hpp.
|
inline |
Add a single (optional: weighted) datum to the estimation.
Definition at line 110 of file PolyFit.hpp.
|
inline |
get the covariance matrix
Definition at line 220 of file PolyFit.hpp.
|
inline |
get the degree of the polynomial
Definition at line 222 of file PolyFit.hpp.
|
inline |
Evaluate the polynomial at a Vector of times; singular problems return an empty vector.
Definition at line 195 of file PolyFit.hpp.
|
inline |
Evaluate the polynomial at the given time; singular problems return zero.
Definition at line 177 of file PolyFit.hpp.
|
inline |
is the problem singular?
Definition at line 216 of file PolyFit.hpp.
|
inline |
get the number of data points processed
Definition at line 224 of file PolyFit.hpp.
|
inline |
Reset the estimation, i.e. restart with new data, with new dimension. Default dimension is 0, meaning do not change dimension.
Definition at line 91 of file PolyFit.hpp.
|
inline |
get the solution vector (coefficients)
Definition at line 218 of file PolyFit.hpp.
|
inlineprivate |
Invert the equation.
Definition at line 228 of file PolyFit.hpp.
|
private |
Covariance matrix.
Definition at line 253 of file PolyFit.hpp.
|
private |
information data = inverse(Cov)*X = sum[transpose(P)*data].
Definition at line 245 of file PolyFit.hpp.
|
private |
information matrix = inverse(Cov) = sum[transpose(P)*P], P=partials.
Definition at line 243 of file PolyFit.hpp.
|
private |
flag indicating problem has been inverted.
Definition at line 247 of file PolyFit.hpp.
|
private |
degree of polynomial to be fit (dimension of state).
Definition at line 239 of file PolyFit.hpp.
|
private |
number of data points added to the estimation so far.
Definition at line 241 of file PolyFit.hpp.
|
private |
flag indicating problem is singular.
Definition at line 249 of file PolyFit.hpp.
|
private |
State vector (array of polynomial coefficients) of size n_.
Definition at line 251 of file PolyFit.hpp.