MATLAB Answers

fitdist error with Generalized Pareto Distribution

6 views (last 30 days)
dsmalenb
dsmalenb on 20 Mar 2016
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')

  0 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.