\hypertarget{classbdm_1_1ARX}{
\section{bdm::ARX Class Reference}
\label{classbdm_1_1ARX}\index{bdm::ARX@{bdm::ARX}}
}
Linear Autoregressive model with Gaussian noise.  


{\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}
Collaboration diagram for bdm::ARX:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=400pt]{classbdm_1_1ARX__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hypertarget{classbdm_1_1ARX_44914d0b259204b3446db82b989bd626}{
\hyperlink{classbdm_1_1ARX_44914d0b259204b3446db82b989bd626}{ARX} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}{rv}, const mat \&V0, const double \&nu0, const double frg0=1.0)}
\label{classbdm_1_1ARX_44914d0b259204b3446db82b989bd626}

\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_20ff2de8d862f28de7da83444d65bcdb}{
\hyperlink{classbdm_1_1ARX}{ARX} $\ast$ \hyperlink{classbdm_1_1ARX_20ff2de8d862f28de7da83444d65bcdb}{\_\-copy\_\-} (bool changerv=false)}
\label{classbdm_1_1ARX_20ff2de8d862f28de7da83444d65bcdb}

\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} \& \hyperlink{classbdm_1_1ARX_16797df43f85f1ddbe9d64fd6d82c25d}{\_\-epdf} () const }
\label{classbdm_1_1ARX_16797df43f85f1ddbe9d64fd6d82c25d}

\begin{CompactList}\small\item\em Returns a reference to the \hyperlink{classbdm_1_1epdf}{epdf} representing posterior density on parameters. \item\end{CompactList}\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_7c8d1fe774fe1da50293d50ad8aef43d}{
\hyperlink{classbdm_1_1enorm}{enorm}$<$ \hyperlink{classldmat}{ldmat} $>$ $\ast$ \hyperlink{classbdm_1_1ARX_7c8d1fe774fe1da50293d50ad8aef43d}{predictor} (const \hyperlink{classbdm_1_1RV}{RV} \&rv0, const vec \&rgr) const }
\label{classbdm_1_1ARX_7c8d1fe774fe1da50293d50ad8aef43d}

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

\begin{CompactList}\small\item\em Constructs a predictive density (marginal density on data). \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_02d9e91f21a700947a7b7eec1beed956}{
\hyperlink{classbdm_1_1mlnorm}{mlnorm}$<$ \hyperlink{classldmat}{ldmat} $>$ $\ast$ \hyperlink{classbdm_1_1ARX_02d9e91f21a700947a7b7eec1beed956}{predictor} (const \hyperlink{classbdm_1_1RV}{RV} \&rv0, const \hyperlink{classbdm_1_1RV}{RV} \&rvc0) const }
\label{classbdm_1_1ARX_02d9e91f21a700947a7b7eec1beed956}

\begin{CompactList}\small\item\em conditional version of the predictor \item\end{CompactList}\item 
\hypertarget{classbdm_1_1ARX_2ce8c6599497ffb94dfcb66d1fe7aca6}{
\hyperlink{classbdm_1_1mlstudent}{mlstudent} $\ast$ \textbf{predictor\_\-student} (const \hyperlink{classbdm_1_1RV}{RV} \&rv0, const \hyperlink{classbdm_1_1RV}{RV} \&rvc0) const }
\label{classbdm_1_1ARX_2ce8c6599497ffb94dfcb66d1fe7aca6}

\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$ \hyperlink{classbdm_1_1ARX_ab2c55205a324e9d698fbd8ac229ad4f}{\_\-e} () const }
\label{classbdm_1_1ARX_ab2c55205a324e9d698fbd8ac229ad4f}

\begin{CompactList}\small\item\em Returns a pointer to the \hyperlink{classbdm_1_1epdf}{epdf} representing posterior density on parameters. Use with care! \item\end{CompactList}\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}\item 
\hypertarget{classbdm_1_1BM_40a3c891996391e3135518053a917793}{
const \hyperlink{classbdm_1_1RV}{RV} \& \hyperlink{classbdm_1_1BM_40a3c891996391e3135518053a917793}{\_\-rv} () const }
\label{classbdm_1_1BM_40a3c891996391e3135518053a917793}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{
const \hyperlink{classbdm_1_1RV}{RV} \& \hyperlink{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}{\_\-drv} () const }
\label{classbdm_1_1BM_ff2d8755ba0b3def927d31305c03b09c}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{
void \hyperlink{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}{set\_\-drv} (const \hyperlink{classbdm_1_1RV}{RV} \&\hyperlink{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}{rv})}
\label{classbdm_1_1BM_f135ae6dce7e9f30c9f88229c7930b96}

\begin{CompactList}\small\item\em set drv \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{
double \hyperlink{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}{\_\-ll} () const }
\label{classbdm_1_1BM_5be65d37dedfe33a3671e7065f523a70}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
\hypertarget{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{
void \hyperlink{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}{set\_\-evalll} (bool evl0)}
\label{classbdm_1_1BM_236b3abbcc93594fc97cd86d82c1a83f}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\end{CompactItemize}
\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_18d6db4af8ee42077741d9e3618153ca}{
\hyperlink{classbdm_1_1RV}{RV} \hyperlink{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}{rv}}
\label{classbdm_1_1BM_18d6db4af8ee42077741d9e3618153ca}

\begin{CompactList}\small\item\em Random variable of the posterior. \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{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{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_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::RV::count(), 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}
