0% found this document useful (0 votes)
36 views

Data Analysis Activity 2

This document summarizes the results of analyzing a time series dataset using autoregressive (AR) modeling techniques. The time series is found to be stationary with some cyclical behavior. An AR(6) model is identified as best fitting the data based on AIC and BIC values. The coefficients and standard errors of the AR(6) model are reported. Finally, the roots of the characteristic polynomial are analyzed and the third pair of complex conjugate roots is found to dominate the behavior of the time series.

Uploaded by

IncreDABels
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Data Analysis Activity 2

This document summarizes the results of analyzing a time series dataset using autoregressive (AR) modeling techniques. The time series is found to be stationary with some cyclical behavior. An AR(6) model is identified as best fitting the data based on AIC and BIC values. The coefficients and standard errors of the AR(6) model are reported. Finally, the roots of the characteristic polynomial are analyzed and the third pair of complex conjugate roots is found to dominate the behavior of the time series.

Uploaded by

IncreDABels
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Jay Kapoor

STAT 4534
Dr. Marco Ferreira

Data Analysis Activity 2

Task 1

- Yes, this is a stationary time series

- There are no notable trends, mostly because it’s a stationary time series.

- Yes, we can observe some cyclical behaviour in the time series plot. We can observe the
lines squeeze and expand in harmony, sort of making a pattern. Similarly, the farthest
points are in middle and they decrease as the graph moves left/right.

- There is no apparent heteroscedasticity in the time series plot.

Task 2

- The order of the Auto-regressive model can be 6, due to the values which cut off the PACF lag.
Task 3

- Order favoured by the AIC is 6, as the 6th value is 0, which is the lowest.

- Order favoured by the BIC is 6 as the 6th value is 29.5, which is the lowest.

- The order for AIC and BIC coincide with each other, And we will use order 6 for our AR
model.

Task 4

Coefficients of the AR model :


1 2 3 4 5 6
0.4563 0.1629 -0.1232 -0.1273 -0.1292 -0.2173

Standard Errors of estimates:

Task 5

- All 3 pairs of roots are complex conjugates.

- The third pair of conjugate is dominating the behaviour. The reason being the modulus of
third pair is closest to 1.
Appendix

#Jay Kapoor
#Stat 4534 Time Series Analysis

eeg<-scan("eeg.dat")

# Task 1

library(astsa)
library(polynom)

# simulate data
set.seed(54321)
eeg.simulate <- sarima.sim(ar=c(0.38, 0.12, -0.09, -0.11,
-0.12, -0.26), n = 500)

# Plot the data


tsplot(eeg.simulate)

#Task 2

# Plot the sample ACF


acf(eeg.simulate,lag.max=50)

# Plot the sample PACF


pacf(eeg.simulate,lag.max=50)

# Task 3

# Compute AIC
ord.max = 20
eeg.simulate.model <-
ar(eeg.simulate,order.max=ord.max,aic=TRUE,method="mle")
eeg.simulate.model$aic

# Compute BIC
n = length(eeg.simulate)
eeg.simulate.BIC <- eeg.simulate.model$aic - 2*((0:ord.max)+1)
+ log(n) * ((0:ord.max)+1)
eeg.simulate.BIC # Choose model with smallest BIC
# BIC = Bayesian Information Criterion

# Task 4

# Fit an AR(6) model with maximum likelihood


eeg.simulate.model6 <-
ar(eeg.simulate,order.max=6,aic=FALSE,method="mle")
eeg.simulate.model6

# Task 5

charac.polyn.coeff <- c(1, -eeg.simulate.model6$ar)


charac.polyn.coeff

# Characteristic polynomial
charac.polyn <- polynomial(charac.polyn.coeff)
charac.polyn

# Find the roots of the characteristic polynomial


charac.polyn.roots <- solve(charac.polyn)
charac.polyn.roots

# Compute moduli (absolute values) of the roots and reciprocal


roots of the characteristic polynomial
modulus.roots <- Mod(charac.polyn.roots)
modulus.recipr.roots <- 1/Mod(charac.polyn.roots)

modulus.recipr.roots

# Compute argument of the roots and reciprocal roots of the


characteristic polynomial
omega <- Arg(charac.polyn.roots)
omega

# Compute the wavelength or period:


wavelength <- 2 * pi / abs(omega)
wavelength

You might also like