\hypertarget{classbdm_1_1ARX}{
\section{bdm::ARX Class Reference}
\label{classbdm_1_1ARX}\index{bdm::ARX@{bdm::ARX}}
}
{\tt \#include $<$arx.h$>$}

Inheritance diagram for bdm::ARX:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=64pt]{classbdm_1_1ARX__inherit__graph}
\end{center}
\end{figure}


\subsection{Detailed Description}
Linear Autoregressive model with Gaussian noise. 

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). \]

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}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1ARX_43ed6114f04a3a8756fe2b42eaa35f98}{
\hyperlink{classbdm_1_1ARX_43ed6114f04a3a8756fe2b42eaa35f98}{ARX} (const double frg0=1.0)}
\label{classbdm_1_1ARX_43ed6114f04a3a8756fe2b42eaa35f98}

\begin{CompactList}\small\item\em Full constructor. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_73a55a3d66bfbeeee4df6c2ae40920ed}{
\hyperlink{classbdm_1_1ARX_73a55a3d66bfbeeee4df6c2ae40920ed}{ARX} (const \hyperlink{classbdm_1_1ARX}{ARX} \&A0)}
\label{classbdm_1_1ARX_73a55a3d66bfbeeee4df6c2ae40920ed}

\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61}{
\hyperlink{classbdm_1_1ARX}{ARX} $\ast$ \hyperlink{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61}{\_\-copy\_\-} ()}
\label{classbdm_1_1ARX_60c40b5c6abc4c7e464b4ccae64a5a61}

\begin{CompactList}\small\item\em Auxiliary function. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_cab0a1de5355b1027d24fd3d4862c9b0}{
void \hyperlink{classbdm_1_1ARX_cab0a1de5355b1027d24fd3d4862c9b0}{set\_\-parameters} (const \hyperlink{classldmat}{ldmat} \&V0, const double \&nu0)}
\label{classbdm_1_1ARX_cab0a1de5355b1027d24fd3d4862c9b0}

\begin{CompactList}\small\item\em Set sufficient statistics. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_539f9d0127423c94b912708d390e67b8}{
void \hyperlink{classbdm_1_1ARX_539f9d0127423c94b912708d390e67b8}{set\_\-statistics} (const \hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$BM0)}
\label{classbdm_1_1ARX_539f9d0127423c94b912708d390e67b8}

\begin{CompactList}\small\item\em get statistics from another model \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_1974409e022ea1efb3404b5c2fde66ad}{
void \hyperlink{classbdm_1_1ARX_1974409e022ea1efb3404b5c2fde66ad}{get\_\-parameters} (mat \&V0, double \&nu0)}
\label{classbdm_1_1ARX_1974409e022ea1efb3404b5c2fde66ad}

\begin{CompactList}\small\item\em Returns sufficient statistics. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_17e7fe14654ab3c449846c3f43e66169}{
void \hyperlink{classbdm_1_1ARX_17e7fe14654ab3c449846c3f43e66169}{bayes} (const vec \&dt, const double w)}
\label{classbdm_1_1ARX_17e7fe14654ab3c449846c3f43e66169}

\begin{CompactList}\small\item\em Here $dt = [y_t psi_t] $. \item\end{CompactList}\item 
void \hyperlink{classbdm_1_1ARX_8bdf2974052e8ce74eb0d4f3791c58a3}{bayes} (const vec \&dt)
\begin{CompactList}\small\item\em Incremental Bayes rule. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_16797df43f85f1ddbe9d64fd6d82c25d}{
const \hyperlink{classbdm_1_1epdf}{epdf} \& \textbf{\_\-epdf} () const }
\label{classbdm_1_1ARX_16797df43f85f1ddbe9d64fd6d82c25d}

\item 
double \hyperlink{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4}{logpred} (const vec \&dt) const 
\item 
\hypertarget{classbdm_1_1ARX_e86ab499b116b837d3163ec852961eca}{
void \hyperlink{classbdm_1_1ARX_e86ab499b116b837d3163ec852961eca}{flatten} (const \hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$B)}
\label{classbdm_1_1ARX_e86ab499b116b837d3163ec852961eca}

\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 
\hypertarget{classbdm_1_1ARX_749827323c034f11bec61b6e2fc3d42a}{
\hyperlink{classbdm_1_1enorm}{enorm}$<$ \hyperlink{classldmat}{ldmat} $>$ $\ast$ \hyperlink{classbdm_1_1ARX_749827323c034f11bec61b6e2fc3d42a}{epredictor} (const vec \&rgr) const }
\label{classbdm_1_1ARX_749827323c034f11bec61b6e2fc3d42a}

