필터 지우기
필터 지우기

compare vs forecast with models

조회 수: 2 (최근 30일)
s.p4m
s.p4m 2016년 9월 13일
댓글: s.p4m 2016년 9월 26일
I'm using ARMA-models to predict a signal. My signal is a timeseries with n points;
input = iddata(signal,[],Ts);
My model is an ARMA-model with p=10 and q=10;
model = armax(input,[10 10]);
After I build my model, I use the compare command to check the performance of my model for 1-step-ahead predictions
[y,fit,xo] = compare(model,input,1);
I also use the forecast command to check the performance of my model
for k = 1:length(input.y)-10
x(k,1) = forecast(model,input.y(k:k+9),1);
end
Both commands check 1-step-ahead forecast, if I'm not mistaken. But when I compare the results from both, they are not equal.
plot(y.y(11:end));
hold on
plot(x);
So here is my question: How come that compare and forecast give two different answers.

채택된 답변

Fei Deng
Fei Deng 2016년 9월 21일
Hi, It is my understanding that you built a ARMA model based on the signal you have and you used function 'compare' and 'forecast' to evaluate the ARAM model. You want the predicted/evaluated output value at time t to be predicted using values in measured output data (input.y) up to time t-1. In order to do that, in the loop you have, change
x(k,1) = forecast(model,input.y(k:k+9),1);
to
x(k,1) = forecast(model,input.y(1:k+9),1);
otherwise, the predicted value at time t will be obtained based on each 10 values in input.y before time t.
If you still don’t get equal results that you expected, here are two suggestions:
1) Check the differences and consider if they are reasonable error by white-noise disturbance value in the model.
2) Consider if the sampling rate is enough for your data.
  댓글 수: 2
s.p4m
s.p4m 2016년 9월 22일
편집: s.p4m 2016년 9월 22일
Thank you for your input. You a right my loop is there so I make prediction based on the last 10 values in input.y. But since my ARMA-model only consider the last 10 values, why should I consider more. The parameter of the model are set in:
model = armax(input,[10 10]);
and won't change after that.
For your 2 suggestions:
2) Doesn't matter, because right now I'm not interested in a good forecast but rather want to understand why the outputs are different.
1) This could be the reason. I will check it and come back
s.p4m
s.p4m 2016년 9월 26일
I just checked if the white noise process could be the reason but the difference is far to big.
But I also checked your Input about using all past data instead of only the last 10 and you're right. When changing
x(k,1) = forecast(model,input.y(k:k+9),1);
to
x(k,1) = forecast(model,input.y(1:k+9),1);
the output from forecast and compare are the same. Could you explain the reason for this, because I thought the model only consider the last 10 entries and the parameter were fix.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conditional Mean Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by