# Estimate the error variance of Autoregressive model

• emmasaunders12
In summary: I think you want to divide by 6.In summary, the conversation discusses the estimation of the variance of the white noise input in a vector AR(1) model. The first method mentioned involves using the residual of the model fit, but it is found to give different results when tested in MATLAB. The use of the aryule function is also mentioned, which estimates both the value of A and the variance of e_t. It is suggested that the method used in the conversation may not be the best approach for estimating the variance of the noise, and a PDF is provided for further understanding. There is also a discussion about the potential errors in the calculation of the variance.
emmasaunders12
Hi everyone, hopefully someone can help

For an vector AR(1) model of the form

y(t)=Ay(t-1) + et

How does one estimate the variance of the white noise input. I was under the impression that one can simply use the residual of the model fit and estimate the variance from this, when I do a simple simulation in MATLAB however I get very different results

%A small MATLAB
%simulated data

y=[1 2 4 8 16 32 64 128];

%remove mean for yule walker

y=y-repmat(mean(y),1,8);
[ar_coeffs err] = aryule(y,1);

%gives an estimate of the error variance as 1.3985e+003
inity=y(1);
estY(:,1)=inity;
for i=2:8
estY(:,i)=-ar_coeffs(2:end)*estY(i-1);
end
resid=y-estY;
var=sqrt((sum(resid.^2))/8-1);

Now variance in error = 38.3082 very different from before

Can anyone enlighten me, am I calculating the variance in the error correctly?

Thanks

Emma

emmasaunders12 said:
var=sqrt((sum(resid.^2))/8-1);

This looks like an estimate of the standard deviation, not the variance.

Also you method sets the first prediction equal to the first datum, so that residual is forced to be zero. You only have 7 samples that are useful for estimating the variance of the noise. If you used the unbiased estimator of the variance, you'd divide by 7-1 instead of 8-1.

I don't see where your code defines the array estY.

Hi stephen thanks for the help,

Emitting the first estimated term and using:

var=((sum(resid(2:end).^2)/7-1));

gives me 1.6773e+003, not 1.3985e+003 reported by matlab, have you any idea where I am going wrong?

Thanks

Emma

I wouldn't expect the aryule function to give the same result as your method. The aryule function estimates both the value of A and the variance of e_t from the data. Your method assumes the value A is known and estimates the variance of e_t from the data.

I haven't studied the details of how aryule works. I think we could figure them out from something like this PDF http://www.google.com/url?sa=t&rct=...LkMzAAr2z1c67pA&bvm=bv.60983673,d.aWM&cad=rja

I think aryule finds the numbers that make the predictions of the model give the best "least squares" fit to the data Those numbers might not be the ones that make the model exactly match the data at t = 1.

I am suspicious of the way you subtract the mean of the y's. Doesn't that make all the early y's negative and the later y's positive? A model Y(t) = A*Y(t-1) would be hard to fit to data that changes sign that way. Seems like your original data should have given a perfect fit of Y(t) = 2 * Y(t-1) with no errors.

In your calculation of var, put parentheses around (7-1). You are dividing by 7 and subtracting 1 from the result.

## What is an autoregressive model?

An autoregressive model is a statistical model that uses past values of a variable to predict its future values. It assumes that the current value of the variable is related to its past values through a linear combination of previous observations and an error term.

## Why is it important to estimate the error variance of an autoregressive model?

Estimating the error variance of an autoregressive model is important because it allows us to assess the accuracy and reliability of the model's predictions. It also helps us to identify any potential issues or outliers in the data that may affect the model's performance.

## How do you estimate the error variance of an autoregressive model?

The error variance of an autoregressive model can be estimated using various methods, such as maximum likelihood estimation or the Yule-Walker equations. These methods involve fitting the model to the data and calculating the sum of squared residuals, which represents the error variance.

## What factors can affect the error variance of an autoregressive model?

The error variance of an autoregressive model can be affected by various factors, such as the order of the model, the choice of lagged variables, and the presence of outliers or missing data. It can also be influenced by the underlying data generating process and the assumptions made about the model.

## How can you interpret the error variance of an autoregressive model?

The error variance of an autoregressive model can be interpreted as the amount of variation in the data that is not explained by the model. A lower error variance indicates a better fit of the model to the data, while a higher error variance suggests that the model may not be capturing all the important factors influencing the variable being studied.

• Set Theory, Logic, Probability, Statistics
Replies
23
Views
3K
• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
17
Views
2K
• Set Theory, Logic, Probability, Statistics
Replies
2
Views
953
• Calculus and Beyond Homework Help
Replies
0
Views
414
• Set Theory, Logic, Probability, Statistics
Replies
4
Views
5K
• Introductory Physics Homework Help
Replies
2
Views
2K
• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
9
Views
2K
• Set Theory, Logic, Probability, Statistics
Replies
2
Views
3K