#include <Orthpoly.hh>
Public Types | |
enum | Weighting_ { EQUAL, RELATIVE, POISSON } |
Public Methods | |
Orthpoly_ () | |
Init to empty. | |
int | data (const Vecdbl_ &Xm, const Vecdbl_ &Ym, const Vecdbl_ &Wgt) |
data(Xm, Ym, (Wgt|Wtype)): resets the calling object and stores the data points with the weights in it. More... | |
int | data (const Vecdbl_ &Xm, const Vecdbl_ &Ym, Weighting_ Wtype=EQUAL) |
double | poly_fit (unsigned int Deg) |
poly_fit(Deg): fits orthogonal polynomials up to degree Deg to the data previously supplied via the data(...) method. More... | |
void | make_polycoeff () |
make_polycoeff(): once the user is satisfied with the orthogonal fit, then this method should be called to calculate the parameters and standard deviations for the non-orthogonal estimation Y = p[0]+p[1]*x+...+p[Degree]*x^Degree. | |
double | good_fit () const |
good_fit(): returns a "goodness-of-fit" value that indicates what percentage of Y is "explained" by the fit. | |
double | f_test () const |
f_test(): returns the F-statistic variable that can be tested later for significance. | |
const Vecdbl_& | param () const |
param(): Returns the non-orthogonal parameter coefficients. More... | |
const Vecdbl_& | sdev () const |
sdev(): Returns the standard deviations of the non-orthogonal parameter coefficients. More... | |
const Smatdbl_& | correl () const |
correl(): Returns the correlation (normed covariance) matrix of the non-orthogonal parameter coefficients. More... | |
double | approx (double X) const |
approx(X): approximate Y(X) with the current polynomial. | |
Protected Methods | |
void | setup_weight (const Vecdbl_ &Ymeas, Weighting_ Weighting) |
void | make_orthcoeff (unsigned int Deg) |
void | back_orthcoeff (unsigned int Deg) |
void | reset () |
void | resize_orth (unsigned int Maxdeg) |
void | resize_param (unsigned int Maxdeg) |
void | make_orthpoly (size_t Deg) |
Static Protected Methods | |
int | check_dim (const Vecdbl_ &Xm, const Vecdbl_ &Ym, const Vecdbl_ &Wgt) |
Private Attributes | |
Vecdbl_ | Xmeas |
Vecdbl_ | W |
Vecdbl_ | Ymeas |
size_t | Nm |
size_t | Nf |
Smatdbl_ | Poly |
Rmatdbl_ | Polyval |
Vecdbl_ | Orthcoeff |
Vecdbl_ | Varorth |
Vecdbl_ | Param |
Vecdbl_ | Sdev |
Vecdbl_ | Dres |
Vecdbl_ | Norm |
Smatdbl_ | Correl |
size_t | Degree |
size_t | Maxdegree |
double | Sres |
bool | Makepolycoeff |
The polynomials (up to a desired degree) will be created on-the-fly. You can experiment with various degrees and once you are satisfied you can request a conversion of the orthogonal coefficients into simple polynomial coefficients.
Definition at line 32 of file Orthpoly.hh.
|
Definition at line 37 of file Orthpoly.hh. |
|
Init to empty.
Definition at line 58 of file Orthpoly.hh. |
|
data(Xm, Ym, (Wgt|Wtype)): resets the calling object and stores the data points with the weights in it. If the weighting type is specified instead as the last parameter, then the weight vector will be calculated appropriately from Ym. Return value: the number of data points. Throws Dimexc_ on dim mismatch. |
|
|
|
poly_fit(Deg): fits orthogonal polynomials up to degree Deg to the data previously supplied via the data(...) method. Returns the "goodness-of-fit" parameter. Throws Toofewexc_ if there are not enough data points. |
|
make_polycoeff(): once the user is satisfied with the orthogonal fit, then this method should be called to calculate the parameters and standard deviations for the non-orthogonal estimation Y = p[0]+p[1]*x+...+p[Degree]*x^Degree.
|
|
good_fit(): returns a "goodness-of-fit" value that indicates what percentage of Y is "explained" by the fit.
Definition at line 95 of file Orthpoly.hh. |
|
f_test(): returns the F-statistic variable that can be tested later for significance.
Definition at line 104 of file Orthpoly.hh. |
|
param(): Returns the non-orthogonal parameter coefficients. Invoke make_polycoeff() before calling this method. Definition at line 116 of file Orthpoly.hh. |
|
sdev(): Returns the standard deviations of the non-orthogonal parameter coefficients. Invoke make_polycoeff() before calling this method. Definition at line 124 of file Orthpoly.hh. |
|
correl(): Returns the correlation (normed covariance) matrix of the non-orthogonal parameter coefficients. Invoke make_polycoeff() before calling this method. Definition at line 132 of file Orthpoly.hh. |
|
approx(X): approximate Y(X) with the current polynomial.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 42 of file Orthpoly.hh. |
|
Definition at line 42 of file Orthpoly.hh. |
|
Definition at line 42 of file Orthpoly.hh. |
|
Definition at line 43 of file Orthpoly.hh. |
|
Definition at line 43 of file Orthpoly.hh. |
|
Definition at line 44 of file Orthpoly.hh. |
|
Definition at line 45 of file Orthpoly.hh. |
|
Definition at line 46 of file Orthpoly.hh. |
|
Definition at line 46 of file Orthpoly.hh. |
|
Definition at line 46 of file Orthpoly.hh. |
|
Definition at line 46 of file Orthpoly.hh. |
|
Definition at line 46 of file Orthpoly.hh. |
|
Definition at line 46 of file Orthpoly.hh. |
|
Definition at line 49 of file Orthpoly.hh. |
|
Definition at line 50 of file Orthpoly.hh. |
|
Definition at line 50 of file Orthpoly.hh. |
|
Definition at line 51 of file Orthpoly.hh. |
|
Definition at line 52 of file Orthpoly.hh. |