Catching errors when estimating ARIMA model
Afficher commentaires plus anciens
Hello: I have the following code that tries to fit an ARMA(1,0,1) to a time series. I want to put AR coefficients in a vector, but when the estimation doesn't have an AR term, the code shows a 'Subscripted assignment dimension mismatch'. How can I use a try... catch to solve this error? I think if I know the name of the error - see line 8 in code - I might be able to catch it
Thanks!
for i=1 : m-Min_Days-1
[EstARIMA,EstParamCov] = estimate(arima(1,0,1),y(1:i+Min_Days),'E0',y(1));
exp_mean(i,1)=forecast(EstARIMA,1)*252;
exp_mean;
try
parameters6(i,1)=cell2mat(EstARIMA.AR);
catch ME
if HOW DO I NAME THE ERROR??
msg = 'No AR';
causeException = MException('MATLAB:myCode:dimensions',msg);
ME = addCause(ME,causeException);
end
rethrow(ME)
end
end
Réponses (0)
Catégories
En savoir plus sur Conditional Mean Models dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!