Question 1 (a) estimate the series variance: \(\gamma_0\) The data are:

x <- c(-3, 2, -4, -5, 6, -2)
mu_hat <- mean(x)
mu_hat
## [1] -1

Compute the unbiased variance:

dev <- x - mu_hat
gamma0_hat <- sum(dev^2)/(length(x)-1)
gamma0_hat
## [1] 17.6

(b)Estimate the autocorrelation at lag 1: ρ1

rho1_hat <- sum(dev[-length(dev)] * dev[-1]) / sum(dev^2)
rho1_hat
## [1] -0.4318182

(c)Assuming that the data arise from an MA(1) with drift μ such that xt = μ + εt − θ1εt−1 Calculate a method-of-moments estimate of θ1.

rho1 <- as.numeric(rho1_hat)
theta_roots <- polyroot(c(rho1, 1, rho1))
theta_roots
## [1] 0.5741823+8.077936e-28i 1.7416072-8.077936e-28i

For MA(1) |θ|< 1

theta_hat <- Re(theta_roots[abs(Re(theta_roots))<1])
theta_hat
## [1] 0.5741823
  1. Now instead assume that the data arise from an AR(1) with drift such that xt = μ + φ1xt−1 + εt Estimate the parameter φ1 using method of moments.
phi1_mom <- rho1_hat
phi1_mom
## [1] -0.4318182
  1. Estimate φ1 using least squares (still using that μ = x ̄, the mean of x).
num <- sum(x[-length(x)] * (x[-1] - mu_hat))
den <- sum(x[-length(x)]^2)
phi1_ls <- num / den
phi1_ls
## [1] -0.4444444

Question 2 (a) Adequacy based on residual ACF and PACF plots From the plots:

AR(1) residual ACF shows a significant spike at lag 2 → not adequate.

AR(2) residual ACF/PACF show no significant spikes → adequate.

MA(6) residual ACF/PACF show no significant spikes → also adequate

  1. Choice between Model 2 (AR(2)) and Model 3 (MA(6)) Based on the coefficient significance output:

AR(2): both coefficients are highly significant (p < 0.001).

MA(6): one coefficient (ma4) is not significant (p = 0.83).

We should prefer the model with significant parameters and minimal complexity.

Choose Model 2 (AR(2)) because it is both adequate and more parsimonious

3.Consider an MA(1) Xt = εt − θ1εt−1 time series.

  1. Find the Information for a one-step forecast
# random parameter
theta <- 0.6      
rho1 <- -theta / (1 + theta^2)
beta <- rho1
mse_min <- (1 - rho1^2)
I1 <- rho1^2
I1_formula <- theta^2 / (1 + theta^2)^2

For an MA(1), only lag 1 is correlated, so the optimal linear predictor uses \(X_n\): \(\widehat X_n(1) = \rho_1 X_n\). The minimum mean squared error is \(Var(X_{n+1})(1 - \rho_1^2)\), hence \(I_{X_{n+1}|X_n,\dots,X_1} = \rho_1^2 = \dfrac{\theta^2}{(1+\theta^2)^2}\).

  1. Find the Information for a two-step forecast
I2 <- 0

For an MA(1), \(ρ_h = 0\) for all \(h ≥ 2\). That means \(X_{n+2}\) is uncorrelated with all past values. The best predictor is just the mean (0 for a centered series), so \(I_{X_{n+2}|X_n,\dots,X_1} = 0.\)

  1. Comment on the difference between the results in the previous two parts, with reference to the ACF function.

One-step ahead: information \(I₁ = ρ_1^2 = θ^2 / (1+θ^2)^2\) because \(ρ_1 ≠ 0\).

Two-step ahead: information \(I₂ = 0\) because \(ρ_h = 0\) for \(h ≥ 2\). An MA(1) process contains linear dependence only at lag 1, so it has predictive power one step ahead but none beyond that. This behaviour matches exactly the ACF pattern of a MA(1)