generating random numbers from mixed beta gamma distribution
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (1)
Jeff Miller
am 25 Jan. 2019
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 Kommentare
Jeff Miller
am 26 Jan. 2019
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.
Siehe auch
Kategorien
Mehr zu Beta Distribution finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!