ARMA Error

8 ビュー (過去 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 Center および File ExchangeGet Started with System Identification Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by