generating random numbers from mixed beta gamma distribution

Hi I want to create custom distribution (mixed distribution ) between beta and gamma then
generate random numbers from this distribution
is there a specific code for that??
Thanks in advance

답변 (1개)

Jeff Miller
Jeff Miller 2019년 1월 25일
Here is one way to do this with Cupid
% Create a custom mixture distribution:
% Use whatever distribution parameters and mixture probability you want.
mybeta = Beta(5.3,4.1);
mygamma = RNGamma(17,10);
mycustom = Mixture(.3,mybeta,.7,mygamma); % .3 is the probability of mybeta
mycustom.PlotDens; % Plot the PDF and CDF of the custom distribution
myrands = mycustom.Random(100,1); % generate 100 random numbers.

댓글 수: 5

Cupid? Its not even Valentine's day yet.
"Continuous Univariate Probability Distributions"
Even though there are some discrete ones in there, I didn't want to call it "STandard Univariate Probability Distributions".
Hi
It gives undefined function or variable 'Mixture'
any suggestion will be helpful
thanks in advance
There must be some problem with the download/installation from GitHub. Do you see the file Mixture.m in the same folder with Beta.m and RNGamma.m (and all the other files)? You should. Also, MATLAB must see these files, you must either point MATLAB to this folder or put this folder on the MATLAB path.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Probability Density Functions에 대해 자세히 알아보기

질문:

2019년 1월 25일

댓글:

2019년 1월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by