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.

updateMSGToLevel2Backward(msg, varNode, i, Lv1)
function msg = updateMSGToLevel2Backward(msg, varNode, i, Lv1)
        % send message forward in level 1.
        for j = 1:numel(varNode.x{Lv1}{i}.lowerNeighborMsgIDs)            
            msg{varNode.x{Lv1}{i}.backwardNeighborMsgID}.toFactorNode...
                = GaussianMultiply(msg{varNode.x{Lv1}{i}.backwardNeighborMsgID}.toFactorNode,...
                msg{varNode.x{Lv1}{i}.lowerNeighborMsgIDs(j)}.toVarNode);
        end
        % update variable node in level 1, which sends message downward to level 2.
        tmp_partial_belief = GaussianMultiply(msg{varNode.x{Lv1}{i}.backwardNeighborMsgID}.toFactorNode,...
                                          msg{varNode.x{Lv1}{i}.backwardNeighborMsgID}.toVarNode);
        for j = 1:numel(varNode.x{Lv1}{i}.lowerNeighborMsgIDs)
            msg{varNode.x{Lv1}{i}.lowerNeighborMsgIDs(j)}.toFactorNode...
                = GaussianDivision(tmp_partial_belief, msg{varNode.x{Lv1}{i}.lowerNeighborMsgIDs(j)}.toVarNode);
        end
end

Contact us