MATLAB马尔可夫实现
代码说明:
function [chain,state]=markov(T,n,s0,V); %function [chain,state]=markov(T,n,s0,V); % chain generates a simulation from a Markov chain of dimension % the size of T % % T is transition matrix % n is number of periods to simulate % s0 is initial state (initial probabilities) % V is the quantity corresponding to each state % state is a matrix recording the number of the realized state at time t % % Original author: Tom Sargent % Comments added by Qiang Chen
下载说明:请别用迅雷下载,失败请重下,重下不扣分!