Generate random numbers with truncated Pareto distribution

조회 수: 9 (최근 30일)
C.G.
C.G. 2022년 11월 9일
편집: Bruno Luong 2022년 11월 9일
I am wanting to generate a series of random numbers from a truncated Pareto distribution. I can see there is a function in matlab for a generalized pareto, but is there a way to do a truncated Pareto?
  댓글 수: 1
Torsten
Torsten 2022년 11월 9일
Could you include the cumulative distribution function of the truncated Pareto distribution you are talking about ?
Is it
F(x) = (1-(a/x)^c) / (1-(a/b)^c)
for a <= x <= b ?

댓글을 달려면 로그인하십시오.

답변 (2개)

David Hill
David Hill 2022년 11월 9일
Just write a simple function
function x = ranPareto_trunc(H,L,alpha,n)%H=upper, L=lower, alpha>0, n=number of random numbers desired
u=rand(1,n);
x=(-(u*H^alpha-u*L^alpha-H^alpha)/H^alpha/L^alpha).^(-1/alpha);
end

Bruno Luong
Bruno Luong 2022년 11월 9일
편집: Bruno Luong 2022년 11월 9일
the pareto has bounded on the lower side by what they called xm.
So I introduce the upper bound
% up > xm
For the shape parameter alpha, r is N realization of conditiona pareto probability distribution such that r < up (bounded or truncated pareto) can be obtained as following
alpha = 2; % % distribution tail index parameter
xm = 1; % lower bound
up = 3; % upper bound
N = 1e6;
% Generate by method of inverse of cdf
a = 1-(xm/up)^alpha;
r = (1-a*rand(1,N)).^(-1/alpha)*xm;
% Graphic check
histogram(r, 'Normalization', 'pdf')

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by