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

Nonlinreg.hh

Go to the documentation of this file.
00001 #ifndef NONLINREG_HEADER
00002 #define NONLINREG_HEADER
00003 
00004 // ==== HEADER Nonlinreg.hh ====
00005 
00011 // 19-Feb-2001, Andras Aszodi
00012 
00013 // ---- MODULE HEADERS ----
00014 
00015 #include "Paramest.hh"
00016 #include "Rangedimexc.hh"
00017 #include "Statexc.hh"
00018 
00019 // ==== CLASSES ====
00020 
00021 namespace RazorBack {
00022 
00033 class Nonlinfunc_
00034 {
00035     // data
00036     private:
00037             
00038     size_t Nx, Np, Ny;  
00039     
00040     // methods
00041     public:
00042             
00048     Nonlinfunc_(size_t NX, size_t NP, size_t NY):
00049             Nx(NX), Np(NP), Ny(NY) {}
00050     
00052     size_t nx() const { return Nx; }
00053     
00055     size_t np() const { return Np; }
00056     
00058     size_t ny() const { return Ny; }
00059     
00066     virtual int f(const Vecdbl_& X, const Vecdbl_& P, Vecdbl_& Y) =0;
00067     
00076     int jac(const Vecdbl_& X, const Vecdbl_& P, Vecdbl_& Y, Rmatdbl_& J);
00077 
00078 };
00079 // END OF CLASS Nonlinfunc_
00080 
00085 class Nonlinreg_: public Paramest_
00086 {
00087     // symbolic consts
00088     public:
00089             
00091     typedef enum {SILENT, TERSE, VERBOSE} Verbosity_;
00092     
00093     // data
00094     protected:
00095             
00096     size_t Nx, Ny;  
00097     Rmatdbl_ W;     
00098     Verbosity_ Verb;    
00099     
00100     // methods
00101     public:
00102             
00107     Nonlinreg_(size_t NX, size_t NY, size_t NP, size_t NM):
00108             Paramest_(NM, NP), Nx(NX), Ny(NY), Verb(SILENT) {}
00109     
00111     void report_level(Verbosity_ V) { Verb=V; }
00112     
00132     double nonlin_reg(const Rmatdbl_& Xmeas, const Rmatdbl_& Ymeas, const Rmatdbl_& Userwgt,
00133         const Vecdbl_& Initpar, Nonlinfunc_& Funcobj, int& Itmax, double Steplim=1e-6);
00134     double nonlin_reg(const Rmatdbl_& Xmeas, const Rmatdbl_& Ymeas,
00135         const Vecdbl_& Initpar, Nonlinfunc_& Funcobj, int& Itmax, double Steplim=1e-6);
00136     
00137     // hidden methods
00138     protected:
00139             
00140     void adjust_dimensions(const Rmatdbl_& Xmeas, const Rmatdbl_& Ymeas,
00141         const Rmatdbl_& Userwgt, const Vecdbl_& Initpar, const Nonlinfunc_& Funcobj);
00142     void setup_weight(const Rmatdbl_& YW);
00143     double quality(const Rmatdbl_& Xmeas, const Rmatdbl_& Ymeas,
00144         const Vecdbl_& Par, Nonlinfunc_& Funcobj) const;
00145     void report(ostream& Out, int Itno, double Q, double Lambda,
00146             const Vecdbl_& Par) const;
00147     
00148 };
00149 // END OF CLASS Nonlinreg_
00150 
00151 } // RazorBack
00152 
00153 // ==== END OF HEADER Nonlinreg.hh ====
00154 
00155 #endif      // NONLINREG_HEADER

Generated at Wed Aug 21 09:33:12 2002 for The Razorback C++ Library: Statistics by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001