image thumbnail

Hierarchical Kalman Filter for clinical time series prediction

by

 

It is an implementation of hierarchical (a.k.a. multi-scale) Kalman filter using belief propagation.

GaussianDivision(G1, G2)
function G3 = GaussianDivision(G1, G2)    
    G1.V_inv = inv_s(G1.V, G1.iV);
    G2.V_inv = inv_s(G2.V, G2.iV);
    G3.iV = G1.V_inv - G2.V_inv;
    if(sum(abs(G1.V_inv(:))) == 0)
        if(~isempty(G2.V))
            G3.V = -G2.V;
        else
            G3.V = [];
        end
        G3.mu = -G2.mu;
    elseif(sum(abs(G2.V_inv(:))) == 0)
        if(~isempty(G1.V))
            G3.V = G1.V;
        else
            G3.V = [];
        end
        G3.mu = G1.mu;
    else
        G3.V = inv(G3.iV);
        G3.mu = G3.V*(G1.V_inv*G1.mu - G2.V_inv*G2.mu);
    end
end

Contact us