\begin{CompactList}\small\item\em Conditioned version of the predictor. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_4cdf5e2a7d3480ec31f6247ed4289b15}{
\hyperlink{classbdm_1_1enorm}{enorm}$<$ \hyperlink{classldmat}{ldmat} $>$ $\ast$ \hyperlink{classbdm_1_1ARX_4cdf5e2a7d3480ec31f6247ed4289b15}{epredictor} () const }
\label{classbdm_1_1ARX_4cdf5e2a7d3480ec31f6247ed4289b15}

\begin{CompactList}\small\item\em Constructs a predictive density $ f(d_{t+1} |d_{t}, \ldots d_{0}) $. \item\end{CompactList}\item 
\hyperlink{classbdm_1_1mlnorm}{mlnorm}$<$ \hyperlink{classldmat}{ldmat} $>$ $\ast$ \hyperlink{classbdm_1_1ARX_74fe8ae2d88bee8639510fd0eaf73513}{predictor} () const 
\begin{CompactList}\small\item\em conditional version of the predictor \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_c6a2428a46407fe45b4c7a99069c0801}{
\hyperlink{classbdm_1_1mlstudent}{mlstudent} $\ast$ \textbf{predictor\_\-student} () const }
\label{classbdm_1_1ARX_c6a2428a46407fe45b4c7a99069c0801}

\item 
ivec \hyperlink{classbdm_1_1ARX_16b02ae03316751664c22d59d90c1e34}{structure\_\-est} (\hyperlink{classbdm_1_1egiw}{egiw} Eg0)
\begin{CompactList}\small\item\em Brute force structure estimation. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_ab2c55205a324e9d698fbd8ac229ad4f}{
const \hyperlink{classbdm_1_1egiw}{egiw} $\ast$ \textbf{\_\-e} () const }
\label{classbdm_1_1ARX_ab2c55205a324e9d698fbd8ac229ad4f}

\item 
\hypertarget{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6}{
\hyperlink{classbdm_1_1BMEF}{BMEF} $\ast$ \hyperlink{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6}{\_\-copy\_\-} (bool changerv=false)}
\label{classbdm_1_1BMEF_5912dbcf28ae711e30b08c2fa766a3e6}

\begin{CompactList}\small\item\em Flatten the posterior as if to keep nu0 data. \item\end{CompactList}\end{CompactItemize}
\begin{Indent}{\bf Mathematical operations}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{
virtual void \hyperlink{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}{bayesB} (const mat \&Dt)}
\label{classbdm_1_1BM_1dee3fddaf021e62d925289660a707dc}

\begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{
vec \hyperlink{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}{logpred\_\-m} (const mat \&dt) const }
\label{classbdm_1_1BM_0e8ebe61fb14990abe1254bd3dda5fae}

\begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Access to attributes}\par
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{
const \hyperlink{classbdm_1_1RV}{RV} \& \textbf{\_\-drv} () const }
\label{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}

\item 
\hypertarget{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{
void \textbf{set\_\-drv} (const \hyperlink{classbdm_1_1RV}{RV} \&rv)}
\label{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}

\item 
\hypertarget{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{
double \textbf{\_\-ll} () const }
\label{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}

\item 
\hypertarget{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{
void \textbf{set\_\-evalll} (bool evl0)}
\label{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}

\end{CompactItemize}
\end{Indent}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1ARX_11474a627367f81b76830cb8477cf026}{
\hyperlink{classbdm_1_1egiw}{egiw} \hyperlink{classbdm_1_1ARX_11474a627367f81b76830cb8477cf026}{est}}
\label{classbdm_1_1ARX_11474a627367f81b76830cb8477cf026}

\begin{CompactList}\small\item\em Posterior estimate of $\theta,r$ in the form of Normal-inverse Wishart density. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_de5b7d83ff5d3f5af2f80068db0abdfd}{
\hyperlink{classldmat}{ldmat} \& \hyperlink{classbdm_1_1ARX_de5b7d83ff5d3f5af2f80068db0abdfd}{V}}
\label{classbdm_1_1ARX_de5b7d83ff5d3f5af2f80068db0abdfd}

\begin{CompactList}\small\item\em cached value of est.V \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_740b0582f180ba13cae91d66e9bdb67f}{
double \& \hyperlink{classbdm_1_1ARX_740b0582f180ba13cae91d66e9bdb67f}{nu}}
\label{classbdm_1_1ARX_740b0582f180ba13cae91d66e9bdb67f}

