How can i sample from a distribution already fitted with allfitdist?

1 回表示 (過去 30 日間)
EM geo
EM geo 2019 年 1 月 24 日
コメント済み: EM geo 2019 年 1 月 25 日
I want to find the best fitting of a variable distribution (the second column of the matrix D) using the function "allfitdist". I find the best one that is the generalized pareto. Now i want to save this result in a structure and then i want to randomly sample 10000 times from this result. I'm using this code:
[Ddg2 PDdg2] = allfitdist(D(:,2),'cdf')
My(2).result = PDdg2{1,1} %generalized pareto
output = random(My(2).result,10000)
Something is weard because in the output i get a really big matrix. Maybe i'm wrong in the second raw of the code, when i select the generalized pareto from PDdg2.
Someone can help me? I've attached the data and the function.

採用された回答

Jeff Miller
Jeff Miller 2019 年 1 月 25 日
Try
output = random(My(2).result,10000,1)
Your command gives a 10000 x 10000 output matrix.

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by