%------------------------------------------------------------------------------
%\documentclass[reqno]{amsart}
\documentclass[12pt]{amsart}
%\setcounter{page}{6}
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage[colorlinks=true, urlcolor=blue]{hyperref}
\usepackage{amssymb}
\usepackage{amsmath,mathrsfs}
%\oddsidemargin -0in \evensidemargin .5in
%\topmargin=1.25in
%\headheight 10pt \headsep 10pt \footheight 10pt \footskip 24pt
%\textheight 10in \textwidth 6.5in \columnsep 10pt \columnseprule 0pt
%\font\namefont=cmr10 scaled\magstep2
\font\namefont=cmr8 scaled\magstep2
\newcommand{\myindent}{\leftskip=.4in}
%\voffset=-.75in
\parskip=11pt %extra vertical distance for new paragraph
\parindent=0in
%\newtheorem{theorem}{Theorem}[section]
%\newtheorem{lemma}[theorem]{Lemma}
%\newtheorem{lemma}{Lemma}[section]
%\newtheorem{theorem}{Theorem}[section]
%\newtheorem{lemma}[theorem]{Lemma}
%\newtheorem{prop}[theorem]{Proposition}
%\newtheorem{cor}[theorem]{Corollary}
%\newtheorem{conj}{Conjecture}
\usepackage{graphicx}
\usepackage{color}
\usepackage{subfigure}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{colonequals}
\usepackage{hyperref}
%\usepackage{showlabels}
%\usepackage[all]{xypic}
%\entrymodifiers={+!!<0pt,\fontdimen22\textfont2>}
\theoremstyle{definition}
\newtheorem{exercise}{Exercise}
\newtheorem{remark}{Remark}
\renewcommand{\setminus}{\smallsetminus}
\addtolength{\footskip}{17pt}
%\numberwithin{table}{section}
\renewcommand{\subset}{\subseteq}
\renewcommand{\supset}{\supseteq}
\renewcommand{\epsilon}{\varepsilon}
\newcommand{\abs}[1]{\left|#1\right|} % Absolute value notation
\newcommand{\absf}[1]{|#1|} % small absolute value signs
\newcommand{\vnorm}[1]{\left|\left|#1\right|\right|} % norm notation
\newcommand{\vnormf}[1]{||#1||} % norm notation, forced to be small
\newcommand{\im}[1]{\mbox{im}#1} % Pieces of English for math mode
\newcommand{\tr}[1]{\mbox{tr}#1}
\newcommand{\Proj}[1]{\mbox{Proj}#1}
\newcommand{\Vol}[1]{\mbox{Vol}#1}
\newcommand{\Z}{\mathbf{Z}} % Blackboard notation
\newcommand{\N}{\mathbf{N}}
\newcommand{\E}{\mathbf{E}}
\renewcommand{\P}{\mathbf{P}}
\newcommand{\R}{\mathbf{R}}
\newcommand{\C}{\mathbf{C}}
\newcommand{\Q}{\mathbf{Q}}
\newcommand{\figoneawidth}{.5\textwidth} % Image formatting parameters
\newcommand{\lbreak}{\\} % Linebreak
\newcommand{\italicize}[1]{\textit {#1}} % formatting commands for bibliography
%\newcommand{\embolden}[1]{\textbf {#1}}
\newcommand{\embolden}[1]{{#1}}
\newcommand{\undline}[1]{\underline {#1}}
\newcommand{\e}{\varepsilon}
\renewcommand{\epsilon}{\varepsilon}
\renewcommand{\Re}{\mathrm{Re}}
%\renewcommand{\colonequals}{=}
\thispagestyle{empty}
\begin{document}
\bigskip
Graduate Time Series \hfill Steven Heilman\\
\noindent\rule{6.5in}{0.4pt}
%\vspace{.2cm}
Please provide complete and well-written solutions to the following exercises.
Due May 1, at the beginning of class.
\vspace{.5cm}
\begin{center}
{\Large Homework 6}
\end{center}
\vspace{.5cm}
\begin{exercise}
Suppose we have a real-valued AR$(p)$ process of the form
$$X_{n}=\sum_{j=1}^{p}a_{j}X_{n-j}+Z_{n},\qquad\forall\,n\in\Z,$$
where $\{Z_{n}\}_{n\in\Z}$ are $WN(0,\sigma^{2})$ and $0<\sigma<\infty$. Show that the Gaussian likelihood $\ell(a_{1},\ldots,a_{p},\sigma)$ takes the form
$$\ell(a_{1},\ldots,a_{p},\sigma)=(2\pi\sigma^{2})^{-n/2}(\mathrm{det}(G_{p}))^{-1/2}\exp\Big(-\frac{1}{2\sigma^{2}}\Big[ X^{T}G_{p}^{-1}X+\sum_{t=p+1}^{n}(X_{t}-\sum_{j=1}^{p}a_{j}X_{t-j})^{2}\Big]\Big),$$
where
$$X\colonequals(X_{1},\ldots,X_{p})^{T},\qquad G_{p}=\frac{1}{\sigma^{2}}\E XX^{T}.$$
\end{exercise}
\begin{exercise}[Financial Data Analysis]
In this exercise, we will attempt to model financial data by ARMA processes. You can create a spreadsheet of financial data if you open up a spreadsheet in google, and input the following command into one of the cells in the spreadsheet (and then press enter):
\begin{verbatim}
=GOOGLEFINANCE("GOOG", "price", "1/1/2010", "12/31/2019", "DAILY")
\end{verbatim}
The first argument in the command is the stock price ticker symbol (which corresponds to google stock). The closing price of the stock is then listed every day, starting from January 1st, 2010, and ending on December 31st, 2019. Once you have the spreadsheet data, you should be able to import it into Matlab or your favorite mathematical software.
Since stock prices generally increase in the long term, they are probably not weakly stationary (as their expected value is not constant). Moreover, stock prices change in a way that is proportional to their value. So, if $X_{t}$ is a stock price on day $t$, we anticipate that the logarithmically differenced value
$$Y_{n}\colonequals\log(X_{n+1}/X_{n})=\log X_{n+1}-\log X_{n}\qquad(*)$$
could be a weakly stationary ARMA process. Let's try to fit data like this to such a model.
(Logarithmic differencing to get a weakly stationary process is also reasonable since a typical model of a stock price in discrete time is $W_{n}=e^{Z_{n}}$, where $Z_{1},Z_{2},\ldots$ is a random walk, so that $\log(W_{n+1}/W_{n})$ is a sequence of independent random variables.)
$\bullet$ First, take the Google stock closing price from all of 2009 through all of 2019, and examine $Y_{n}$ versus $n$ (where $n$ is the day of the year, neglecting weekend days; so e.g. $n=6$ is the sixth non-weekend day of 2009). Use both (i) the innovation estimators (from Definition 9.12 in the notes, which then imply estimates for the $a$ and $b$ parameters in the ARMA process) and (ii) the Gaussian maximum likelihood estimators. (Recall from the notes that the order $m$ of the innovation estimators should satisfy $m=o(n^{1/3})$ in order to be consistent, and we have $n\approx 2\cdot 10^{3}$, so you should not take $m$ larger than about $14$ in order to have a consistent estimator. Moreover, with $m\leq 14$, you should also restrict $p,q$ to be at most $14$. )
%%should probably correct for the mean?
$\bullet$ A classic barometer of US economy is the ten year US treasury note yield. You can access this data with the command
\begin{verbatim}
=GOOGLEFINANCE("TNX", "price", DATE(2010,1,1), DATE(2019,12,31), "DAILY")
\end{verbatim}
A discrete version of Vasicek interest rate model is
$$X_{n+1}-X_{n}=a(b-X_{n})+Z_{n},\qquad\forall\,n\in\Z.$$
where $a,b$ are unknown parameters. So, let's try to see if the interest rate is autoregressive or not. Try to fit an autoregressive model AR$(p)$ to the interest rate data. That is, use the Yule-Walker estimators for the autoregressive parameters. Examine the values of the partial autocorrelation function, to try to determine a good value of $p$ for the model.
Use both (i) the innovation estimators (from Definition 9.12 in the notes, which then imply estimates for the $a$ and $b$ parameters in the ARMA process) and (ii) the Gaussian maximum likelihood estimators. Does the order selection (AICC) estimator of $p,q$ agree with your findings? (Examine the data itself, do not do any logarithmic differencing.)
\end{exercise}
\begin{exercise}[\embolden{Sunspot Data, Version 3}]
This exercise deals with sunspot data from the following files (the same data appears in different formats)
\href{http://www.sidc.be/silso/DATA/SN_d_tot_V2.0.txt}{txt file}\qquad\qquad\qquad\href{http://www.sidc.be/silso/INFO/sndtotcsv.php}{csv (excel) file}
These files are taken from \href{http://www.sidc.be/silso/datafiles#total}{http://www.sidc.be/silso/datafiles\#total}
To work with this data, e.g. in Matlab you can use the command
\begin{verbatim}
x=importdata('SN_d_tot_V2.0.txt')
\end{verbatim}
to import the .txt file.
The format of the data is as follows.
\begin{itemize}
\item Columns 1-3: Gregorian calendar date (Year, Month, then Day)
\item Column 4: Date in fraction of year
\item Column 5: Daily total number of sunspots observed on the sun. A value of -1 indicates that no number is available for that day (missing value).
\item Column 6: Daily standard deviation of the input sunspot numbers from individual stations.
\item Column 7: Number of observations used to compute the daily value.
\item Column 8: Definitive/provisional indicator. A blank indicates that the value is definitive. A '*' symbol indicates that the value is still provisional and is subject to a possible revision (Usually the last 3 to 6 months)
\end{itemize}
In two previous exercises, we examined the number of sunspots $U_{t}$ at time $t$, where $t$ is measured in years. In the previous exercise, we took the Fourier transform of $U$, and defined
$$\widehat{U}(r)\colonequals\sum_{t\in\Z/365}U_{t}e^{2\pi itr},\qquad\forall\,r\in\R/365\Z.$$
We found that the seasonal component of $U$ closely matched the following function of $t\in\Z/365$
$$
S_{t}\colonequals \frac{1}{365}\int_{.08}^{.105}\widehat{U}(r)e^{-2\pi irt}dr+\frac{1}{365}\int_{-.105}^{-.08}\widehat{U}(r)e^{-2\pi irt}dr.
$$
We also found that the trend component of $U$ closely matched the following function of $t\in\Z/365$
$$
M_{t}\colonequals\frac{1}{365}\int_{-.016}^{.016}\widehat{U}(r)e^{-2\pi irt}dr.
$$
In this exercise, we will try to model $U_{t}$, and $U_{t}-S_{t}-M_{t}$, as ARMA processes.
$\bullet$ First, try to fit an autoregressive model AR$(p)$ to $U_{t}$. That is, use the Yule-Walker estimators for the autoregressive parameters. Examine the values of the partial autocorrelation function, to try to determine a good value of $p$ for the model.
$\bullet$ Now, in order to see whether or not this process really is autoregressive, model it as a general ARMA process, and use both (i) the innovation estimators (from Definition 9.12 in the notes, which then imply estimates for the $a$ and $b$ parameters in the ARMA process) and (ii) the Gaussian maximum likelihood estimators. Do these estimators suggest that the process is autoregressive?
$\bullet$ Give another estimate for $p,q$ using AICC, then create a MLARMA spectral density estimate.
$\bullet$ Do all steps above for $U_{t}-S_{t}-M_{t}$, instead of $U_{t}$.
\end{exercise}
\end{document}