MATLAB Answers

How to generate random numbers between min and max value with gevrnd?I

17 views (last 30 days)
snr matlb
snr matlb on 30 Jun 2020
Commented: snr matlb on 2 Jul 2020
I have 16 value with distributed by generalized extreme value. I have k, sigma and mu of this data. I want to increase the data with this distribution between 20 and 21. How can I do it, may I get your help with code sharing?
Thanks

  4 Comments

Show 1 older comment
Walter Roberson
Walter Roberson on 1 Jul 2020
Do I understand properly that currently you have the situation where you have a continuous distribution that includes the range 20 to 21, and that you would like to create a new distribution with increased probability between 20 and 21? If the probability from -inf to 20 is currently p1, and the probability from 20 to 21 is p2, and the probability from 21 to infinity is currently p3, that instead of that [p1, p2, p3] situation, you would like a situation where middle section was C times higher, so your distribution would be in sections with probabilities
[(C*p2 - 1)/(p2 - 1) * p1, C*p2, (C*p2 - 1)/(p2 - 1) * p3]
??
If so then note that the pdf would no longer be continuous and that the sigma and mu would change.
snr matlb
snr matlb on 1 Jul 2020
Actually, I have a data which is distributed generalized extreme value. The data between 18-20. I have k, sigma and mu of this data. Now, I want to generate random numbers with this k,sigma and mu (with same distribution) but between 20 and 21.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 1 Jul 2020
truncate() the distribution. That will automatically re-scale the pdf so that the probability integral over the given range becomes 1.

  11 Comments

Show 8 older comments
Walter Roberson
Walter Roberson on 1 Jul 2020
Is there any difference between to increase number of jobs in each hour or generate new jobs into a new hour pie.
In some circumstances the difference can be important. As you add more jobs within a deadline, then especially with exponential job times, you might need to go to finer and finer resolution to theoretically fit them -- ending up with situations where milliseconds or nanonseconds are important to meet the deadlines. In practice you probably cannot get millisecond switching, but it would not be uncommon for people to neglect switching time in economic dispatch models.
snr matlb
snr matlb on 2 Jul 2020
Actually, if I expand hour pies to provide some overcapacities I may get some delay to solve, not miliseconds actually working with minutes. So, I will expand the data but some how with trying to save the distribution as real data to based on real data for further generated. It is better that pure generated numbers I think.
snr matlb
snr matlb on 2 Jul 2020
Unfortınately, I know I have to make some tune to make them provide some constraints to keep the data tuned with mathematical model constraints.

Sign in to comment.

More Answers (0)


Translated by