Data Analysis Activity 2
Data Analysis Activity 2
STAT 4534
Dr. Marco Ferreira
Task 1
- 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.
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
Task 5
- 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)
#Task 2
# 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
# Task 5
# Characteristic polynomial
charac.polyn <- polynomial(charac.polyn.coeff)
charac.polyn
modulus.recipr.roots