comparison toolboxes/FullBNT-1.0.7/Kalman/SS_to_AR.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function [coef, C] = SS_to_AR(F, Q, k, diagonal)
2 %
3 % Extract the parameters of a vector autoregresssive process of order k from the state-space form.
4 % [coef, C] = SS_to_AR(F, Q, k, diagonal)
5
6 if nargin<4, diagonal = 0; end
7
8 s = length(Q) / k;
9 bs = s*ones(1,k);
10 coef = zeros(s,s,k);
11 for i=1:k
12 if diagonal
13 coef(:,:,i) = diag(diag(F(block(1,bs), block(i,bs))));
14 else
15 coef(:,:,i) = F(block(1,bs), block(i,bs));
16 end
17 end
18 C = Q(block(1,bs), block(1,bs));
19 if diagonal
20 C = diag(diag(C));
21 end
22 %C = sqrt(Q(block(1,bs), block(1,bs))); % since cov(1,1) of full vector = C C'