root/library/tests/testsuite/arx_straux_test.cpp @ 722

Revision 722, 1.2 kB (checked in by mido, 15 years ago)

astyler run over all test sources
general_suite added
cleanup of \test directory finished

  • Property svn:eol-style set to native
RevLine 
[607]1#include "estim/arx.h"
[717]2#include "../mat_checks.h"
[607]3
4using namespace bdm;
5
[698]6TEST ( arx_straux_test ) {
[607]7
[698]8        UIFile F ( "arx_straux_test.cfg" );
9
[722]10        Setting &tests = F.getRoot() ["tests"];
11        for ( int i = 0; i < tests.getLength(); i++ ) {
[698]12                mat A;
13                mat B;
14                ivec o1_ok;
[722]15                UI::get ( A, tests[i], "A", UI::compulsory );
16                UI::get ( B, tests[i], "B", UI::compulsory );
17                UI::get ( o1_ok, tests[i], "o1", UI::compulsory );
[698]18
[607]19//when updateing matrices do not forget to update CHECK_EQUAL below!!!
20
[722]21                ldmat Ld0 ( 3 );
22                Ld0.ldform ( A, ones ( A.rows() ) );
23                ldmat Ld1 ( 3 );
24                Ld1.ldform ( A + B, ones ( A.rows() ) );
[647]25
[607]26
[698]27                ivec belief = vec_1 ( 2 );        // default belief
28                int nbest = 3;           // nbest: how many regressors are returned
29                int nrep = 5;         // nrep: number of random repetions of structure estimation
30                double lambda   = 0.9;
[722]31                int k = 2;
[698]32
33//[strout, rgrsout, statistics] =
[607]34//          straux1(L, d, nu, L0, d0, nu0, belief, nbest, max_nrep, lambda,
35//          order_k);
[698]36                Array<str_aux> o2;
[722]37                ivec o1 = straux1 ( Ld1, 20, Ld0, 10,  belief, nbest, nrep, lambda, k, o2 );
[607]38
[698]39//o1 is messed up in matlab's straux
40                sort ( o1_ok );
41                sort ( o1 );
42                CHECK_EQUAL ( o1_ok, o1 );
43        }
[607]44
45}
Note: See TracBrowser for help on using the browser.