Caution
Section omitted to comply with the Honor Code
Time Series Analysis
Oren Bochman
November 5, 2024
time series, AR(p) process, reciprocal roots, characteristic polynomial, forecast function, autocorrelation function, R code
Section omitted to comply with the Honor Code
---
date: 2024-11-05
title: "Quiz: Properties of AR processes"
subtitle: Time Series Analysis
description: "The AR(P) process, its state-space representation, the characteristic polynomial, and the forecast function"
categories:
- Bayesian Time Series
keywords:
- time series
- AR(p) process
- reciprocal roots
- characteristic polynomial
- forecast function
- autocorrelation function
- R code
jupyter: python3
---
::::: {.content-visible unless-profile="HC"}
::: {.callout-caution}
Section omitted to comply with the Honor Code
:::
:::::
::::: {.content-hidden unless-profile="HC"}
::: {#exr-1 }
Consider the following $AR(2)$ process,
$Y_t = 0.5 Y_{t-1} + 0.24 Y_{t-2} + \epsilon_t \qquad \epsilon_t \sim \mathcal{N}(0,v).$
Give the value of one of the reciprocal roots of this process.
:::
::: {.solution}
we first need to find the roots of the characteristic polynomial
$$
1 - 0.5 z - 0.24 z^2 = 0
$$ {#eq-char-poly-q1}
```{python}
import numpy as np
# AR coefficients: Y_t = φ1 * Y_{t-1} + φ2 * Y_{t-2} + ε_t
phi = np.array([0.5, 0.24])
# Characteristic polynomial: z^2 - φ1*z - φ2 = 0
roots = np.roots([1, -phi[0], -phi[1]])
print(roots)
```
One of the reciprocal roots of the $AR(2)$ process is $0.8$.
:::
::: {#exr-2 }
Assume the reciprocal roots of an $AR(2)$ process are $0.7$ and $-0.2$. Which is the corresponding form of the autocorrelation function $\rho(h)$ of this process?
:::
::: {.solution}
- [ ] $\rho(h) = (a+bh)0.7^h, \quad h > 0$ where $a$ and $b$ are constants.
- [ ] $\rho(h) = (a+bh)0.3^h, \quad h > 0$ where $a$ and $b$ are constants.
- [ ] $\rho(h) = (a+bh)(0.3^h + 0.7^h), \quad h > 0$ where $a$ and $b$ are constants.
- [x] $\rho(h) = a(0.7)^h + b(-0.3)^h, \quad h > 0$ where $a$ and $b$ are constants.
:::
::: {#exr-3 }
Assume that an $AR(2)$ process has a pair of complex reciprocal roots with modulus $r=0.95$ and period $\lambda=7.1$.
Which following options corresponds to the correct form of its autocorrelation function, $\rho(h)$?
:::
::: {.solution}
- [ ] $\rho(h) = a(0.95)^h \cos(7.1h + b), \quad h > 0$ where $a$ and $b$ are constants.
- [x] $\rho(h) = a(0.95)^h \cos(2\pi h / 7.1 + b), \quad h > 0$ where $a$ and $b$ are constants.
- [ ] $\rho(h) = a(0.95)^h, \quad h > 0$ where $a$ and $b$ are constants.
- [ ] $\rho(h) = (a + bh)(0.95)^h, \quad h > 0$ where $a$ and $b$ are constants.
:::
::: {#exr-4 }
Given the following $AR(2)$ process,
$Y_t = 0.5Y_{t-1} + 0.36Y_{t-2} + \epsilon_t, \quad \epsilon_t \sim \mathcal{N}(0, v)$
The $h=3$ steps-ahead forecast function $f_t(3)$ has the following form:
:::
::: {.solution}
- [X] $f_t(3) = c_{1t}(0.9)^3 + c_{2t}(-0.4)^3$ for $c_{1t}$ and $c_{2t}$ constants.
- [ ] $f_t(3)= c_{1t} (3)^{0.9} + c_{2t} (3)^{-0.4}$ for $c_{1t}$ and $c_{2t}$ constants.
- [ ] $f_t(3)= c_{1t} (1.1)^3 + c_{2t} (-2.5)^3$ for $c_{1t}$ and $c_{2t}$ constants.
- [ ] $f_t(3)= (0.9)^3 (c_{1t}+ c_{2t}3)$ for $c_{1t}$ and $c_{2t}$ constants.
we have the following characteristic polynomial
$1 - 0.5z - 0.36z^2 = 0$
```{python}
import numpy as np
# AR coefficients: Y_t = φ1 * Y_{t-1} + φ2 * Y_{t-2} + ε_t
phi = np.array([0.5, 0.36])
# Characteristic polynomial: z^2 - φ1*z - φ2 = 0
roots = np.roots([1, -phi[0], -phi[1]])
print(roots)
#reciprocals = 1 / roots
#print(reciprocals)
```
i.e. the reciprocal roots are approximately $1.11$ and $-2.5$.
these give us a forecast function of the form
$$
f_t(h) = c_{1t} (1.11)^h + c_{2t} (-2.5)^h
$$
:::
:::::