ARMA Error

조회 수: 2 (최근 30일)
Karamos
Karamos 2011년 12월 29일
Hi all,
I am new in matlab and I am trying to create a simple ARMA(q,p) model which will estimate the best fit parameter automated and then predict the return of the following day. I have a stock daily prices(QQQ) and my code is below.
pr=price2ret(QQQ);
model=armax(pr(1:end-150),[1 2]);
mbest=pem(pr(end-150:end,model);
y = predict(model,pr);
plot(pr(151:end),y(151:end));
If I run this code it will give me a idpoly model(model) and a double 1x1 cell for y variable with an Error
??? Error using ==> plot
Conversion to double from cell is not possible.
I will really appreciate if someone could assist me on this error and give me an insight how can I compile this error! I had tried to use the compare function but it is also give me an error. Does anyone has a better ideas how can I find the best fit parameters for an ARMA model ???
Thanks in advance

답변 (2개)

Walter Roberson
Walter Roberson 2011년 12월 29일
The output yp is an iddata object containing the predicted values as OutputData.
Notice it is iddata, not a numeric array.
Perhaps you want to get(yp, 'OutputData') as described at http://www.mathworks.com/help/toolbox/ident/ref/iddata.html

Karamos
Karamos 2011년 12월 30일
Thank you for your response. I don't want the get function but to plot the prediction output and compare it with the actual time series. The problem is that the y is '1x1 cell' and not a double variable.
My code is almost identical with the example at http://www.mathworks.co.uk/help/toolbox/ident/ref/predict.html but I am not receiving the same format of the output data.

카테고리

Help CenterFile Exchange에서 Linear Model Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by