Skip to content

Commit

Permalink
Added week 3 material
Browse files Browse the repository at this point in the history
  • Loading branch information
wmutschl committed Oct 25, 2024
1 parent 77749d9 commit d954b40
Show file tree
Hide file tree
Showing 13 changed files with 561 additions and 372 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/dynare-6.2-matlab-r2024b-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,14 @@ jobs:
definitionFrequenciesTimeSeriesData;
whiteNoisePlots;
plotsAR1;
- name: Run week 3 codes
uses: matlab-actions/run-command@v2
with:
command: |
addpath("Dynare-6.2-arm64/matlab");
cd("progs/matlab");
acfPlots_run;
lawOfLargeNumbers;
lawOfLargeNumbersAR1;
centralLimitDependentData;
11 changes: 11 additions & 0 deletions .github/workflows/dynare-6.2-matlab-r2024b-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,14 @@ jobs:
definitionFrequenciesTimeSeriesData;
whiteNoisePlots;
plotsAR1;
- name: Run week 3 codes
uses: matlab-actions/run-command@v2
with:
command: |
addpath("dynare/matlab");
cd("progs/matlab");
acfPlots_run;
lawOfLargeNumbers;
lawOfLargeNumbersAR1;
centralLimitDependentData;
11 changes: 11 additions & 0 deletions .github/workflows/dynare-6.2-matlab-r2024b-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,14 @@ jobs:
definitionFrequenciesTimeSeriesData;
whiteNoisePlots;
plotsAR1;
- name: Run week 3 codes
uses: matlab-actions/run-command@v2
with:
command: |
addpath("D:\hostedtoolcache\windows\dynare-6.0\matlab");
cd("progs/matlab");
acfPlots_run;
lawOfLargeNumbers;
lawOfLargeNumbersAR1;
centralLimitDependentData;
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ Please feel free to use this for teaching or learning purposes; however, taking

</details>

<!---

<details>
<summary>Week 3: Dependent time series data and the autoregressive process</summary>
Expand All @@ -81,14 +79,16 @@ Please feel free to use this for teaching or learning purposes; however, taking
### To Do

