Scale beta distribution in a given interval
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Cladio Andrea
am 21 Feb. 2015
Beantwortet: Rajesh Chandrasekaran
am 19 Aug. 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 Kommentare
Akzeptierte Antwort
Greig
am 22 Feb. 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.
Weitere Antworten (1)
Rajesh Chandrasekaran
am 19 Aug. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Descriptive Statistics and Visualization 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!