필터 지우기
필터 지우기

Kernel density estimates....group data into bin and KDE

조회 수: 4 (최근 30일)
alberto caracciolo
alberto caracciolo 2019년 2월 28일
답변: Jeff Miller 2019년 2월 28일
Hi,
I'm a beginner in matlab and I need to make Kernel density estimate curves.
The only thing I have is one column with my data (e.g a txt file that I attach). What i would like to do is:
  • make a KDE with these data. I think first i need to group my data into bins (right??). If that is the case, I would like bins from 0 to 8 at intervals of 0.5
Could you help me with the code?
Thank you

답변 (1개)

Jeff Miller
Jeff Miller 2019년 2월 28일
No, you don't need to make bins. This might give you a start:
Pressure = importdata('Pressure.txt');
kernest = fitdist(Pressure,'kernel');
x=0:0.1:5;
kernpdf = kernest.pdf(x);
histogram(Pressure,'Normalization','pdf')
hold on;
plot(x,kernpdf

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by