fitdist error with Generalized Pareto Distribution

2 views (last 30 days)
Hello,
I am generating some arbitrary data and trying to fit it to the generalized Pareto distribution (see below). I am also getting the error below. Since this distribution has a location parameter I should be allowed to have negative values for data. I am not sure why I am getting the error message however. Thank you for your help.
clear; for j=1:100 if rand <=0.6 TestData(j,1) = normrnd(0,2); else TestData(j,1) = normrnd(4,2); end end
% Fit Generalized Pareto Distribution pd07 = fitdist(TestData,'GeneralizedPareto');
Error Message:
Error using prob.GeneralizedParetoDistribution>localgpfit (line 242) The data in X must be greater than the threshold parameter.
Error in prob.GeneralizedParetoDistribution.fit (line 187) params = localgpfit(x,theta,0.05,opt);
Error in fitdist>localfit (line 231) pd = feval(fitter,x,'cens',c,'freq',f,varargin{:});
Error in fitdist (line 178) pd = localfit(dist,fitter,x,cens,freq,args{:});
Error in BurrTest (line 11) pd07 = fitdist(TestData,'GeneralizedPareto')

Answers (0)

Community Treasure Hunt

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

Start Hunting!