0% found this document useful (0 votes)
16 views5 pages

AR Model Estimation Exercises in R

The document outlines a tutorial for estimating parameters in autoregressive models (AR(1) and AR(2)) using various methods such as method of moments, conditional least squares, and maximum likelihood estimates. It includes exercises that require simulations in R, parameter estimation for a dataset from Deere & Co., and comparisons between AR(1) and AR(2) models. The answers provide specific estimations and confidence intervals for the parameters involved.

Uploaded by

raniaasaoudd
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views5 pages

AR Model Estimation Exercises in R

The document outlines a tutorial for estimating parameters in autoregressive models (AR(1) and AR(2)) using various methods such as method of moments, conditional least squares, and maximum likelihood estimates. It includes exercises that require simulations in R, parameter estimation for a dataset from Deere & Co., and comparisons between AR(1) and AR(2) models. The answers provide specific estimations and confidence intervals for the parameters involved.

Uploaded by

raniaasaoudd
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2023-2024

University of Tunis Tunis Business School


Spring session

Tutorial 5
Estimation

Exercise 1

From a series of length 100, we have computed r1  0.8 and r2  0.5 . Assume that an AR(2)

model is appropriate, find consistent estimates for 1 and 2 using the method of moments.

Exercise 2

Use R to simulate an AR(1) series with  = 0.8 and n = 48.


1. Find an estimator for  using method of moments, conditional least squares, and the
maximum likelihood estimates.
2. What estimator would you choose ?

Exercise 3

Use R to simulate an AR(2) series with 1  0.6 , 2  0.3 , and n = 60.

3. Find an estimators for of 1 and  2 using the method of moments, the conditional

least squares estimates, and the maximum likelihood estimates.


What estimators would you choose ?

Exercise 4

The data file named deere3 contains 57 consecutive values from a complex machine tool at
Deere & Co. The values given are deviations from a target value units of ten millionths of an
inch. The process employs a control mechanism that resets some of the parameters of the
machine tool depending on the magnitude of deviation from target of the last item produced.
1) Estimate the parameters of an AR(1) model for this series.
2) Estimate the parameters of an AR(2) model for this series and compare the results
with those in 1).

1
Answers
Exercise 1

r1  0.8 and r2  0.5

Using the method of moments we have:

 ˆ r1 1  r2 
1  ˆ1  1.1
 1  r12
  
ˆ  r2  r1 ˆ2  0.39
2

 2 1  r12

Exercise 2

> [Link](4321); series=[Link](n=48,list(ar=0.8))


1)
> ar(series,aic=F,[Link]=1,method='yw') # yw stands for Yule-Walker

The output:

ˆ1  0.8285 .
2)
> arima(series,order=c(1,0,0),method='CSS')

The output:

The fitted AR(1) model, using CLS is:


Yt  1.2810  0.8367 Yt 1  1.2810   et

2
Or, equivalently Yt  0.2092  0.8367Yt 1  et

The white noise variance estimate using CLS is ˆ e2  0.5971 .

> arima(series,order=c(1,0,0),method='ML')

The output:

The fitted AR(1) model, using ML is:


Yt  0.8652  0.8495 Yt 1  0.8652   et
Or, equivalently Yt  0.1302  0.8495Yt 1  et
The white noise variance estimate using ML is ˆ e2  0.6044 .

Exercise 3

> [Link](12345); series=[Link](n=60,list(ar=c(0.6,0.3)))

1)
> ar(series,aic=F,[Link]=2,method='yw')

The output:

ˆ1  0.5423 and ˆ2  0.3161 .


2)
> arima(series,order=c(2,0,0),method='CSS')

The output:

3
The fitted AR(2) model, using CLS is:
Yt  1.4562  0.7731Yt 1  1.4562   0.0376 Yt 2  1.4562   et
Or, equivalently Yt  0.2757  0.7731Yt 1  0.0376Yt  2  et

The white noise variance estimate is ˆ e2  0.5534 .


3)
>arima(series,order=c(2,0,0),method='ML')

The output:

The fitted AR(2) model, using ML is:


Yt  0.8392  0.8157 Yt 1  0.8392   0.0408 Yt 2  0.8392   et
Or, equivalently Yt  0.1204  0.8157Yt 1  0.0408Yt  2  et

The white noise variance estimate is ˆ e2  0.6034

Exercise 4

1)
>library(TSA)

>data(deere3); arima(deere3,order=c(1,0,0))

