[571] | 1 | % sript for testing structure estimating function |
---|
| 2 | |
---|
[607] | 3 | % run just time-to-time - do not forget to copy resulting values to |
---|
| 4 | % test_arx_straux.cpp!!! |
---|
[694] | 5 | |
---|
| 6 | |
---|
| 7 | if 1 |
---|
| 8 | S={}; |
---|
| 9 | i=1; |
---|
| 10 | for dim=[3 5 10 20] |
---|
| 11 | A=rand(dim); |
---|
| 12 | B=rand(dim); |
---|
| 13 | S{i}.A = A; |
---|
| 14 | S{i}.B = B; |
---|
| 15 | i=i+1; |
---|
| 16 | end |
---|
[607] | 17 | % when run, copy output to the else section |
---|
| 18 | else |
---|
[694] | 19 | S = load('str_aux'); |
---|
[607] | 20 | end |
---|
| 21 | |
---|
[694] | 22 | for i=1:length(S) |
---|
| 23 | [L0,D0]=ldform(S{i}.A, eye(size(S{i}.A,1))); |
---|
| 24 | [L1,D1]=ldform(S{i}.A+S{i}.B, eye(size(S{i}.A,1))); |
---|
[571] | 25 | |
---|
[694] | 26 | % structure estimation - copied form facstr |
---|
| 27 | belief = 2; % default belief |
---|
| 28 | nbest = 1; % nbest: how many regressors are returned |
---|
| 29 | nrep = 5; % nrep: number of random repetions of structure estimation |
---|
| 30 | lambda = 0.9; |
---|
| 31 | k=2; |
---|
[572] | 32 | |
---|
[694] | 33 | % [strout, rgrsout, statistics] = |
---|
| 34 | % straux1(L, d, nu, L0, d0, nu0, belief, nbest, max_nrep, lambda, |
---|
| 35 | % order_k); |
---|
| 36 | [o1,o2,o3]=straux1(L1,diag(D1),20, L0, diag(D0), 10, belief, nbest, nrep, lambda, k); |
---|
| 37 | S{i}.o1= o1; |
---|
| 38 | end |
---|
| 39 | |
---|
| 40 | save str_aux S |
---|