Unexplained error using fitdist with Stable distro - help?
Show older comments
I am receiving an unusual error that I can't decode when using fitdist with the 'Stable' distribution option. I've tried troubleshooting by using different datasets and different distributions; the Normal works on the same data. I've used fitdist for stable distributions many times, though not with this release and not in the past 6 months. I've never encountered this error / difficulty before.
The error is:
"Unrecognized function or variable 'getIpOptions'.
Error in fmincon (line 832)
options = getIpOptions(options,sizes.nVar,mEq,flags.constr,defaultopt,10,0.01);
Error in prob.StableDistribution>stablefit (line 1318)
[parmhat,~,err,output] = fmincon(@(params)stable_nloglf(x,params),phi0, ...
Error in prob.StableDistribution.fit (line 211)
params = stablefit(x,0.05,opt);
Error in fitdist>localfit (line 245)
pd = feval(fitter,x,'cens',c,'freq',f,varargin{:});
Error in fitdist (line 192)
pd = localfit(dist,fitter,x,cens,freq,args{:});"
Code that works is:
load hospital;
z = hospital.Weights;
pd = fitdist (z,'Normal');
This generates the error:
pd2 = fitdist(z,'Stable');
Is this a bug in r2020a? I have a copy of Nolan's stablefit toolbox and it fits the same data without throwing an error and with the following result:
>> stablefit(z,1,0)
ans =
2.0000 -0.0214 18.6947 154.0000
1 Comment
Ameer Hamza
on 8 Apr 2020
I am using R2020a and not getting any error.
>> pd2 = fitdist(z,'Stable');
Warning: Maximum likelihood estimate of the shape parameter ALPHA has converged
to a boundary point.
Confidence intervals and standard errors can not be computed reliably.
> In prob.StableDistribution>stablelike (line 1186)
In prob/StableDistribution/fit (line 212)
In fitdist>localfit (line 245)
In fitdist (line 192)
>> pd2
pd2 =
StableDistribution
Stable distribution
alpha = 2 [0, 2]
beta = 0.988294 [-1, 1]
gam = 18.7061 [0, Inf]
delta = 154.031 [-Inf, Inf]
The solution is also pretty close to your solution from stablefit, except for the beta parameter.
Accepted Answer
More Answers (0)
Categories
Find more on Exploration and Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!