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

1 visualización (últimos 30 días)
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.

Respuesta aceptada

Jeff Miller
Jeff Miller el 25 de En. de 2019
Try
output = random(My(2).result,10000,1)
Your command gives a 10000 x 10000 output matrix.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by