process_ex_2.m
来自「markov matlab code, give a detail implet」· M 代码 · 共 15 行
M
15 行
% process_ex_2.m determines the parameters lambda and Q for a Markov chain, which can then be used to determine a Markov processS = [1 2 3 4]; % state spacemu = [0.2 0 0 0.8]; % initial distributionP = [[ 0.095 0.8 0.095 0.01]; % transition matrix [ 0.095 0.095 0.8 0.01]; [ 0.8 0.095 0.095 0.01]; [ 0.0 0.05 0.0 0.95]];lambda = 1-diag(P); % jump rates/sojourn parametersD = diag(diag(P)); % diagonal matrix with the same diagonal as PQ = inv(diag(lambda))*(P-D); % make diagonal zero, normalize rowsTmax = 80;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?