1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>mixpp: arx_ui.h Source File</title> |
---|
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.6 --> |
---|
8 | <div class="navigation" id="top"> |
---|
9 | <div class="tabs"> |
---|
10 | <ul> |
---|
11 | <li><a href="index.html"><span>Main Page</span></a></li> |
---|
12 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
13 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
14 | <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
---|
15 | <li><a href="classes.html"><span>Classes</span></a></li> |
---|
16 | <li class="current"><a href="files.html"><span>Files</span></a></li> |
---|
17 | </ul> |
---|
18 | </div> |
---|
19 | <h1>arx_ui.h</h1><a href="arx__ui_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 |
---|
20 | <a name="l00013"></a>00013 <span class="preprocessor">#ifndef ARX_UI_H</span> |
---|
21 | <a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define ARX_UI_H</span> |
---|
22 | <a name="l00015"></a>00015 <span class="preprocessor"></span> |
---|
23 | <a name="l00016"></a>00016 |
---|
24 | <a name="l00017"></a>00017 <span class="preprocessor">#include "<a class="code" href="arx_8h.html" title="Bayesian Filtering for generalized autoregressive (ARX) model.">arx.h</a>"</span> |
---|
25 | <a name="l00018"></a>00018 <span class="preprocessor">#include "<a class="code" href="loggers__ui_8h.html" title="UI builders for Loggers.">stat/loggers_ui.h</a>"</span> |
---|
26 | <a name="l00019"></a>00019 |
---|
27 | <a name="l00038"></a><a class="code" href="classUIARX.html">00038</a> <span class="keyword">class </span><a class="code" href="classUIARX.html">UIARX</a> : <span class="keyword">public</span> <a class="code" href="classbdm_1_1UIbuilder.html" title="Builds computational object from a UserInfo structure.">UIbuilder</a> { |
---|
28 | <a name="l00039"></a>00039 <span class="keyword">public</span>: |
---|
29 | <a name="l00040"></a>00040 <a class="code" href="classUIARX.html">UIARX</a>() :<a class="code" href="classbdm_1_1UIbuilder.html#c75103dd58395644e80f1eea886c656b" title="Constructor needs to be run only once macro UIREGISTER.">UIbuilder</a> ( <span class="stringliteral">"ARXest"</span> ) {}; |
---|
30 | <a name="l00041"></a><a class="code" href="classUIARX.html#e9ef8d41d8f10a31343d76a73b9f0f77">00041</a> <a class="code" href="classbdm_1_1bdmroot.html" title="Root class of BDM objects.">bdmroot</a>* <a class="code" href="classUIARX.html#e9ef8d41d8f10a31343d76a73b9f0f77" title="Function building the computational object.">build</a> ( Setting &S )<span class="keyword"> const </span>{ |
---|
31 | <a name="l00042"></a>00042 <span class="keywordtype">int</span> ylen = S[<span class="stringliteral">"ychns"</span>].getLength(); |
---|
32 | <a name="l00043"></a>00043 <span class="keywordtype">int</span> rgrlen = S[<span class="stringliteral">"rgrid"</span>].getLength(); |
---|
33 | <a name="l00044"></a>00044 <span class="comment">// create rvs</span> |
---|
34 | <a name="l00045"></a>00045 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> yrv; |
---|
35 | <a name="l00046"></a>00046 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> rrv; |
---|
36 | <a name="l00047"></a>00047 <span class="keywordtype">int</span> i; |
---|
37 | <a name="l00048"></a>00048 <span class="keywordflow">for</span> ( i=0;i<ylen; i++ ) {yrv.<a class="code" href="classbdm_1_1RV.html#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> ( <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> ( <span class="stringliteral">"y"</span>+num2str(i),i+1 ));} |
---|
38 | <a name="l00049"></a>00049 <span class="comment">//build regressor</span> |
---|
39 | <a name="l00050"></a>00050 Setting& ids=S[<span class="stringliteral">"rgrid"</span>]; |
---|
40 | <a name="l00051"></a>00051 Setting& del=S[<span class="stringliteral">"delays"</span>]; |
---|
41 | <a name="l00052"></a>00052 |
---|
42 | <a name="l00053"></a>00053 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i=0;i<ids.getLength(); i++ ) { |
---|
43 | <a name="l00054"></a>00054 rrv.<a class="code" href="classbdm_1_1RV.html#87841b5ee43997b79789c0c22047e224" title="Add (concat) another variable to the current one,.">add</a> (<a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a>(<span class="stringliteral">"rgr"</span>,ids[i],1,del[i])); |
---|
44 | <a name="l00055"></a>00055 } |
---|
45 | <a name="l00056"></a>00056 |
---|
46 | <a name="l00057"></a>00057 <span class="comment">//init</span> |
---|
47 | <a name="l00058"></a>00058 mat V0; |
---|
48 | <a name="l00059"></a>00059 <span class="keywordflow">if</span> ( S.exists ( <span class="stringliteral">"dV0"</span> ) ) { |
---|
49 | <a name="l00060"></a>00060 V0=diag ( getvec(S[<span class="stringliteral">"dV0"</span>]) ); |
---|
50 | <a name="l00061"></a>00061 } |
---|
51 | <a name="l00062"></a>00062 <span class="keywordflow">else</span> { |
---|
52 | <a name="l00063"></a>00063 V0=<a class="code" href="namespacebdm.html#b9016687c0e874ca5cdcf75ae28811aa" title="Concat two random variables.">concat</a> ( 1e-3*ones ( ylen ), 1e-5*ones ( rgrlen ) ); |
---|
53 | <a name="l00064"></a>00064 } |
---|
54 | <a name="l00065"></a>00065 <span class="keywordtype">double</span> nu0; |
---|
55 | <a name="l00066"></a>00066 <span class="keywordflow">if</span> ( S.exists ( <span class="stringliteral">"nu0"</span> ) ) { |
---|
56 | <a name="l00067"></a>00067 nu0=double(S[<span class="stringliteral">"nu0"</span>]); |
---|
57 | <a name="l00068"></a>00068 } |
---|
58 | <a name="l00069"></a>00069 <span class="keywordflow">else</span> { |
---|
59 | <a name="l00070"></a>00070 nu0 = rgrlen+ylen+2; |
---|
60 | <a name="l00071"></a>00071 } |
---|
61 | <a name="l00072"></a>00072 <span class="keywordtype">double</span> frg; |
---|
62 | <a name="l00073"></a>00073 <span class="keywordflow">if</span> ( S.exists ( <span class="stringliteral">"frg"</span> ) ) { |
---|
63 | <a name="l00074"></a>00074 frg = S[<span class="stringliteral">"frg"</span>]; |
---|
64 | <a name="l00075"></a>00075 } |
---|
65 | <a name="l00076"></a>00076 <span class="keywordflow">else</span> { |
---|
66 | <a name="l00077"></a>00077 frg = 1.0; |
---|
67 | <a name="l00078"></a>00078 } |
---|
68 | <a name="l00079"></a>00079 <a class="code" href="classbdm_1_1RV.html" title="Class representing variables, most often random variables.">RV</a> thr(<span class="stringliteral">"{theta r }"</span>, vec_2(rgrlen*ylen, ylen*ylen)); |
---|
69 | <a name="l00080"></a>00080 <a class="code" href="classbdm_1_1ARX.html" title="Linear Autoregressive model with Gaussian noise.">ARX</a>* A=<span class="keyword">new</span> <a class="code" href="classbdm_1_1ARX.html" title="Linear Autoregressive model with Gaussian noise.">ARX</a> (thr, V0, nu0, frg); |
---|
70 | <a name="l00081"></a>00081 A-><a class="code" href="classbdm_1_1BM.html#f135ae6dce7e9f30c9f88229c7930b96">set_drv</a>(<a class="code" href="namespacebdm.html#b9016687c0e874ca5cdcf75ae28811aa" title="Concat two random variables.">concat</a>(yrv,rrv)); |
---|
71 | <a name="l00082"></a>00082 |
---|
72 | <a name="l00083"></a>00083 <span class="keywordflow">return</span> A; |
---|
73 | <a name="l00084"></a>00084 }; |
---|
74 | <a name="l00085"></a>00085 }; |
---|
75 | <a name="l00086"></a>00086 |
---|
76 | <a name="l00087"></a>00087 UIREGISTER ( <a class="code" href="classUIARX.html">UIARX</a> ); |
---|
77 | <a name="l00088"></a>00088 |
---|
78 | <a name="l00089"></a>00089 <span class="preprocessor">#endif // DS_UI_H</span> |
---|
79 | </pre></div></div> |
---|
80 | <hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 11 23:33:54 2009 for mixpp by |
---|
81 | <a href="http://www.doxygen.org/index.html"> |
---|
82 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> |
---|
83 | </body> |
---|
84 | </html> |
---|