how do I determine the probability distribution of data?
조회 수: 9 (최근 30일)
이전 댓글 표시
Hello, I have a data set and I am trying to determine its probability distribution. It is from empirical data and I have no idea what distribution family it would have, let alone what parameters it would have. Is there a matlab function that can do that?
댓글 수: 0
답변 (2개)
Richard Willey
2012년 3월 29일
Sorry if this sounds like a silly question:
Is there an absolute requirement that you describe your data using a parametric distribution? If so why?
As an alternative, would something like the following suffice?
%%Generate some data
X1 = 10 + 5 * randn(200, 1);
X2 = 20 + 8 * randn(250 ,1);
X = [X1; X2];
%%Fit a distribution using a kernel smoother
myFit = fitdist(X, 'kernel')
%%Visualize the resulting fit
index = linspace(min(X), max(X), 1000);
plot(index, pdf(myFit, index))
%%Generate a set of 500 random numbers drawn from the distribution
numbers = random(myFit, 500, 1);
numbers(1:10)
%%Inspect the complete set of methods for myFit
methods(myFit)
댓글 수: 4
John
2012년 4월 13일
Hello Richard,
I am looking at your code. This is probably a silly question but what is it actually doing? Does it help you find the probability distribution of data?
I've commented in the rely below - but I don't know if you would get notified of it?
Thank you
John
Tom Lane
2012년 4월 13일
His example produces a nonparametric density estimate that should be flexible enough to adapt to your data. It doesn't produce a named parametric distribution (normal, Weibull, etc.).
Doug
2012년 3월 29일
댓글 수: 5
John
2012년 4월 13일
Hello,
I would also like to know if there is a way to determine the probability distribution of data. I would like to use an inbuilt function but it requires the distribution names and it also requires other input parameters such as shape and scale. It kinda hard to use the function if you don't have these inputs?
Thank you
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!