⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ar_to_ss.m

📁 给出了关于卡尔曼滤波器的详细说明
💻 M
字号:
function [F,H,Q,R,initx, initV] = AR_to_SS(coef, C, y)%% Convert a vector auto-regressive model of order k to state-space form.% [F,H,Q,R] = AR_to_SS(coef, C, y)% % X(i) = A(1) X(i-1) + ... + A(k) X(i-k+1) + v, where v ~ N(0, C)% and A(i) = coef(:,:,i) is the weight matrix for i steps ago.% We initialize the state vector with [y(:,k)' ... y(:,1)']', since% the state vector stores [X(i) ... X(i-k+1)]' in order.[s s2 k] = size(coef); % s is the size of the state vectorbs = s * ones(1,k); % size of each blockF = zeros(s*k);for i=1:k   F(block(1,bs), block(i,bs)) = coef(:,:,i);endfor i=1:k-1  F(block(i+1,bs), block(i,bs)) = eye(s);endH = zeros(1*s, k*s);% we get to see the most recent component of the state vector H(block(1,bs), block(1,bs)) = eye(s); %for i=1:k%  H(block(1,bs), block(i,bs)) = eye(s);%endQ = zeros(k*s);Q(block(1,bs), block(1,bs)) = C;R = zeros(s);initx = zeros(k*s, 1);for i=1:k  initx(block(i,bs)) = y(:, k-i+1); % concatenate the first k observation vectorsendinitV = zeros(k*s); % no uncertainty about the state (since perfectly observable)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -