Autoregressive model using Yule-Walker method
12 次查看(过去 30 天)
显示 更早的评论
Hi everyone.
I'm trying to find autoregressive coefficients for the signal using Yule-Walker method and Levinson-Durbin recursions, and then compute power spectral density of the signal. I have found aryule function which can "estimate autoregressive model". But aryule function needs order of the AR model. And what if I don't know what order is better. How can I calculate order of convergence?
0 个评论
回答(1 个)
Wayne King
2012-7-26
编辑:Wayne King
2012-7-26
You have to specify the order. One thing you can do is to specify a high order and return the reflection coefficients. The negative of the reflection coefficients is the partial autocorrelation function. The partial autocorrelation function will decay to zero at what is essentially the optimal AR order.
For example, I create an AR(2) process, but fit an AR(15) model. Then I'll look at the partial autocorrelation function.
A = [1 1.5 0.75];
x = filter(1,A,randn(1000,1));
[arcoefs,E,K] = aryule(x,15);
pacf = -K;
lag = 1:15;
stem(lag,pacf)
You see that the PACF essentially decays to zero after lag 2. That shows that an AR(2) model would be the best.
If you want you can easily construct approximate 95% confidence intervals to help in determining when the PACF values are not significantly different from 0.
stem(lag,pacf,'markerfacecolor',[0 0 1]);
xlabel('Lag'); ylabel('Partial Autocorrelation');
set(gca,'xtick',1:1:15)
lconf = -1.96/sqrt(1000)*ones(length(lag),1);
uconf = 1.96/sqrt(1000)*ones(length(lag),1);
hold on;
line(lag,lconf,'color',[1 0 0]);
line(lag,uconf,'color',[1 0 0]);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!