annotate toolboxes/FullBNT-1.0.7/KPMtools/softeye.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function M = softeye(K, p)
wolffd@0 2 % SOFTEYE Make a stochastic matrix with p on the diagonal, and the remaining mass distributed uniformly
wolffd@0 3 % M = softeye(K, p)
wolffd@0 4 %
wolffd@0 5 % M is a K x K matrix.
wolffd@0 6
wolffd@0 7 M = p*eye(K);
wolffd@0 8 q = 1-p;
wolffd@0 9 for i=1:K
wolffd@0 10 M(i, [1:i-1 i+1:K]) = q/(K-1);
wolffd@0 11 end