* [x] review the solutions of [last week's exercises](https://github.com/wmutschl/Quantitative-Macroeconomics/releases/latest/download/week_2.pdf) and write down all your questions.
* [x] read Lütkepohl (2004, Sec. 2.2, 2.3, 2.5.2), Lütkepohl (2005, Appendix C) and Bjørnland and Thorsrud (2015, Ch.1 and Ch.2); make note of all the aspects and concepts that you are not familiar with or that you find difficult to understand
* [x] read Lütkepohl (2004, Sec. 2.2, 2.3, 2.5.2) and Bjørnland and Thorsrud (2015, Ch.1 and Ch.2); make note of all the aspects and concepts that you are not familiar with or that you find difficult to understand
* [x] prepare exercise sheet 3: do exercises 1 and 3 at home, we'll do exercises 2 and 4 in class
* [x] participate in the Q&A sessions with all your questions and concerns
* [x] for immediate help: [schedule a meeting](https://schedule.mutschler.eu)
* [x] (optionally) checkout the short [Intermediate Git Video Tutorials from GitKraken](https://www.gitkraken.com/learn/git/tutorials#intermediate)

</details>

<!---
<details>
<summary>Week 4: Ordinary Least Squares (OLS) and Maximum Likelihood (ML) estimation of the autoregressive process</summary>
Expand Down
114 changes: 69 additions & 45 deletions exercises/central_limit_theorem_dependent_data.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,90 @@
Y_{t}-\mu =\phi \left(Y_{t-1}-\mu\right) +\varepsilon _{t}
\end{align*}
where \(\varepsilon _{t}\sim iid(0,\sigma _{\varepsilon }^{2})\) is
(not necessarily but in our case) normally distributed and \(|\phi |<1\).
(not necessarily but in our case) normally distributed and \(|\phi |<1\).

\begin{enumerate}
\item Briefly state and describe the intuition of the \enquote{Lindeberg-Levy Central Limit Theorem} for iid random variables.
\item
Briefly state and describe the intuition of the \enquote{Lindeberg-Levy Central Limit Theorem} for iid random variables.
What does \enquote{convergence in distribution} mean?
Why can we not use the theorem for the \(AR(1)\) process?
\item Show that \(Y_t\) has mean equal to \(\mu \) and finite variance equal to \(\sigma_\varepsilon^2/(1-\phi^2)\).

\item
Show that \(Y_t\) has mean equal to \(\mu \) and finite variance equal to \(\sigma_\varepsilon^2/(1-\phi^2)\).

\item To derive the asymptotic distribution of the sample mean, do the following steps:
\begin{enumerate}
\item Derive the asymptotic distribution of \(\frac{1}{\sqrt{T} } \sum_{t=1}^T \varepsilon_t\).
\item Show that
\begin{align*}
\frac{1}{\sqrt{T}} \sum_{t=1}^T \varepsilon_t = \sqrt{T}\left[(1-\phi)\left(\hat{\mu}-\mu\right) + \phi\left(\frac{Y_T - Y_0}{T}\right)\right]
\end{align*}
with \(\hat{\mu} =\frac{1}{T}\sum_{t=1}^{T}Y_{t}\).
\item Show that
\begin{align*}
\textsl{plim}\left[\frac{\phi}{1-\phi}\left(\frac{Y_T - Y_0}{\sqrt{T}}\right)\right] = 0
\end{align*}
\\\emph{Hint: Use Tchebychev's Inequality,
i.e.\ for a random variable \(X\) with expectation \(\mu_x\)
and finite variance \(\sigma_x^2\):}
\begin{align*}
\Pr(|X-\mu_x|> \delta) \leq \frac{\sigma_x^2}{\delta^2}
\end{align*}
\emph{for any small real number \(\delta>0\).}
\item Put your results of (a), (b) and (c) together and derive the asymptotic distribution of the sample mean.
That is, show that
\begin{align*}
Z_{T} =\sqrt{T}\frac{\hat{\mu} -\mu }{\sigma_Z} \overset{d}{\rightarrow} U \sim N(0,1)
\end{align*}
for \(\sigma_Z=\sqrt{\sigma_\varepsilon^2/(1-\phi)^2}\).
\item
Derive the asymptotic distribution of \(\frac{1}{\sqrt{T} } \sum_{t=1}^T \varepsilon_t\).

\item
Show that
\begin{align*}
\frac{1}{\sqrt{T}} \sum_{t=1}^T \varepsilon_t = \sqrt{T}\left[(1-\phi)\left(\hat{\mu}-\mu\right) + \phi\left(\frac{Y_T - Y_0}{T}\right)\right]
\end{align*}
with \(\hat{\mu} =\frac{1}{T}\sum_{t=1}^{T}Y_{t}\).

\item
Show that
\begin{align*}
\textsl{plim}\left[\frac{\phi}{1-\phi}\left(\frac{Y_T - Y_0}{\sqrt{T}}\right)\right] = 0
\end{align*}
\\
\emph{Hint: Use Tchebychev's Inequality,
i.e.\ for a random variable \(X\) with expectation \(\mu_x\)
and finite variance \(\sigma_x^2\):}
\begin{align*}
\Pr(|X-\mu_x|> \delta) \leq \frac{\sigma_x^2}{\delta^2}
\end{align*}
\emph{for any small real number \(\delta>0\).}

\item
Put your results of (a), (b) and (c) together and derive the asymptotic distribution of the sample mean.
That is, show that
\begin{align*}
Z_{T} =\sqrt{T}\frac{\hat{\mu} -\mu }{\sigma_Z} \overset{d}{\rightarrow} U \sim N(0,1)
\end{align*}
for \(\sigma_Z=\sqrt{\sigma_\varepsilon^2/{(1-\phi)}^2}\).
\end{enumerate}
\item Write a program to demonstrate the central limit theorem for the AR(1) process. To this end:

\item
Write a program to demonstrate the central limit theorem for the AR{(1)} process. To this end:

\begin{itemize}
\item Simulate \(B=5000\) stationary (e.g.\
\(\phi=0.8\)) AR(1) processes with each \(T=10000\) observations.
Store these in a \(T \times B\) matrix \(Y\).
\item Compute \(\hat{\mu}\) for each column of \(Y\).
\item Plot the histograms of the standardized variables according to the Lindeberg-Levy Central Limit Theorem:
\begin{align*}
\widetilde{Z}_T = \sqrt{T}\frac{\hat{\mu}-\mu}{\sigma_{\varepsilon }/\sqrt{1-\phi^2}}
\end{align*}
and of the correct standardized variables that we derived in 3(d):
\begin{align*}
Z_T = \sqrt{T}\frac{\hat{\mu}-\mu}{\sigma_{\varepsilon }/(1-\phi)}
\end{align*}
Compare the histograms to the standard normal distribution.

\item
Simulate \(B=5000\) stationary (e.g.\
\(\phi=0.8\)) AR{(1)} processes with each \(T=10000\) observations.
Store these in a \(T \times B\) matrix \(Y\).

\item
Compute \(\hat{\mu}\) for each column of \(Y\).

\item
Plot the histograms of the standardized variables according to the Lindeberg-Levy Central Limit Theorem:
\begin{align*}
\widetilde{Z}_T = \sqrt{T}\frac{\hat{\mu}-\mu}{\sigma_{\varepsilon }/\sqrt{1-\phi^2}}
\end{align*}
and of the correct standardized variables that we derived in 3(d):
\begin{align*}
Z_T = \sqrt{T}\frac{\hat{\mu}-\mu}{\sigma_{\varepsilon }/(1-\phi)}
\end{align*}
Compare the histograms to the standard normal distribution.

\end{itemize}

\end{enumerate}

\paragraph{Readings}
\begin{itemize}
\item \textcite{Crack.Ledoit_2010_CentralLimitTheorems}
\item \textcite[App. C]{Lutkepohl_2005_NewIntroductionMultiple}
\item \textcite[App. C]{Neusser_2016_TimeSeriesEconometrics}
\item \textcite[Ch. 5]{White_2001_AsymptoticTheoryEconometricians}
\item \textcite{Crack.Ledoit_2010_CentralLimitTheorems}
\item \textcite[App. C]{Lutkepohl_2005_NewIntroductionMultiple}
\item \textcite[App. C]{Neusser_2016_TimeSeriesEconometrics}
\item \textcite[Ch. 5]{White_2001_AsymptoticTheoryEconometricians}
\end{itemize}

\begin{solution}\textbf{Solution to \nameref{ex:CentralLimitTheoremDependentData}}
\ifDisplaySolutions
\ifDisplaySolutions%
\input{exercises/central_limit_theorem_dependent_data_solution.tex}
\fi
\newpage
Expand Down
Loading

0 comments on commit d954b40

Please sign in to comment.