Scale beta distribution in a given interval
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Cladio Andrea
el 21 de Feb. de 2015
Respondida: Rajesh Chandrasekaran
el 19 de Ag. de 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 comentarios
Respuesta aceptada
Greig
el 22 de Feb. de 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.
Más respuestas (1)
Rajesh Chandrasekaran
el 19 de Ag. de 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 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!