gaminvrnd.m

来自「Continuous Profile Models (CPM) Matlab T」· M 代码 · 共 33 行

M
33
字号
% function x = gaminvrnd(A,B)%% Generate random samples from an inverse-gamma distribution, using% Rubin notation.%% B_matlab = 1/B_rubin%% See also gamrnd, gamcdf, gamfit, gaminv, gamlike, gampdf, gamstat, random.function x = gaminvrnd(A,B,M,N)if exist('M','var')    y = mygamrnd(A,B,M,N);else    y = mygamrnd(A,B); end%% make it draw from the inversex = 1./y; return;%%%%%A=1.5; B=0.5;if A>1    temp = gaminvrnd(A,B,1e6,1);    mean(temp)    B./(A-1)endtemp=mygamrnd(A,B,1e6,1);mean(temp)A/B

⌨️ 快捷键说明

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