Revision 647, 0.9 kB
(checked in by smidl, 15 years ago)
|
ticket 12 - correct handling of LD
|
Rev | Line | |
---|
[607] | 1 | #include "estim/arx.h" |
---|
| 2 | #include "mat_checks.h" |
---|
| 3 | |
---|
| 4 | using namespace bdm; |
---|
| 5 | |
---|
| 6 | TEST(test_arx_straux){ |
---|
[629] | 7 | mat A="0.8147 0.9134 0.2785;" |
---|
[607] | 8 | "0.9058 0.6324 0.5469;" |
---|
[629] | 9 | "0.1270 0.0975 0.9575"; |
---|
[607] | 10 | |
---|
[629] | 11 | mat B="0.9649 0.9572 0.1419;" |
---|
[607] | 12 | "0.1576 0.4854 0.4218;" |
---|
[629] | 13 | "0.9706 0.8003 0.9157"; |
---|
[607] | 14 | //when updateing matrices do not forget to update CHECK_EQUAL below!!! |
---|
| 15 | |
---|
[647] | 16 | ldmat Ld0(3); Ld0.ldform(A,ones(3)); |
---|
| 17 | ldmat Ld1(3); Ld1.ldform(A+B,ones(3)); |
---|
[607] | 18 | |
---|
[647] | 19 | |
---|
[607] | 20 | ivec belief = vec_1(2); // default belief |
---|
| 21 | int nbest = 3; // nbest: how many regressors are returned |
---|
| 22 | int nrep = 5; // nrep: number of random repetions of structure estimation |
---|
| 23 | double lambda = 0.9; |
---|
| 24 | int k=2; |
---|
| 25 | |
---|
| 26 | //[strout, rgrsout, statistics] = |
---|
| 27 | // straux1(L, d, nu, L0, d0, nu0, belief, nbest, max_nrep, lambda, |
---|
| 28 | // order_k); |
---|
| 29 | ivec o2; |
---|
| 30 | ivec o1 = straux1(Ld1,20, Ld0, 10, belief, nbest, nrep, lambda, k, o2); |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | CHECK_EQUAL(ivec("2 3"), o1); |
---|
| 34 | |
---|
| 35 | } |
---|