mixpp: bdm::ARX Class Reference

bdm::ARX Class Reference

Linear Autoregressive model with Gaussian noise. More...

#include <arx.h>

List of all members.


Detailed Description

Linear Autoregressive model with Gaussian noise.

Regression of the following kind:

\[ y_t = heta_1 \psi_1 + heta_2 + \psi_2 +\ldots + heta_n \psi_n + r e_t \]

where unknown parameters rv are $[ heta 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). \]

See Theory of ARX model estimation for mathematical treatment.

The easiest way how to use the class is:

#include "estim/arx.h"
using namespace bdm;
// estimation of AR(0) model
int main() {
    //prior
    mat V0 = 0.00001 * eye ( 2 );
    V0 ( 0, 0 ) = 0.1; //
    ARX Ar;
    Ar.set_statistics ( 1, V0 ); //nu is default (set to have finite moments)
    Ar.set_constant ( true );
    Ar.validate();
    // forgetting is default: 1.0
    mat Data = concat_vertical ( randn ( 1, 100 ), ones ( 1, 100 ) );
    Ar.bayes_batch ( Data );
    cout << "Expected value of Theta is: " << Ar.posterior().mean() << endl;
}

odo sort out constant terms - bayes should accept vec without additional 1s


Member Function Documentation

void bdm::ARX::from_setting(const Setting & set ) 

Create object from the following structure

    class = 'ARX';
    rgr = RV({'names',...},[sizes,...],[times,...]);   % description of regressor variables
    --- optional fields ---
    prior = configuration of bdm::egiw;                % any offspring of eqiw for prior density, bdm::egiw::from_setting
    alternative = configuration of bdm::egiw;          % any offspring of eqiw for alternative density in stabilized estimation of prior density
    constant = [];                                     % 0/1 switch if the constant term is modelled or not
    --- inherited fields ---
    bdm::BMEF::from_setting

If the optional fields are not given, they will be filled as follows:

    prior = posterior;                                % when prior is not given the posterior is used (TODO it is unclear)
    alternative = prior;                              % when alternative is not given the prior is used
    constant = 1;                                     % constant term is modelled on default

Reimplemented from bdm::BMEF.

Reimplemented in bdm::ARXg.

References bdm::RV::_dsize(), alter_est, bdm_assert, bdm::BM::dimc, bdm::BM::dimy, bdm::shared_ptr< T >::get(), bdm::UI::get(), have_constant, rgr, rgrlen, bdm::BM::rvc, set_prior(), and bdm::BM::yrv.


The documentation for this class was generated from the following files:

Generated on Fri Aug 27 16:54:40 2010 for mixpp by  doxygen 1.6.0