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

Paramest.hh

Go to the documentation of this file.
00001 #ifndef PARAMEST_HEADER
00002 #define PARAMEST_HEADER
00003 
00004 // ==== HEADER Paramest.hh ====
00005 
00011 // 5-Feb-1999, Andras Aszodi
00012 
00013 // ---- STANDARD HEADERS ----
00014 
00015 #include <stdlib.h>
00016 #include <float.h>
00017 #include <math.h>
00018 
00019 #ifdef _STANDARD_C_PLUS_PLUS
00020 #include <iostream>
00021 #include <iomanip>
00022 using namespace std;
00023 #else
00024 #include <iostream.h>
00025 #include <iomanip.h>
00026 #endif
00027 
00028 // ---- MODULE HEADERS ----
00029 
00030 #include "Vector.hh"
00031 #include "Rectmat.hh"
00032 #include "Symmat.hh"
00033 
00034 // ==== CLASSES ====
00035 
00036 namespace RazorBack {
00037 
00039 class Paramest_
00040 {
00041     // symbolic consts
00042     public:
00043     
00045     typedef enum {EQUAL, RELATIVE, USER} Weighting_;
00046     
00047     // data
00048     protected:
00049             
00050     size_t Nm, Np, Nf; 
00051     Smatdbl_ Xtx;    
00052     Vecdbl_ Xty;    
00053     Vecdbl_ Norm;   
00054     Weighting_ Weighting;   
00055     Vecdbl_ P, Sdev;    
00056     Smatdbl_ Correl;    
00057     
00058     // methods
00059     public:
00060             
00062     Paramest_(): 
00063             Nm(0), Np(0), Nf(0), Weighting(EQUAL) {}
00064     
00069     Paramest_(size_t NM, size_t NP):
00070             Nm(NM), Np(NP), Weighting(EQUAL)
00071             { resize(); }
00072     
00074     void weight(Weighting_ W) { Weighting=W; }
00075     
00077     const Vecdbl_& param() const { return P; }
00078     
00080     const Vecdbl_& sdev() const { return Sdev; }
00081     
00083     const Smatdbl_& correl() const { return Correl; }
00084     
00090     float tcrit_95() const;
00091     
00092     // hidden methods
00093     protected:
00094             
00095     void resize()
00096     {
00097         Xtx.size(Np); Xty.dim(Np); Norm.dim(Np);
00098         P.dim(Np); Sdev.dim(Np); Correl.size(Np);
00099     }
00100     double normalise();
00101     double solve(Vecdbl_& Sol, double Lambda0, double Lambdafact);
00102     static bool posdef_inv(Smatdbl_& A);
00103     void sdev_correl(double Q);
00104 };
00105 // END OF CLASS Paramest_
00106 
00107 } // RazorBack
00108 
00109 // ==== END OF HEADER Paramest.hh ====
00110 
00111 #endif      // PARAMEST_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