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

2 次查看(过去 30 天)
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