资 源 简 介
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