MLE of combined analytically and empirically defined distributions
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I have some data that I would like to fit which has two components to it's pdf: a normal distribution and an added arbitrary distribution that cannot be described analytically but can be measured/interpolated from other data. The final distribution would look something like
@(x, mu, sigma, b) (1-b)*normpdf(x, mu, sigma)+ b*EmpiricalPDF(x)
I'm unsure of how to define the empirical distribution so it can be combined with the normal pdf and used for MLE.
Thanks!
0 Kommentare
Antworten (1)
Torsten
am 5 Mär. 2025
Bearbeitet: Torsten
am 5 Mär. 2025
MATLAB's "mle" accepts custom pdf's.
If you write b as sin^2(p) and (1-b) as cos^2(p), it should work to estimate mu, sigma and p (and thus b).
You will have to fit a function to your EmpiricalPDF first before starting with "mle".
2 Kommentare
Torsten
am 6 Mär. 2025
Bearbeitet: Torsten
am 6 Mär. 2025
The below code generates a function "EmpiricalCDF" as an approximation of the cdf to your data.
Thus supply the cdf instead of the pdf when you call "mle".
You might get problems if "mle" calls "EmpiricalCDF" outside the range of your data. If this is the case, you will have to program the interpolation with extrapolation on your own. But this is very easy.
% Generate 1000 normal random numbers
mu = 0; sigma = 1; nr = 1000;
givenDist = mu + sigma * randn(nr,1);
% Generate empirical cdf from random numbers
x = sort(givenDist(:));
p = 1:length(x);
p = p./length(x);
plot(x,p,'color','r');
EmpiricalCDF = @(y)interp1(x,p,y)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!