%% regARIMA Optimization Options
%% Specify and simulate

Mdl0 = regARIMA('AR',0.5,'Intercept',0,'Variance',1);
rng(1); % For reproducibility
y = simulate(Mdl0,25);

%
%% Set optimization options

options = optimoptions(@fmincon,'Diagnostics','on','Algorithm',...
    'sqp','Display','off','ConstraintTolerance',1e-7)
% @fmincon is the function handle for fmincon

%
%% Fit the model to data

Mdl = regARIMA(1,0,0);
EstMdl = estimate(Mdl,y,'Options',options);

% Copyright 2012 The MathWorks, Inc.