process_ex_bd.m
来自「markov matlab code, give a detail implet」· M 代码 · 共 17 行
M
17 行
% process_ex_bd.m sets up parameters for a simple birth/death processTmax = 5; % maximum timebeta = 1.2; % individuals' birth ratedelta = 1; % individuals' death ratep = beta/(beta+delta); % probability of a birth at jump timen = 20; % maximum population sizeS = 0:n; % state spacemu = zeros(1,n+1); % initial distributionmu(min(5,n)) = 1;lambda =(beta+delta)*(0:n); % sojourn parametersQ=diag(p*ones(1,n),1)+diag((1-p)*ones(1,n),-1); % transitions up or downQ(n+1,n+1)=p; % limit population size at nQ(1,1)=1; % make sure 0 is absorbingQ(1,2)=0;lambda(1)=1; % avoid problems with simulation
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?