How to fit trapezoid distribution?
1 回表示 (過去 30 日間)
古いコメントを表示
Dear Matlab community,
please help about my problem.
I am running Monte Carlo (MC) simulation and it is obvious that output value is distributed as trapezoid distribution (resulting from two uniform distributions). I have to fit this distribution to the data so I can use that distribution as input value to the next MC simulation. The most commonly used tools, such as dfittool, do not contain predefined trapezoid distribution so I have to find another solution.
Is there any idea how to solve it?
Best regards and thanks in advance,
Ivan
0 件のコメント
回答 (1 件)
Ambrosio Valencia-Romero
2016 年 11 月 29 日
Use function trapmf as:
p = trapmf(r,[a b c d]);
with r as your uniformly distributed random number, and a <= r <= d.
You can generate r with the rand function as follows:
r = a + (d - a)*rand;
I hope it works for you.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!