aryule
The parameters of the autoregression model with all poles are the Yule—Walker method.
| Library |
|
Arguments
Examples
Estimation of parameters using the Yule—Walker method
Details
We use the vector of coefficients of the generating polynomial to generate the process by filtering 1024 white noise samples. Reset the random number generator to get reproducible results. We use the Yule—Walker method to estimate the coefficients.
import EngeeDSP.Functions: randn,filter,aryule
A = [1 -2.7607 3.8106 -2.6535 0.9238]
y = filter(1,A,0.2*randn(1024,1))
arcoeffs = aryule(y,4)[1]
1×5 Matrix{Float64}:
1.0 -2.72272 3.71925 -2.56306 0.886621
Generate 50 implementations of the process, changing the variance of the input noise each time. Let’s compare the variance calculated using the Yule—Walker method with the actual values.
nrealiz = 50
order = 4
noisestdz = rand(1, nrealiz) .+ 0.5
randnoise = randn(1024, nrealiz)
noisevar = zeros(1, nrealiz)
for k in 1:nrealiz
y = filter(ones(1), A, noisestdz[k] * randnoise[:, k])
arcoeffs,noisevar[k],e = aryule(y, order)
end
p=scatter(vec(noisestdz.^2), vec(noisevar),
marker=:x,
markerstrokecolor=:blue,
xlabel="Input",
ylabel="Estimated",
title="Noise Variance",
label="Single channel loop",
legend=false)

Let’s repeat the procedure using the multi-channel syntax of the function.
Y = filter(1,A,noisestdz.*randnoise)
coeffs,variances,e = aryule(Y,4)
scatter!(p,noisestdz.^2, variances,
marker=:circle,
markercolor=:transparent,
markerstrokecolor=:green,
markersize=10)

Additional Info
An autoregression model of the order of p
Details
In the autoregression model of the order ( ) the current output is a linear combination of the previous ones outputs plus a white noise input signal.
Weights on previous ones The outputs minimize the average quadratic error of the autoregression prediction. If — this is the current output value, and — this is an input signal with zero average white noise, then the model it has the form: