A general procedure to sample from continuous distributions
>> alpha=5;N=1000;
parCDF=@(x,alpha) 1-(1+x).^-alpha;
parICDF=@(x,alpha) (1-x).^(-1/alpha) - 1
Xi=linspace(0,1,N);
plot(Xi, parCDF(Xi,alpha) )
hold on
plot(parICDF(Xi,alpha), Xi, ’r--’)
axis([0 3 0 1]);
parICDF =
function_handle with value:
@(x,alpha)(1-x).^(-1/alpha)-1
>> alpha=5;N=1000;
parCDF=@(x,alpha) 1-(1+x).^-alpha;
parICDF=@(x,alpha) (1-x).^(-1/alpha) - 1
Xi=linspace(0,1,N);
plot(Xi, parCDF(Xi,alpha) )
hold on
plot(parICDF(Xi,alpha), Xi, ’r--’)
axis([0 3 0 1]);
parICDF =
function_handle with value:
@(x,alpha)(1-x).^(-1/alpha)-1
0 Comments