MATLAB Error fitting Stable distribution to data - Help?

3 次查看(过去 30 天)
MATLAB returns an unknown error every time I try to fit the Stable distribution to a dataset. I haven't encountered this error with previous datasets or MATLAB versions, but it has been 6 months since I've tried. This time I've used multiple data sets and confirmed that a Normal distribution will fit the datasets...but when I specify 'Stable' vice 'Normal', I get the following error:
"Unrecognized function or variable 'getIpOptions'.
Error in fmincon (line 832)
options =
getIpOptions(options,sizes.nVar,mEq,flags.constr,defaultopt,10,0.01);"
This code runs:
load hospital; % get MATLAB dataset
z = hospital.Weight; % Assign data values
pd = fitdist(z,'Normal');
However, this doesn't and returns the above error:
pd2 = fitdist(z,'Stable');
Is this a bug in the 2020a release?
I'm running:
>> version
ans = '9.8.0.1323502 (R2020a)'

回答(1 个)

colordepth
colordepth 2025-3-10
Optimization Toolbox is required for using the 'Stable' distribution with 'fitdist'. If the toolbox is already installed, I suggest re-installing it and trying again. Refer to the following related discussions for more information and workarounds if Optimization Toolbox is not available:
  1. https://www.mathworks.com/matlabcentral/answers/491764-unrecognized-function-or-variable-getipoptions#comment_1889150
  2. https://www.mathworks.com/matlabcentral/answers/545267-error-in-fmincon-getipoptions-is-coming-as-unrecognized-function-or-variable#comment_894665

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by