The output:

4
ˆ1  0.5255

An approximate 95 % confidence interval for 1 is:


0.5255  1.96  0.1108   0.3083,0.7427 
This interval does not include 0, indicating that 1 is significantly different from zero.
2)
> arima(deere3,order=c(2,0,0))
The output:

ˆ1  0.5211 and ˆ2  0.0083


An approximate 95 % confidence interval for  2 is:
0.0083  1.96  0.1315    0.2494,0.2660 

This interval does include 0, indicating that  2 is not statistically different from 0. So, the AR(1)
model still looks good.

Common questions

Powered by AI

Yule-Walker equations are often preferred when dealing with samples where computational simplicity and speed are essential, such as larger time series, given their closed-form solutions and straightforward implementation for autocorrelation matrices. They are particularly useful when rapid initial estimates are needed or as starting values for more computationally intensive methods like MLE . However, they might be less reliable under model misspecification or non-stationarity .

The white noise variance estimate provides information about the goodness of fit of the model, where a lower variance suggests a better fit. For instance, the AR(1) model using ML had a white noise variance of \( 0.6044 \), suggesting a slightly better fit compared to CLS, which was \( 0.5971 \). In model comparisons, such disparities can indicate how well the model captures the underlying process noise .

For an AR(2) series with \( \phi_1 = 0.6 \) and \( \phi_2 = 0.3 \), the estimates using Yule-Walker are \( \phi_1 = 0.5423 \), \( \phi_2 = 0.3161 \), CLS gives \( \phi_1 = 0.7731 \), \( \phi_2 = 0.0376 \), and ML provides \( \phi_1 = 0.8157 \), \( \phi_2 = 0.0408 \). While no estimation is perfect, ML estimation typically offers the most accurate results due to its consistency and efficiency given a large enough sample size .

The control mechanism in the machine tool data set impacts the analysis as it may induce structural breaks or non-stationarity due to resetting actions, affecting parameter estimations and model selection. The mechanism responds to deviations from the target, potentially altering the data-generating process through adjustments, thus complicating statistical modeling procedures . In such contexts, analyzing the appropriateness of applied models like AR(1) or AR(2) gains importance in understanding the process dynamics .

The method of moments relies on sample moment matches and may not address the model's likelihood, while maximum likelihood estimation optimizes a probability-based objective for parameter values. Discrepancies often arise because maximum likelihood estimates inherently account for the structure and likelihood of the data, often yielding more accurate and consistent estimates in large samples . Furthermore, MLE's bias decreases with increased sample size, in contrast to method-of-moments .

Confidence intervals are crucial for validating parameter estimates by providing the range within which the true parameter likely falls. For instance, a 95% confidence interval for \( \phi_1 \) in the AR(1) model of the 'deere3' dataset was \( [0.3083, 0.7427] \), indicating that \( \phi_1 \) is significantly different from zero . If a confidence interval includes zero, the parameter might not significantly contribute to the model .

The AR(1) model is still considered effective for the 'deere3' dataset because the 95% confidence interval for the AR(2) model's second parameter includes zero, indicating that \( \phi_2 \) is not statistically different from zero. This means the inclusion of \( \phi_2 \) does not significantly improve the model, and thus the simpler AR(1) model is favored .

Conditional least squares (CLS) estimations in AR models take advantage of conditional expectations of lagged variables, simplifying computation while potentially offering efficiency when assumptions for MLE are violated or computational resources are limited. CLS estimates can also handle cases with smaller sample sizes or non-normal innovations where MLE might struggle due to its asymptotic reliance .

For an AR(1) series with \( \phi = 0.8 \) and \( n = 48 \), the method of moments estimate is \( 0.8285 \), CLS is \( 0.8367 \), and ML is \( 0.8495 \). Considering the trade-off between bias and variance, maximum likelihood estimation often provides the most reliable estimate for \( \phi \) due to its asymptotic properties, thus making it a suitable choice if the sample size is reasonable .

The method of moments can be used by setting the sample autocorrelations equal to their expectations. For an AR(2) model, if \( r_1 = 0.8 \) and \( r_2 = 0.5 \), the method of moments estimates \( \phi_1 \) and \( \phi_2 \) as solutions to the equations \( \phi_1 = r_1 + r_2\phi_1 \) and \( \phi_2 = r_2 \times \phi_2 \), leading to \( \phi_1 \approx 1.1 \) and \( \phi_2 \approx -0.39 \).

You might also like