Why Do MATLAB AR Coefficients Differ from Online Examples?

  • Thread starter verd
  • Start date
  • Tags
    Matlab
In summary, the conversation discusses using MATLAB to generate AR coefficients for time series prediction/forecasting. The individual is following an example from a website, but when using MATLAB's functions, the coefficients are different and not as accurate in predicting the signal. The potential reasons for this discrepancy are discussed, including differences in methods and algorithms, and the suggestion to double check code and try different orders or methods for generating the coefficients.
  • #1
verd
146
0
Hi.

So I'm trying to do prediction/forecasting with a simple time series in MATLAB. But I'm having a bit of trouble with the AR coefficients.

So as a baseline, I've been trying to follow the example on this website:
http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/ar/

In the first example, for the 3rd order example, they provide coefficients that look like:
2.753231 -2.740306 0.985501

But when I use MATLAB to generate the AR coefficients, using aryule or arburg, I get something completely different:
1.0000 -1.8242 0.9365

So when I loop something like:
x(t)=a(1)*x(t-1)+a(2)*x(t-2)+a(3)*x(t-3)
with the AR coefficients given to me at the above URL, I get a good prediction of the signal. But when I use MATLAB's coefficients (provided both from aryule and arburg) I get something that's not even close to the original signal.

So I was just wondering what I'm doing wrong? Am I using aryule/arburg incorrectly?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2


Hi there,

It sounds like you are on the right track with using MATLAB's aryule and arburg functions to generate AR coefficients. However, it is important to note that different methods may produce slightly different coefficients due to differences in algorithms and implementation.

One possible explanation for the differences you are seeing is that the example on the website you mentioned may be using a different method or algorithm for generating the AR coefficients. It may be helpful to reach out to the author of the website or consult the documentation for their specific method to see if there are any differences.

Additionally, it is always a good idea to double check your code and make sure you are using the functions correctly. You can also try using different orders or methods for generating the AR coefficients to see if that affects the accuracy of your predictions.

I hope this helps and good luck with your time series forecasting!
 

FAQ: Why Do MATLAB AR Coefficients Differ from Online Examples?

What is AR Forecasting in MATLAB?

AR (Autoregressive) Forecasting in MATLAB is a statistical technique used to predict future values of a time series based on its past values. It uses an algorithm to identify patterns and trends in the data and uses that information to make accurate predictions about future values.

How does AR Forecasting work in MATLAB?

AR Forecasting in MATLAB uses a mathematical model to analyze the data and identify any patterns or trends. It then uses this information to generate a forecast of future values. This process involves selecting the appropriate model, estimating the model parameters, and evaluating the model's performance.

What are the key benefits of using AR Forecasting in MATLAB?

There are several benefits of using AR Forecasting in MATLAB, including its ability to handle large and complex datasets, its high accuracy in predicting future values, and its flexibility in adjusting to different types of data and models. Additionally, MATLAB has a user-friendly interface and provides various tools for data visualization and analysis, making the forecasting process easier and more efficient.

What are some common applications of AR Forecasting in MATLAB?

AR Forecasting in MATLAB is commonly used in various fields, such as finance, economics, engineering, and meteorology. Some specific applications include forecasting stock prices, predicting economic trends, modeling and predicting traffic patterns, and predicting weather conditions.

Are there any limitations to AR Forecasting in MATLAB?

While AR Forecasting in MATLAB is a powerful tool, it also has its limitations. It assumes that the data follows a specific pattern and may not work well for non-linear or highly volatile data. Additionally, it may not perform well if the dataset is too small or contains missing values. Therefore, it is important to carefully consider the data and the model selection before using AR Forecasting in MATLAB.

Similar threads

Back
Top