Scale beta distribution in a given interval
15 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Greig
2015-2-22
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.
更多回答(1 个)
Rajesh Chandrasekaran
2022-8-19
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!