Revision 606, 1.3 kB
(checked in by smidl, 15 years ago)
|
ticket 12
|
Rev | Line | |
---|
[585] | 1 | #include "arx.h" |
---|
| 2 | |
---|
| 3 | namespace bdm { |
---|
| 4 | |
---|
[606] | 5 | struct str_aux { |
---|
| 6 | vec d0; |
---|
| 7 | double nu0; |
---|
| 8 | mat L0; |
---|
| 9 | mat L; |
---|
| 10 | vec d; |
---|
| 11 | double nu; |
---|
| 12 | ivec strL; // Current structure of L and d |
---|
| 13 | ivec strRgr; // Structure elements currently inside regressor (after regressand) |
---|
| 14 | ivec strMis; // structure elements, that are currently outside regressor (before regressand) |
---|
| 15 | int posit1; // regressand position |
---|
| 16 | int nbits; // number of bits available in double |
---|
| 17 | int bitstr; |
---|
| 18 | double loglik; // loglikelihood |
---|
| 19 | }; |
---|
| 20 | |
---|
| 21 | ivec straux1(ldmat Ld, double nu, ldmat Ld0, double nu0, ivec belief, int nbest, int max_nrep, double lambda, int order_k, ivec &rgrsout){ |
---|
[585] | 22 | // see utia_legacy/ticket_12/ implementation and str_test.m |
---|
| 23 | |
---|
[606] | 24 | const mat &L = Ld._L(); |
---|
| 25 | const vec &d = Ld._D(); |
---|
| 26 | |
---|
| 27 | const mat &L0 = Ld0._L(); |
---|
| 28 | const vec &d0 = Ld0._D(); |
---|
| 29 | |
---|
| 30 | int n_data = d.length(); |
---|
| 31 | |
---|
| 32 | ivec belief_out = find(belief==4)+1; // we are avoiding to put this into regressor |
---|
| 33 | ivec belief_in = find(belief==1)+1; // we are instantly keeping this in regressor |
---|
| 34 | |
---|
| 35 | str_aux full; |
---|
| 36 | |
---|
| 37 | full.d0 = d0; |
---|
| 38 | full.nu0 = nu0; |
---|
| 39 | full.L0 = L0; |
---|
| 40 | full.L = L; |
---|
| 41 | full.d = d; |
---|
| 42 | full.nu = nu; |
---|
| 43 | full.strL = linspace(1,n_data); |
---|
| 44 | full.strRgr = linspace(2,n_data); |
---|
| 45 | full.strMis = ivec(0); |
---|
| 46 | full.posit1 = 1; |
---|
| 47 | //full.nbits = floor(log2(bitmax))-1; //!!!!!!! |
---|
| 48 | |
---|
[585] | 49 | } |
---|
| 50 | |
---|
[606] | 51 | |
---|
| 52 | |
---|
[585] | 53 | } |
---|