\begin{CompactList}\small\item\em cached value of est.nu \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64}{
double \hyperlink{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64}{frg}}
\label{classbdm_1_1BMEF_1331865e10fb1ccef65bb4c47fa3be64}

\begin{CompactList}\small\item\em forgetting factor \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865}{
double \hyperlink{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865}{last\_\-lognc}}
\label{classbdm_1_1BMEF_06e7b3ac03e10017d4288c76888e2865}

\begin{CompactList}\small\item\em cached value of lognc() in the previous step (used in evaluation of {\tt ll} ) \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}{drv}}
\label{classbdm_1_1BM_c400357e37d27a4834b2b1d9211009ed}

\begin{CompactList}\small\item\em Random variable of the data (optional). \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{
double \hyperlink{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}{ll}}
\label{classbdm_1_1BM_4064b6559d962633e4372b12f4cd204a}

\begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{
bool \hyperlink{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}{evalll}}
\label{classbdm_1_1BM_faff0ad12556fe7dc0e2807d4fd938ee}

\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}


\subsection{Member Function Documentation}
\hypertarget{classbdm_1_1ARX_8bdf2974052e8ce74eb0d4f3791c58a3}{
\index{bdm::ARX@{bdm::ARX}!bayes@{bayes}}
\index{bayes@{bayes}!bdm::ARX@{bdm::ARX}}
\subsubsection[bayes]{\setlength{\rightskip}{0pt plus 5cm}void bdm::ARX::bayes (const vec \& {\em dt})\hspace{0.3cm}{\tt  \mbox{[}inline, virtual\mbox{]}}}}
\label{classbdm_1_1ARX_8bdf2974052e8ce74eb0d4f3791c58a3}


Incremental Bayes rule. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dt}]vector of input data \end{description}
\end{Desc}


Reimplemented from \hyperlink{classbdm_1_1BMEF_c287f4c0c1ea31b91572ec45351838f1}{bdm::BMEF}.

References bayes().\hypertarget{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4}{
\index{bdm::ARX@{bdm::ARX}!logpred@{logpred}}
\index{logpred@{logpred}!bdm::ARX@{bdm::ARX}}
\subsubsection[logpred]{\setlength{\rightskip}{0pt plus 5cm}double bdm::ARX::logpred (const vec \& {\em dt}) const\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
\label{classbdm_1_1ARX_080a7e531e3aa06694112863b15bc6a4}


Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. 

Reimplemented from \hyperlink{classbdm_1_1BM_50257e0c1e5b5c73153ea6e716ad8ae0}{bdm::BM}.

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}{
\index{bdm::ARX@{bdm::ARX}!predictor@{predictor}}
\index{predictor@{predictor}!bdm::ARX@{bdm::ARX}}
\subsubsection[predictor]{\setlength{\rightskip}{0pt plus 5cm}{\bf mlnorm}$<$ {\bf ldmat} $>$ $\ast$ bdm::ARX::predictor () const\hspace{0.3cm}{\tt  \mbox{[}virtual\mbox{]}}}}
\label{classbdm_1_1ARX_74fe8ae2d88bee8639510fd0eaf73513}


conditional version of the predictor 



$<$----------- TODO 

Reimplemented from \hyperlink{classbdm_1_1BM_598b25e3f3d96a5bc00a5faeb5b3c912}{bdm::BM}.

References bdm::epdf::dimension(), est, bdm::egiw::mean\_\-mat(), ldmat::rows(), bdm::mlnorm$<$ sq\_\-T $>$::set\_\-parameters(), and V.\hypertarget{classbdm_1_1ARX_16b02ae03316751664c22d59d90c1e34}{
\index{bdm::ARX@{bdm::ARX}!structure\_\-est@{structure\_\-est}}
\index{structure\_\-est@{structure\_\-est}!bdm::ARX@{bdm::ARX}}
\subsubsection[structure\_\-est]{\setlength{\rightskip}{0pt plus 5cm}ivec bdm::ARX::structure\_\-est ({\bf egiw} {\em Eg0})}}
\label{classbdm_1_1ARX_16b02ae03316751664c22d59d90c1e34}


Brute force structure estimation. 

\begin{Desc}
\item[Returns:]indeces of accepted regressors. \end{Desc}


References bdm::epdf::dimension(), bdm::egiw\_\-bestbelow(), est, and bdm::egiw::lognc().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
\hyperlink{arx_8h}{arx.h}\item 
bdm/estim/arx.cpp\end{CompactItemize}
