mcmclt.m

来自「马尔可夫链」· M 代码 · 共 44 行

M
44
字号
% MCMLT - makes matrix of MCMC runs lower triangular% Copyright (c) 1998, Harvard University. Full copyright in the file Copyright%%   [ Alt ] = MCMCLT(A)%% A = a chain of matricies, typically covariances%% Alt = A with all elements above the diagonal changed to NaNs%% Good for removing redundant trace plots and values,% especially for samples of covariance matricies.% % MCMCTRACE will not plot chains that begin with NaNs.%% See also: LTVEC, VECLTfunction [Alt] = mcmclt(A) dd = size(A) ;ll = length(dd) ;d1 = dd(1) ;d2 = dd(2) ;if (ll==2),  Alt = A ;  for i1 = 1:d1,  for i2 = 1:d2,    if i2>i1,      Alt(i1,i2)=NaN ;    end  end  endelse  Alt = A ;  for i1 = 1:d1,  for i2 = 1:d2,    if i2>i1,      Alt(i1,i2,:)=NaN ;    end  end  endend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?