What distribution is appropriate for my data?
2 ビュー (過去 30 日間)
Hi everyone. I tried to fit a lognormal distribution considering the first moment approach via below code.However, the fited lognormal distribution is not good (please see the attached picture). Can anyone suggest a better distribution to fit my data?
probs = vector2 / sum(vector2); % Convert counts to probabilities
ExpOfY = sum(vector1.*probs); % mean of the scores tabulated in vectors 1 & 2
Ysqr = vector1.^2;
ExpOfYsqr = sum(Ysqr.*probs);
VarOfY = ExpOfYsqr - ExpOfY^2; % variance of the scores tabulated in vectors 1 & 2
normu = log(ExpOfY/sqrt(1+VarOfY/ExpOfY^2));
norvar = log(1+VarOfY/ExpOfY^2);
norsigma = sqrt(norvar);
dist = makedist('Lognormal','mu',normu,'sigma',norsigma);
x = linspace(0,max(vector1)); % Use whatever range is appropriate for your data
pdfOfx = pdf(dist,x);
% set(gca, 'XScale', 'log')
vector2nor = vector2 / trapz(vector1,vector2);
legend('Fitted lognormal','Real data')
回答 (1 件)
John D'Errico 2022 年 11 月 25 日
Why would you expect a distribution like that, with a strange hump on one side to have some predefined distribution that fits it well? Note that any simple distribution, like a normal, or lognormal will have a single well defined mode. (I'll leave out beta distributions, which do NOT have that shape either.)
That bump means no simple distribution will work. What will probably work is a mixture distribution.