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!