| 1 | % sript for testing structure estimating function |
|---|
| 2 | |
|---|
| 3 | % run just time-to-time - do not forget to copy resulting values to |
|---|
| 4 | % test_arx_straux.cpp!!! |
|---|
| 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 |
|---|
| 17 | % when run, copy output to the else section |
|---|
| 18 | else |
|---|
| 19 | S = load('str_aux'); |
|---|
| 20 | end |
|---|
| 21 | |
|---|
| 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))); |
|---|
| 25 | |
|---|
| 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; |
|---|
| 32 | |
|---|
| 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 |
|---|