Changeset 271 for doc/latex/arx.tex

Show
Ignore:
Timestamp:
02/16/09 10:03:13 (16 years ago)
Author:
smidl
Message:

Next major revision

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • doc/latex/arx.tex

    r261 r271  
    1 Here, we use the {\tt ARX} class to estimate parameters and structure. ARX model is defined as follows: \[ y_t = \theta' \psi_t + \rho e_t \] where $y_t$ is the system output, $[\theta,\rho]$ is vector of unknown parameters, $\psi_t$ is an vector of data-dependent regressors, and noise $e_t$ is assumed to be Normal distributed $\mathcal{N}(0,1)$. 
     1\hypertarget{arx_ui}{}\subsection{Running experiment $\backslash$c estimator with ARX data fields}\label{arx_ui} 
     2The experiment estimator::cpp can be run either on command line, or as a mex file in Matlab.\hypertarget{arx_ui_cmd}{}\section{Command-line usage}\label{arx_ui_cmd} 
     3In order to use it for estimation of an ARX model, we can define the following \hyperlink{ui}{User Infos and their use} structure:  
    24 
    3 Special cases include:...\hypertarget{arx_math}{}\section{Mathematical background:}\label{arx_math} 
    4 This particular model belongs to the exponential family, hence it has conjugate distribution of the Gauss-inverse-Wishart form (class egiw). See, \mbox{[}reference\mbox{]} for details. 
     5\begin{DocInclude}\begin{verbatim}//Data generating system 
     6system = { 
     7        type = "ArxDS"; 
     8        y = {type="rv"; names=["y", "u"];}; 
     9        u = {type="rv"; names=[]; }; 
     10        rgr = {type="rv"; 
     11                names = ["y","y","y","u"]; 
     12                times = [-1, -2, -3, -1]; 
     13        }; 
     14        //AR parameters 
     15        theta = [0.8, -0.3, 0.4, 1.0, 
     16                 0.0, 0.0, 0.0, 0.0]; 
     17        // offset 
     18        offset = [0.0, 0.0]; 
     19        //variance 
     20        r = [0.1, 0.0, 
     21             0.0, 1.0]; 
     22        // log also theta 
     23        opt="L_theta"; 
     24}; 
    525 
    6 For this model, structure estimation is a form of model selection procedure. Specifically, we compare hypotheses that the data were generated by the full model with hypotheses that some regressors in vector $\psi$ are redundant. The number of possible hypotheses is then the number of all possible combinations of all regressors.\hypertarget{arx_soft}{}\section{Software implementation:}\label{arx_soft} 
    7 Estimation with this class of model is perfromed by class ARX which is derived from class BMEF (estimation of exponential family). The posterior density ( ARX::\_\-epdf() ) is class egiw, which represents Gauss-inverse-Wishart density. 
     26//store results 
     27logger = { 
     28        type= "dirfilelog"; 
     29        dirname = "exp/arx_ui"; 
     30        maxlen = 1000; // 
     31}; 
    832 
    9 Structure estimation is implemented in method ARX::structure\_\-est() which uses brute force tree search approach.\hypertarget{arx_exa}{}\section{Examples of Use:}\label{arx_exa} 
    10 There are many ways how to use the object.\begin{itemize} 
    11 \item Pure C++, as it is used in unit testing of the class arx, \hyperlink{arx__test_8cpp}{arx\_\-test.cpp}\item C++ application with UI configuration file, arx\_\-test\_\-ui\item Matlab interface, arx\_\-matlab \end{itemize} 
     33//estimation 
     34estimator = { 
     35        type = "ARXest"; 
     36        y = {type="rv"; names=["y"]; }; 
     37        rgr = {type="rv"; 
     38                names = ["y","y","y","u"]; 
     39                times = [-1, -2, -3, -1]; 
     40        }; 
     41 
     42        //optional fields 
     43        dV0 = [1e-3, 1e-5, 1e-5, 1e-5, 1e-5]; //default: 1e-3 for y, 1e-5 for rgr 
     44        nu0 = 8.;      //default: rgrlen + 2 
     45        frg = 1.0;    // forgetting, default frg=1.0 
     46}; 
     47 
     48//experiment description 
     49experiment:{ 
     50        ndat = 9000; 
     51}; 
     52\end{verbatim} 
     53\end{DocInclude} 
     54 \hypertarget{arx_ui}{}\subsection{Running experiment $\backslash$c estimator with ARX data fields}\label{arx_ui} 
     55The experiment estimator::cpp can be run either on command line, or as a mex file in Matlab.\hypertarget{arx_ui_cmd}{}\section{Command-line usage}\label{arx_ui_cmd} 
     56In order to use it for estimation of an ARX model, we can define the following \hyperlink{ui}{User Infos and their use} structure:  
     57 
     58\begin{DocInclude}\begin{verbatim}//Data generating system 
     59system = { 
     60        type = "ArxDS"; 
     61        y = {type="rv"; names=["y", "u"];}; 
     62        u = {type="rv"; names=[]; }; 
     63        rgr = {type="rv"; 
     64                names = ["y","y","y","u"]; 
     65                times = [-1, -2, -3, -1]; 
     66        }; 
     67        //AR parameters 
     68        theta = [0.8, -0.3, 0.4, 1.0, 
     69                 0.0, 0.0, 0.0, 0.0]; 
     70        // offset 
     71        offset = [0.0, 0.0]; 
     72        //variance 
     73        r = [0.1, 0.0, 
     74             0.0, 1.0]; 
     75        // log also theta 
     76        opt="L_theta"; 
     77}; 
     78 
     79//store results 
     80logger = { 
     81        type= "dirfilelog"; 
     82        dirname = "exp/arx_ui"; 
     83        maxlen = 1000; // 
     84}; 
     85 
     86//estimation 
     87estimator = { 
     88        type = "ARXest"; 
     89        y = {type="rv"; names=["y"]; }; 
     90        rgr = {type="rv"; 
     91                names = ["y","y","y","u"]; 
     92                times = [-1, -2, -3, -1]; 
     93        }; 
     94 
     95        //optional fields 
     96        dV0 = [1e-3, 1e-5, 1e-5, 1e-5, 1e-5]; //default: 1e-3 for y, 1e-5 for rgr 
     97        nu0 = 8.;      //default: rgrlen + 2 
     98        frg = 1.0;    // forgetting, default frg=1.0 
     99}; 
     100 
     101//experiment description 
     102experiment:{ 
     103        ndat = 9000; 
     104}; 
     105\end{verbatim} 
     106\end{DocInclude} 
     107