1 | \hypertarget{classbdm_1_1ARX}{ |
---|
2 | \section{bdm::ARX Class Reference} |
---|
3 | \label{classbdm_1_1ARX}\index{bdm::ARX@{bdm::ARX}} |
---|
4 | } |
---|
5 | {\tt \#include $<$arx.h$>$} |
---|
6 | |
---|
7 | Inheritance diagram for bdm::ARX:\nopagebreak |
---|
8 | \begin{figure}[H] |
---|
9 | \begin{center} |
---|
10 | \leavevmode |
---|
11 | \includegraphics[width=64pt]{classbdm_1_1ARX__inherit__graph} |
---|
12 | \end{center} |
---|
13 | \end{figure} |
---|
14 | |
---|
15 | |
---|
16 | \subsection{Detailed Description} |
---|
17 | Linear Autoregressive model with Gaussian noise. |
---|
18 | |
---|
19 | Regression of the following kind: \[ y_t = \theta_1 \psi_1 + \theta_2 + \psi_2 +\ldots + \theta_n \psi_n + r e_t \] where unknown parameters {\tt rv} are $[\theta r]$, regression vector $\psi=\psi(y_{1:t},u_{1:t})$ is a known function of past outputs and exogeneous variables $u_t$. Distrubances $e_t$ are supposed to be normally distributed: \[ e_t \sim \mathcal{N}(0,1). \] |
---|
20 | |
---|
21 | Extension for time-variant parameters $\theta_t,r_t$ may be achived using exponential forgetting (Kulhavy and Zarrop, 1993). In such a case, the forgetting factor {\tt frg} $\in <0,1>$ should be given in the constructor. Time-invariant parameters are estimated for {\tt frg} = 1. \subsection*{Public Member Functions} |
---|
22 | \begin{CompactItemize} |
---|
23 | \item |
---|
24 | \hypertarget{classbdm_1_1ARX_43ed6114f04a3a8756fe2b42eaa35f98}{ |
---|
25 | \hyperlink{classbdm_1_1ARX_43ed6114f04a3a8756fe2b42eaa35f98}{ARX} (const double frg0=1.0)} |
---|
26 | \label{classbdm_1_1ARX_43ed6114f04a3a8756fe2b42eaa35f98} |
---|
27 | |
---|
28 | \begin{CompactList}\small\item\em Full constructor. \item\end{CompactList}\item |
---|
29 | \hypertarget{classbdm_1_1ARX_73a55a3d66bfbeeee4df6c2ae40920ed}{ |
---|
30 | \hyperlink{classbdm_1_1ARX_73a55a3d66bfbeeee4df6c2ae40920ed}{ARX} (const \hyperlink{classbdm_1_1ARX}{ARX} \&A0)} |
---|
31 | \label{classbdm_1_1ARX_73a55a3d66bfbeeee4df6c2ae40920ed} |
---|
32 | |
---|
33 | \begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item |
---|
34 | \hypertarget{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61}{ |
---|
35 | \hyperlink{classbdm_1_1ARX}{ARX} $\ast$ \hyperlink{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61}{\_\-copy\_\-} ()} |
---|
36 | \label{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61} |
---|
37 | |
---|
38 | \begin{CompactList}\small\item\em Auxiliary function. \item\end{CompactList}\item |
---|
39 | \hypertarget{classbdm_1_1ARX_cab0a1de5355b1027d24fd3d4862c9b0}{ |
---|
40 | void \hyperlink{classbdm_1_1ARX_cab0a1de5355b1027d24fd3d4862c9b0}{set\_\-parameters} (const \hyperlink{classldmat}{ldmat} \&V0, const double \&nu0)} |
---|
41 | \label{classbdm_1_1ARX_cab0a1de5355b1027d24fd3d4862c9b0} |
---|
42 | |
---|
43 | \begin{CompactList}\small\item\em Set sufficient statistics. \item\end{CompactList}\item |
---|
44 | \hypertarget{classbdm_1_1ARX_539f9d0127423c94b912708d390e67b8}{ |
---|
45 | void \hyperlink{classbdm_1_1ARX_539f9d0127423c94b912708d390e67b8}{set\_\-statistics} (const \hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$BM0)} |
---|
46 | \label{classbdm_1_1ARX_539f9d0127423c94b912708d390e67b8} |
---|
47 | |
---|
48 | \begin{CompactList}\small\item\em get statistics from another model \item\end{CompactList}\item |
---|
49 | \hypertarget{classbdm_1_1ARX_1974409e022ea1efb3404b5c2fde66ad}{ |
---|
50 | void \hyperlink{classbdm_1_1ARX_1974409e022ea1efb3404b5c2fde66ad}{get\_\-parameters} (mat \&V0, double \&nu0)} |
---|
51 | \label{classbdm_1_1ARX_1974409e022ea1efb3404b5c2fde66ad} |
---|
52 | |
---|
53 | \begin{CompactList}\small\item\em Returns sufficient statistics. \item\end{CompactList}\item |
---|
54 | \hypertarget{classbdm_1_1ARX_17e7fe14654ab3c449846c3f43e66169}{ |
---|
55 | void \hyperlink{classbdm_1_1ARX_17e7fe14654ab3c449846c3f43e66169}{bayes} (const vec \&dt, const double w)} |
---|
56 | \label{classbdm_1_1ARX_17e7fe14654ab3c449846c3f43e66169} |
---|
57 | |
---|
58 | \begin{CompactList}\small\item\em Here $dt = [y_t psi_t] $. \item\end{CompactList}\item |
---|
59 | void \hyperlink{classbdm_1_1ARX_8bdf2974052e8ce74eb0d4f3791c58a3}{bayes} (const vec \&dt) |
---|
60 | \begin{CompactList}\small\item\em Incremental Bayes rule. \item\end{CompactList}\item |
---|
61 | \hypertarget{classbdm_1_1ARX_16797df43f85f1ddbe9d64fd6d82c25d}{ |
---|
62 | const \hyperlink{classbdm_1_1epdf}{epdf} \& \textbf{\_\-epdf} () const } |
---|
63 | \label{classbdm_1_1ARX_16797df43f85f1ddbe9d64fd6d82c25d} |
---|
64 | |
---|
65 | \item |
---|
66 | double \hyperlink{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4}{logpred} (const vec \&dt) const |
---|
67 | \item |
---|
68 | \hypertarget{classbdm_1_1ARX_e86ab499b116b837d3163ec852961eca}{ |
---|
69 | void \hyperlink{classbdm_1_1ARX_e86ab499b116b837d3163ec852961eca}{flatten} (const \hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$B)} |
---|
70 | \label{classbdm_1_1ARX_e86ab499b116b837d3163ec852961eca} |
---|
71 | |
---|
72 | \begin{CompactList}\small\item\em Flatten the posterior according to the given \hyperlink{classbdm_1_1BMEF}{BMEF} (of the same type!). \item\end{CompactList}\item |
---|
73 | \hypertarget{classbdm_1_1ARX_749827323c034f11bec61b6e2fc3d42a}{ |
---|
74 | \hyperlink{classbdm_1_1enorm}{enorm}$<$ \hyperlink{classldmat}{ldmat} $>$ $\ast$ \hyperlink{classbdm_1_1ARX_749827323c034f11bec61b6e2fc3d42a}{epredictor} (const vec \&rgr) const } |
---|
75 | \label{classbdm_1_1ARX_749827323c034f11bec61b6e2fc3d42a} |
---|
76 | |
---|
77 | \begin{CompactList}\small\item\em Conditioned version of the predictor. \item\end{CompactList}\item |
---|
78 | \hypertarget{classbdm_1_1ARX_4cdf5e2a7d3480ec31f6247ed4289b15}{ |
---|
79 | \hyperlink{classbdm_1_1enorm}{enorm}$<$ \hyperlink{classldmat}{ldmat} $>$ $\ast$ \hyperlink{classbdm_1_1ARX_4cdf5e2a7d3480ec31f6247ed4289b15}{epredictor} () const } |
---|
80 | \label{classbdm_1_1ARX_4cdf5e2a7d3480ec31f6247ed4289b15} |
---|
81 | |
---|
82 | \begin{CompactList}\small\item\em Constructs a predictive density $ f(d_{t+1} |d_{t}, \ldots d_{0}) $. \item\end{CompactList}\item |
---|
83 | \hyperlink{classbdm_1_1mlnorm}{mlnorm}$<$ \hyperlink{classldmat}{ldmat} $>$ $\ast$ \hyperlink{classbdm_1_1ARX_74fe8ae2d88bee8639510fd0eaf73513}{predictor} () const |
---|
84 | \begin{CompactList}\small\item\em conditional version of the predictor \item\end{CompactList}\item |
---|
85 | \hypertarget{classbdm_1_1ARX_c6a2428a46407fe45b4c7a99069c0801}{ |
---|
86 | \hyperlink{classbdm_1_1mlstudent}{mlstudent} $\ast$ \textbf{predictor\_\-student} () const } |
---|
87 | \label{classbdm_1_1ARX_c6a2428a46407fe45b4c7a99069c0801} |
---|
88 | |
---|
89 | \item |
---|
90 | ivec \hyperlink{classbdm_1_1ARX_16b02ae03316751664c22d59d90c1e34}{structure\_\-est} (\hyperlink{classbdm_1_1egiw}{egiw} Eg0) |
---|
91 | \begin{CompactList}\small\item\em Brute force structure estimation. \item\end{CompactList}\item |
---|
92 | \hypertarget{classbdm_1_1ARX_ab2c55205a324e9d698fbd8ac229ad4f}{ |
---|
93 | const \hyperlink{classbdm_1_1egiw}{egiw} $\ast$ \textbf{\_\-e} () const } |
---|
94 | \label{classbdm_1_1ARX_ab2c55205a324e9d698fbd8ac229ad4f} |
---|
95 | |
---|
96 | \item |
---|
97 | \hypertarget{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6}{ |
---|
98 | \hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$ \hyperlink{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6}{\_\-copy\_\-} (bool changerv=false)} |
---|
99 | \label{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6} |
---|
100 | |
---|
101 | \begin{CompactList}\small\item\em Flatten the posterior as if to keep nu0 data. \item\end{CompactList}\end{CompactItemize} |
---|
102 | \begin{Indent}{\bf Mathematical operations}\par |
---|
103 | \begin{CompactItemize} |
---|
104 | \item |
---|
105 | \hypertarget{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{ |
---|
106 | virtual void \hyperlink{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{bayesB} (const mat \&Dt)} |
---|
107 | \label{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc} |
---|
108 | |
---|
109 | \begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item |
---|
110 | \hypertarget{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{ |
---|
111 | vec \hyperlink{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{logpred\_\-m} (const mat \&dt) const } |
---|
112 | \label{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae} |
---|
113 | |
---|
114 | \begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\end{CompactItemize} |
---|
115 | \end{Indent} |
---|
116 | \begin{Indent}{\bf Access to attributes}\par |
---|
117 | \begin{CompactItemize} |
---|
118 | \item |
---|
119 | \hypertarget{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{ |
---|
120 | const \hyperlink{classbdm_1_1RV}{RV} \& \textbf{\_\-drv} () const } |
---|
121 | \label{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c} |
---|
122 | |
---|
123 | \item |
---|
124 | \hypertarget{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{ |
---|
125 | void \textbf{set\_\-drv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv)} |
---|
126 | \label{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96} |
---|
127 | |
---|
128 | \item |
---|
129 | \hypertarget{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{ |
---|
130 | double \textbf{\_\-ll} () const } |
---|
131 | \label{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70} |
---|
132 | |
---|
133 | \item |
---|
134 | \hypertarget{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{ |
---|
135 | void \textbf{set\_\-evalll} (bool evl0)} |
---|
136 | \label{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f} |
---|
137 | |
---|
138 | \end{CompactItemize} |
---|
139 | \end{Indent} |
---|
140 | \subsection*{Protected Attributes} |
---|
141 | \begin{CompactItemize} |
---|
142 | \item |
---|
143 | \hypertarget{classbdm_1_1ARX_11474a627367f81b76830cb8477cf026}{ |
---|
144 | \hyperlink{classbdm_1_1egiw}{egiw} \hyperlink{classbdm_1_1ARX_11474a627367f81b76830cb8477cf026}{est}} |
---|
145 | \label{classbdm_1_1ARX_11474a627367f81b76830cb8477cf026} |
---|
146 | |
---|
147 | \begin{CompactList}\small\item\em Posterior estimate of $\theta,r$ in the form of Normal-inverse Wishart density. \item\end{CompactList}\item |
---|
148 | \hypertarget{classbdm_1_1ARX_de5b7d83ff5d3f5af2f80068db0abdfd}{ |
---|
149 | \hyperlink{classldmat}{ldmat} \& \hyperlink{classbdm_1_1ARX_de5b7d83ff5d3f5af2f80068db0abdfd}{V}} |
---|
150 | \label{classbdm_1_1ARX_de5b7d83ff5d3f5af2f80068db0abdfd} |
---|
151 | |
---|
152 | \begin{CompactList}\small\item\em cached value of est.V \item\end{CompactList}\item |
---|
153 | \hypertarget{classbdm_1_1ARX_740b0582f180ba13cae91d66e9bdb67f}{ |
---|
154 | double \& \hyperlink{classbdm_1_1ARX_740b0582f180ba13cae91d66e9bdb67f}{nu}} |
---|
155 | \label{classbdm_1_1ARX_740b0582f180ba13cae91d66e9bdb67f} |
---|
156 | |
---|
157 | \begin{CompactList}\small\item\em cached value of est.nu \item\end{CompactList}\item |
---|
158 | \hypertarget{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64}{ |
---|
159 | double \hyperlink{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64}{frg}} |
---|
160 | \label{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64} |
---|
161 | |
---|
162 | \begin{CompactList}\small\item\em forgetting factor \item\end{CompactList}\item |
---|
163 | \hypertarget{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865}{ |
---|
164 | double \hyperlink{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865}{last\_\-lognc}} |
---|
165 | \label{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865} |
---|
166 | |
---|
167 | \begin{CompactList}\small\item\em cached value of lognc() in the previous step (used in evaluation of {\tt ll} ) \item\end{CompactList}\item |
---|
168 | \hypertarget{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{ |
---|
169 | \hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{drv}} |
---|
170 | \label{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed} |
---|
171 | |
---|
172 | \begin{CompactList}\small\item\em Random variable of the data (optional). \item\end{CompactList}\item |
---|
173 | \hypertarget{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ |
---|
174 | double \hyperlink{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ll}} |
---|
175 | \label{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a} |
---|
176 | |
---|
177 | \begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item |
---|
178 | \hypertarget{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{ |
---|
179 | bool \hyperlink{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{evalll}} |
---|
180 | \label{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee} |
---|
181 | |
---|
182 | \begin{CompactList}\small\item\em If true, the filter will compute likelihood of the data record and store it in {\tt ll} . Set to false if you want to save computational time. \item\end{CompactList}\end{CompactItemize} |
---|
183 | |
---|
184 | |
---|
185 | \subsection{Member Function Documentation} |
---|
186 | \hypertarget{classbdm_1_1ARX_8bdf2974052e8ce74eb0d4f3791c58a3}{ |
---|
187 | \index{bdm::ARX@{bdm::ARX}!bayes@{bayes}} |
---|
188 | \index{bayes@{bayes}!bdm::ARX@{bdm::ARX}} |
---|
189 | \subsubsection[bayes]{\setlength{\rightskip}{0pt plus 5cm}void bdm::ARX::bayes (const vec \& {\em dt})\hspace{0.3cm}{\tt \mbox{[}inline, virtual\mbox{]}}}} |
---|
190 | \label{classbdm_1_1ARX_8bdf2974052e8ce74eb0d4f3791c58a3} |
---|
191 | |
---|
192 | |
---|
193 | Incremental Bayes rule. |
---|
194 | |
---|
195 | \begin{Desc} |
---|
196 | \item[Parameters:] |
---|
197 | \begin{description} |
---|
198 | \item[{\em dt}]vector of input data \end{description} |
---|
199 | \end{Desc} |
---|
200 | |
---|
201 | |
---|
202 | Reimplemented from \hyperlink{classbdm_1_1BMEF_c287f4c0c1ea31b91572ec45351838f1}{bdm::BMEF}. |
---|
203 | |
---|
204 | References bayes().\hypertarget{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4}{ |
---|
205 | \index{bdm::ARX@{bdm::ARX}!logpred@{logpred}} |
---|
206 | \index{logpred@{logpred}!bdm::ARX@{bdm::ARX}} |
---|
207 | \subsubsection[logpred]{\setlength{\rightskip}{0pt plus 5cm}double bdm::ARX::logpred (const vec \& {\em dt}) const\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} |
---|
208 | \label{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4} |
---|
209 | |
---|
210 | |
---|
211 | Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. |
---|
212 | |
---|
213 | Reimplemented from \hyperlink{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{bdm::BM}. |
---|
214 | |
---|
215 | References bdm::egiw::\_\-nu(), bdm::egiw::\_\-V(), est, bdm::BM::evalll, bdm::BMEF::frg, bdm::BMEF::last\_\-lognc, bdm::egiw::lognc(), nu, ldmat::opupdt(), bdm::egiw::pow(), and V.\hypertarget{classbdm_1_1ARX_74fe8ae2d88bee8639510fd0eaf73513}{ |
---|
216 | \index{bdm::ARX@{bdm::ARX}!predictor@{predictor}} |
---|
217 | \index{predictor@{predictor}!bdm::ARX@{bdm::ARX}} |
---|
218 | \subsubsection[predictor]{\setlength{\rightskip}{0pt plus 5cm}{\bf mlnorm}$<$ {\bf ldmat} $>$ $\ast$ bdm::ARX::predictor () const\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}} |
---|
219 | \label{classbdm_1_1ARX_74fe8ae2d88bee8639510fd0eaf73513} |
---|
220 | |
---|
221 | |
---|
222 | conditional version of the predictor |
---|
223 | |
---|
224 | |
---|
225 | |
---|
226 | $<$----------- TODO |
---|
227 | |
---|
228 | Reimplemented from \hyperlink{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}{bdm::BM}. |
---|
229 | |
---|
230 | References bdm::epdf::dimension(), est, bdm::egiw::mean\_\-mat(), ldmat::rows(), bdm::mlnorm$<$ sq\_\-T $>$::set\_\-parameters(), and V.\hypertarget{classbdm_1_1ARX_16b02ae03316751664c22d59d90c1e34}{ |
---|
231 | \index{bdm::ARX@{bdm::ARX}!structure\_\-est@{structure\_\-est}} |
---|
232 | \index{structure\_\-est@{structure\_\-est}!bdm::ARX@{bdm::ARX}} |
---|
233 | \subsubsection[structure\_\-est]{\setlength{\rightskip}{0pt plus 5cm}ivec bdm::ARX::structure\_\-est ({\bf egiw} {\em Eg0})}} |
---|
234 | \label{classbdm_1_1ARX_16b02ae03316751664c22d59d90c1e34} |
---|
235 | |
---|
236 | |
---|
237 | Brute force structure estimation. |
---|
238 | |
---|
239 | \begin{Desc} |
---|
240 | \item[Returns:]indeces of accepted regressors. \end{Desc} |
---|
241 | |
---|
242 | |
---|
243 | References bdm::epdf::dimension(), bdm::egiw\_\-bestbelow(), est, and bdm::egiw::lognc(). |
---|
244 | |
---|
245 | The documentation for this class was generated from the following files:\begin{CompactItemize} |
---|
246 | \item |
---|
247 | \hyperlink{arx_8h}{arx.h}\item |
---|
248 | bdm/estim/arx.cpp\end{CompactItemize} |
---|