Scale beta distribution in a given interval
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Cladio Andrea
le 21 Fév 2015
Réponse apportée : Rajesh Chandrasekaran
le 19 Août 2022
Hello everyone, i have a beta distribution
X = 0:.01:1;
y1 = betapdf(X,3,4);
figure
plot(X,y1,'Color','r','LineWidth',2)
but as you know it is in betwneen [0,1] second , but i want to rescale it, i want to change interval lets say to [0,60]. Can you help me please?
0 commentaires
Réponse acceptée
Greig
le 22 Fév 2015
For a standard Beta distribution, our random variate x, exists in the range 0 to 1.
First we start with a transformed variable, y = X(q - p) + p, which exists from p to q. If we let and b, represent the shape parameters (alpha and beta) of a Beta distribution and B(a,b) is the beta function
PDF = ( (y-p)^(a-1) * (q - y)^(b-1) ) / ( (q - p)^(a+b+1) * B(a,b) )
So here is a quick function that should do the trick...
function PDF = Scaled_BetaPDF(y, a, b, p, q)
PDF = ( (y-p).^(a-1) .* (q - y).^(b-1) ) ./ ( (q - p).^(a+b-1) .* beta(a,b) );
So try
X = 0:.01:60;
y1 = betapdf(X,3,4);
y2=Scaled_BetaPDF(X, 3, 4, 0, 60);
and compare.
Plus de réponses (1)
Rajesh Chandrasekaran
le 19 Août 2022
Please check the above solution:
It should be
PDF = ( (y-p)^(a-1) * (q - y)^(b-1) ) / ( (q - p)^(a+b-2) * B(a,b) )
0 commentaires
Voir également
Catégories
En savoir plus sur Descriptive Statistics and Visualization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!