📄 polya_fit_ms.m
字号:
function a = polya_fit_ms(data, a, weight)% POLYA_FIT_MS Maximum-likelihood Polya distribution.%% Same as POLYA_FIT but uses alternating optimization for M and S.% DATA is a matrix of histograms, oriented the same way as A.% Written by Tom Minkaif nargin < 2 a = polya_moment_match(data);end% alternate between polya_fit_m and polya_fit_suse_weight = (nargin >= 3);row = (rows(a) == 1);if row N = rows(data); if ~use_weight weight = ones(N,1); endelse N = cols(data); if ~use_weight weight = ones(1,N); endends = sum(a);for iter = 1:10 old_s = s; a = polya_fit_m(data, a, weight); m = a/s; a = polya_fit_s(data, a, weight); s = sum(a); if ~finite(s) s = 1e7; obj.a = s*m; end if abs(s - old_s) < 1e-4 break endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -