gettimejump.m

来自「Continuous Profile Models (CPM) Matlab T」· M 代码 · 共 31 行

M
31
字号
% function timeJumpMats = getTimeJump(G)%% get the two matrixes that are indicator matrixes for% the transition matrix reflecting pairs of states that% correspond to jumping ahead 3,2 and 1 time states% and ignoring the boundary condition states.  % this is used when updating the transition matrixes in the% M-Step%% This has now been generalized to maxTimeSteps, rather than 3function timeJumpMats = getTimeJump(G)steps=1:G.maxTimeSteps;for tj=steps  %tempMat=sparse(G.numStates,G.numStates);  tempMat=logical(sparse(G.numStates,G.numStates));  for tt=1:G.numStates-G.numScales*G.maxTimeSteps; %or (maxTimeSteps-1)    % above, because don't want boundary times    % with different probabilities     thisTime = G.stateToScaleTau(tt,2);    validStates = find((G.stateToScaleTau(:,2)-thisTime)==tj);    %tempMat(tt,validStates)=1;    tempMat(tt,validStates)=true;  end  timeJumpMats{tj}=tempMat;end

⌨️ 快捷键说明

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