Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

RazorBack::Linls_ Class Reference

Linls_: Class for carrying out linear least-squares using the SVD. More...

#include <Linls.hh>

List of all members.

Public Methods

 Linls_ (size_t NM=0, size_t NP=0)
 Init to empty.

double lin_reg (const Rmatdbl_ &Xmeas, const Vecdbl_ &Ymeas, double Eps=1e-10)
 lin_reg(Xmeas, Ymeas, Eps): Carries out a linear least squares fit using SVD. More...

size_t rank () const
 Returns the rank.

double condition () const
 Returns the condition number.

size_t deg_freedom () const
 Returns the degrees of freedom.

const Vecdbl_& param () const
 Returns the parameter estimate.

const Vecdbl_& sdev () const
 Returns the standard deviation of the parameters.

const Smatdbl_& correl () const
 Returns the correlation matrix of the parameters.

double chi_square () const
 Returns the chi-square statistic for the fit quality.

double residual_dev () const
 Returns the residual deviation for the fit.


Protected Methods

void adjust_dimensions (const Rmatdbl_ &Xmeas, const Vecdbl_ &Ymeas)
void make_utb (const Vecdbl_ &B)
size_t calc_rank (const Vecdbl_ &B, double Eps) const
void calc_params (const Rmatdbl_ &Xmeas, const Vecdbl_ &Ymeas)
double calc_chi2 (const Rmatdbl_ &Xmeas, const Vecdbl_ &Ymeas) const

Private Attributes

size_t Nm
size_t Np
size_t Nf
 no. of measurements, no.of params, degrees of freedom.

Svd_ Svd
 an SVD object.

size_t Rank
 the rank estimate.

Vecdbl_ Utb
 scalprods of U cols w/ RHS.

Vecdbl_ P
Vecdbl_ Sdev
 parameter values and standard deviations.

Smatdbl_ Correl
 parameter correlation matrix.

double Chi2
 chi-square.


Detailed Description

Linls_: Class for carrying out linear least-squares using the SVD.

Note that unlike Linreg_, this class is not derived from Paramest_.

Definition at line 35 of file Linls.hh.


Constructor & Destructor Documentation

RazorBack::Linls_::Linls_ ( size_t NM = 0,
size_t NP = 0 ) [inline, explicit]
 

Init to empty.

Definition at line 52 of file Linls.hh.


Member Function Documentation

double RazorBack::Linls_::lin_reg ( const Rmatdbl_ & Xmeas,
const Vecdbl_ & Ymeas,
double Eps = 1e-10 )
 

lin_reg(Xmeas, Ymeas, Eps): Carries out a linear least squares fit using SVD.

Xmeas is the data matrix (Nm rows of observations for Np indep. vars, Nm>Np), Ymeas is the Nm observations of the dependent variable. Eps is a small tolerance value used for finding the best SVD rank. Should be a "small multiple of the machine zero". If in doubt, set it to 0.0 and it will be figured out for you. Return value: the chi-square statistics of the fit, or a negative value on error.

size_t RazorBack::Linls_::rank ( ) const [inline]
 

Returns the rank.

Definition at line 70 of file Linls.hh.

Referenced by condition().

double RazorBack::Linls_::condition ( ) const [inline]
 

Returns the condition number.

Definition at line 73 of file Linls.hh.

size_t RazorBack::Linls_::deg_freedom ( ) const [inline]
 

Returns the degrees of freedom.

Definition at line 76 of file Linls.hh.

const Vecdbl_ & RazorBack::Linls_::param ( ) const [inline]
 

Returns the parameter estimate.

Definition at line 79 of file Linls.hh.

const Vecdbl_ & RazorBack::Linls_::sdev ( ) const [inline]
 

Returns the standard deviation of the parameters.

Definition at line 82 of file Linls.hh.

const Smatdbl_ & RazorBack::Linls_::correl ( ) const [inline]
 

Returns the correlation matrix of the parameters.

Definition at line 85 of file Linls.hh.

double RazorBack::Linls_::chi_square ( ) const [inline]
 

Returns the chi-square statistic for the fit quality.

Definition at line 88 of file Linls.hh.

double RazorBack::Linls_::residual_dev ( ) const [inline]
 

Returns the residual deviation for the fit.

Definition at line 91 of file Linls.hh.

void RazorBack::Linls_::adjust_dimensions ( const Rmatdbl_ & Xmeas,
const Vecdbl_ & Ymeas ) [protected]
 

void RazorBack::Linls_::make_utb ( const Vecdbl_ & B ) [protected]
 

size_t RazorBack::Linls_::calc_rank ( const Vecdbl_ & B,
double Eps ) const [protected]
 

void RazorBack::Linls_::calc_params ( const Rmatdbl_ & Xmeas,
const Vecdbl_ & Ymeas ) [protected]
 

double RazorBack::Linls_::calc_chi2 ( const Rmatdbl_ & Xmeas,
const Vecdbl_ & Ymeas ) const [protected]
 


Member Data Documentation

size_t RazorBack::Linls_::Nm [private]
 

Definition at line 40 of file Linls.hh.

size_t RazorBack::Linls_::Np [private]
 

Definition at line 40 of file Linls.hh.

size_t RazorBack::Linls_::Nf [private]
 

no. of measurements, no.of params, degrees of freedom.

Definition at line 40 of file Linls.hh.

Svd_ RazorBack::Linls_::Svd [private]
 

an SVD object.

Definition at line 41 of file Linls.hh.

size_t RazorBack::Linls_::Rank [private]
 

the rank estimate.

Definition at line 42 of file Linls.hh.

Vecdbl_ RazorBack::Linls_::Utb [private]
 

scalprods of U cols w/ RHS.

Definition at line 43 of file Linls.hh.

Vecdbl_ RazorBack::Linls_::P [private]
 

Definition at line 44 of file Linls.hh.

Vecdbl_ RazorBack::Linls_::Sdev [private]
 

parameter values and standard deviations.

Definition at line 44 of file Linls.hh.

Smatdbl_ RazorBack::Linls_::Correl [private]
 

parameter correlation matrix.

Definition at line 45 of file Linls.hh.

double RazorBack::Linls_::Chi2 [private]
 

chi-square.

Definition at line 46 of file Linls.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:17 2002 for The Razorback C++ Library: Statistics by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001