(1) mdl = arima(1,0,0);
(2) est = estimate(mdl,pinfobs);
(3) table1 = cell2mat(est.AR);
line (1) mdl 이라는 AR(1) 모형을 정의했음
line (2) mdl이라는 모형에 pinfobs라는 데이터를 넣어서 estimate라는 함수를 돌린 결과를 est에 저장했음. est에는 추정결과가 들어가 있음. 예를 들어 est.AR (cell 형태)에는 AR coefficient가 들어가 있음.
line (3) 은 추정결과를 table1이라는 매트릭스에 넣음. cell2mat는 cell을 matrix로 전환한 것임
다른 예
만약 AR(3) 모형이라면?
mdl = arima(3,0,0);
est = estimate(mdl,pinfobs);
table1.arI = cell2mat(est.AR);
이 경우 table1.arI 라는 메트릭스는 1 by 3 matrix가 됨!