Catching errors when estimating ARIMA model
이전 댓글 표시
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
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Conditional Mean Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!