Plot of Probability Density function in MATLAB

85 ビュー (過去 30 日間)
subho
subho 2011 年 12 月 8 日
回答済み: cheng wei chen 2022 年 3 月 15 日
I have time series data.I want to see the plot of PDF.For this, in MATLAB,I have to mention the name of the PDF-type like 'norm'.All PDF types are continuous line.But,I need discrete PDF data points plot.

採用された回答

Wayne King
Wayne King 2011 年 12 月 8 日
Are you sure that you need a discrete PDF? You have not specified that your time series takes on values only in a discrete set, e.g. {0,1}.
Just because you have a discrete-time process, it can very well be that you should model the random variables as continuous.
For example:
x = randn(100,1);
gives a realization of a discrete-time white Gaussian noise process, but it is not a discrete random variable.
Do you have a specific pdf that you would like to assess for your data?
You can always use ksdensity to estimate the pdf
x = randn(100,1);
[f,xi] = ksdensity(x);
plot(xi,f);
If you want to see if your data follow a certain distribution, see histfit, or dfittool

その他の回答 (3 件)

Keerthivasan Rajamani
Keerthivasan Rajamani 2017 年 11 月 2 日
Maybe this could be helpful to consider:
histogram(variable_name,'Normalization','probability')

Daniel Shub
Daniel Shub 2011 年 12 月 8 日
The pdf function can handle binomial, Poisson, and discrete uniform distributions, so not all of them are continuous.
Also are you sure you don't just want to do:
hist(x)
where x is your data?

cheng wei chen
cheng wei chen 2022 年 3 月 15 日
不知道

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by