Mercurial > hg > camir-ismir2012
comparison toolboxes/FullBNT-1.0.7/Kalman/convert_to_lagged_form.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cc4b1211e677 |
---|---|
1 function yy = convert_to_lagged_form(y, k) | |
2 % Create an observation vector yy(:,t) containing the last k values of y, newest first | |
3 % e.g., k=2, y = (a1 a2 a3) yy = a2 a3 | |
4 % (b1 b2 b3) b2 b2 | |
5 % a1 a2 | |
6 % b1 b2 | |
7 | |
8 [s T] = size(y); | |
9 bs = s*ones(1,k); | |
10 yy = zeros(k*s, T-k+1); | |
11 for i=1:k | |
12 yy(block(i,bs), :) = y(:, k-i+1:end-i+1); | |
13 end | |
14 |