How to fit a multi modal distribution using a weighted sum of PDFs?
古いコメントを表示
I am new to matlab and I know my question is rudimentary. I really appreciated if you help me. I have a data-set (attached) shows multi modal distributions and I want to make a fit using a weighted sum of PDFs. How may I do that?
I have applied the Kernel distribution but I am not sure is right.
clc;
clear all;
close all;
%.....................................................................
data=xlsread('A');
rr=data(:,1);%gr/cm3
[x11,y11]=hist(rr,36);
hist(rr,36);
hold on
[f,x11] = ksdensity(rr,'Bandwidth',0.0028);
plot(x11,f,'-r','LineWidth',2)
採用された回答
その他の回答 (1 件)
Tom Lane
2021 年 3 月 2 日
1 投票
I'm glad Bjorn provided an answer that works for you. For future reference, there is a function for fitting mixtures of normal distributions:
Also, there is an example that fits a mixture of two normals, but it can be adapted to fix mixtures of any distributions:
3 件のコメント
Maria Amr
2021 年 3 月 2 日
Tom Lane
2021 年 3 月 3 日
@Maria Amr, I don't know what h() is in your code, but if it is a variable then you are indexing into it using values like -0.1.
カテゴリ
ヘルプ センター および File Exchange で Exploration and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!