ARMA Error
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Model Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!