\documentclass{beamer}
\usetheme{Madrid}
\usepackage{tikz}
\usepackage{datetime}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{tcolorbox}
\tcbuselibrary{skins, breakable}

\newdate{nextTuesday}{26}{08}{2025}

\title{ECON 4530/5530 \\ Computational Economics}
\author{Alex Gebben}
\date{\displaydate{nextTuesday}}

\begin{document}

% Title Slide
\begin{frame}
  \titlepage
\end{frame}

% Contact Info Slide
\begin{frame}{Contact Information}
\begin{tcolorbox}[
  enhanced,
  colback=blue!5,
  colframe=blue!60!black,
  boxrule=0.8pt,
  arc=4pt,
  width=\textwidth,
  title=\textbf{Instructor: Alex Gebben (AG)},
  fonttitle=\bfseries,
  breakable
]
\begin{itemize}
  \item \textbf{Office:} BU 362
  \item \textbf{Email:} \texttt{agebben@uwyo.edu}
  \item \textbf{Phone:} 307-766-4136
  \item \textbf{Office Hours:} Monday \& Wednesday 1:00–2:30
\end{itemize}
\end{tcolorbox}
\end{frame}
\begin{frame}{Class Structure}
	Learn to create economic reports using computational methods
	\newline
	\begin{enumerate}
		\item{Intro to programming with data management in mind}
		\item{R and analysis}
		\item{Python and machine learning}
	\end{enumerate}
	You will understand the basics of R, Python and GAMS and when to use them. 
\end{frame}

\begin{frame}{Assignments}
	\begin{enumerate}
		\item{In class work}
		\item{\(\approx\) Weekly homework}
		\item{Final project}
	\end{enumerate}
	The final project will involve a economic impact analysis using data you have collected.
\end{frame}

% Workflow Diagram Slide
\begin{frame}{Steps of an Economic Analysis}
\centering
\begin{tikzpicture}[
  node distance=1.5cm and 2.5cm,
  every node/.style={draw, rounded corners, text centered, minimum width=3.8cm, minimum height=1cm, font=\small},
  designstyle/.style={fill=blue!20},
  datastyle/.style={fill=orange!20},
  analysisstyle/.style={fill=teal!20},
  reportstyle/.style={fill=yellow!40, thick, draw=black, font=\bfseries}
]

  % Fixed layout with overlays
  \onslide<1->{\node[designstyle] (q) at (-3,1.8) {Economic Question};}
  \onslide<2->{\node[designstyle] (sd) at (-3,0) {Strategy and Design};}
  \onslide<3->{\node[datastyle] (dc) at (-3,-1.8) {Data Collection};}
  \onslide<4->{\node[datastyle] (clean) at (-3,-3.6) {Data Cleaning};}
  \onslide<5->{\node[analysisstyle] (explore) at (3,0.9) {Exploration};}
  \onslide<6->{\node[analysisstyle] (analysis) at (3,-0.9) {Analysis};}
  \onslide<7->{\node[reportstyle] (report) at (3,-2.7) {Final Report and Figures};}

  % Solid arrows
  \onslide<2->{\draw[->, thick] (q) -- (sd);}
  \onslide<3->{\draw[->, thick] (sd) -- (dc);}
  \onslide<4->{\draw[->, thick] (dc) -- (clean);}
  \onslide<5->{
    \draw[->, thick]
      (clean.east) -- ++(1.5,0)
      |- (explore.west);
  }
  \onslide<6->{\draw[->, thick] (explore) -- (analysis);}
  \onslide<7->{\draw[->, thick] (analysis) -- (report);}

  % Dashed feedback arrow: Exploration → Economic Question
  \onslide<8->{
    \draw[->, thick, dashed]
      (explore.north) -- ++(0,1.2) -- ++(-6.0,0) -- (q.north);
  }

  % Dashed feedback arrow: Data Collection → Strategy and Design (right-angled, clean)
  \onslide<9->{
    \draw[->, thick, dashed]
      (dc.east) -- ++(1.2,0) -- ++(0,1.8) -- ++(-0.6,0) -- (sd.east);
  }

\end{tikzpicture}
\end{frame}


%%%%%%%
\begin{frame}{Economic Question}
\centering
\begin{columns}
	\begin{column}{0.5\textwidth}

\begin{tikzpicture}[
  node distance=1.5cm and 2.5cm,
  every node/.style={draw, rounded corners, text centered, minimum width=3.8cm, minimum height=1cm, font=\small},
  designstyle/.style={fill=blue!20},
  designstyle_blur/.style={fill=blue!20, opacity=0.3},
  designstyle_bold/.style={fill=blue!20, thick, draw=black, font=\bfseries},
  datastyle/.style={fill=orange!20},
  datastyle_blur/.style={fill=orange!20, opacity=0.3},
  datastyle_bold/.style={fill=orange!20, thick, draw=black, font=\bfseries },
  analysisstyle/.style={fill=teal!20, opacity=0.3},
  reportstyle/.style={fill=yellow!40, thick, draw=black, font=\bfseries, opacity=0.3},
  fadedarrow/.style={->, thick, opacity=0.3}
]

% Title above left column

% Left column nodes
\node[designstyle_bold] (q) at (-3,1.8) {Economic Question};
\node[designstyle_blur] (sd) at (-3,0) {Strategy and Design};
\node[datastyle_blur] (dc) at (-3,-1.8) {Data Collection};
\node[datastyle_blur] (clean) at (-3,-3.6) {Data Cleaning};

% arrows
\draw[fadedarrow] (q) -- ++(sd);
\draw[fadedarrow] (sd) -- ++(dc);
\draw[fadedarrow] (dc) -- ++(clean);
\end{tikzpicture}

\end{column}

\begin{column}{0.5\textwidth}
	What do you want to know? 

	Who is the audience?
		\begin{itemize}
		        \onslide<2->\item{Do coal prices affect Wyoming employment?}
			\onslide<3->\item{\only<3-5>{What factors affect Wyoming tourism?}\only<6->{\textbf{What factors affect Wyoming tourism?}}}
			\onslide<4->\item{How to increase company sales?}
		        \onslide<5->\item{What will the price of bitcoin be in each of the next 10 years?}
		\end{itemize}

\end{column}
	\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Strategy and Design}
\centering
\begin{columns}
	\begin{column}{0.5\textwidth}

\begin{tikzpicture}[
  node distance=1.5cm and 2.5cm,
  every node/.style={draw, rounded corners, text centered, minimum width=3.8cm, minimum height=1cm, font=\small},
  designstyle/.style={fill=blue!20},
  designstyle_blur/.style={fill=blue!20, opacity=0.3},
  designstyle_bold/.style={fill=blue!20, thick, draw=black, font=\bfseries},
  datastyle/.style={fill=orange!20},
  datastyle_blur/.style={fill=orange!20, opacity=0.3},
  datastyle_bold/.style={fill=orange!20, thick, draw=black, font=\bfseries },
  analysisstyle/.style={fill=teal!20, opacity=0.3},
  reportstyle/.style={fill=yellow!40, thick, draw=black, font=\bfseries, opacity=0.3},
  fadedarrow/.style={->, thick, opacity=0.3}
]

% Title above left column

% Left column nodes
\node[designstyle_blur] (q) at (-3,1.8) {Economic Question};
\node[designstyle_bold] (sd) at (-3,0) {Strategy and Design};
\node[datastyle_blur] (dc) at (-3,-1.8) {Data Collection};
\node[datastyle_blur] (clean) at (-3,-3.6) {Data Cleaning};

% arrows
\draw[fadedarrow] (q) -- ++(sd);
\draw[fadedarrow] (sd) -- ++(dc);
\draw[fadedarrow] (dc) -- ++(clean);
\end{tikzpicture}

\end{column}

\begin{column}{0.5\textwidth}
	\only<1-6>{\textbf{Making a plan}
		\begin{itemize}
		        \onslide<1->\item{Analysis method selection}
		\onslide<2->\item{What computer language to use}
			\onslide<3->\item{What data will you need \emph{ideally}?}
			\onslide<4->\item{Is the data available?}
		        \onslide<5->\item{How hard is it to get the data?}
		        \onslide<6->\item{How hard is the data to use?}
		\end{itemize}
		\onslide<6->{Should you rethink the strategy?}
		\onslide<6->{Should you change the question?}
	}
\end{column}
	\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Strategy and Design: Example}
\centering
\begin{columns}
	\begin{column}{0.5\textwidth}

\begin{tikzpicture}[
  node distance=1.5cm and 2.5cm,
  every node/.style={draw, rounded corners, text centered, minimum width=3.8cm, minimum height=1cm, font=\small},
  designstyle/.style={fill=blue!20},
  designstyle_blur/.style={fill=blue!20, opacity=0.3},
  designstyle_bold/.style={fill=blue!20, thick, draw=black, font=\bfseries},
  datastyle/.style={fill=orange!20},
  datastyle_blur/.style={fill=orange!20, opacity=0.3},
  datastyle_bold/.style={fill=orange!20, thick, draw=black, font=\bfseries },
  analysisstyle/.style={fill=teal!20, opacity=0.3},
  reportstyle/.style={fill=yellow!40, thick, draw=black, font=\bfseries, opacity=0.3},
  fadedarrow/.style={->, thick, opacity=0.3}
]

% Title above left column

% Left column nodes
\node[designstyle_blur] (q) at (-3,1.8) {Economic Question};
\node[designstyle_bold] (sd) at (-3,0) {Strategy and Design};
\node[datastyle_blur] (dc) at (-3,-1.8) {Data Collection};
\node[datastyle_blur] (clean) at (-3,-3.6) {Data Cleaning};

% arrows
\draw[fadedarrow] (q) -- ++(sd);
\draw[fadedarrow] (sd) -- ++(dc);
\draw[fadedarrow] (dc) -- ++(clean);
\end{tikzpicture}

\end{column}

\begin{column}{0.5\textwidth}

\onslide<1->{Linear Regression}
		\newline
		\onslide<2->{R would work well}
\newline
		\onslide<3->{\textbf{Ideal Data}
	\begin{enumerate}
		\onslide<4->{\item{Skiing numbers}}
		\onslide<5->{\item{Temperature}}
		\onslide<6->{\item{Air quality}}
           	\onslide<7->{\item{Snow fall}}
		\onslide<8->{\item{Road closures}}
		\onslide<9->{\item{Distance travelled of visitors}}
		\onslide<10->{\item{Income}}
		\onslide<11->{\item{Population trends}}
		\onslide<12->{\item{Skiing trends in other states}}
	\end{enumerate}
}
\onslide<13->{Narrow focus?}
\end{column}
\end{columns}
\end{frame}


%%%%%%%%%%%%%%%%%%
\begin{frame}{Data collection}
\begin{columns}
	\begin{column}{0.5\textwidth}
\begin{tikzpicture}[
  node distance=1.5cm and 2.5cm,
  every node/.style={draw, rounded corners, text centered, minimum width=3.8cm, minimum height=1cm, font=\small},
  designstyle/.style={fill=blue!20},
  designstyle_blur/.style={fill=blue!20, opacity=0.3},
  designstyle_bold/.style={fill=blue!20, thick, draw=black, font=\bfseries},
  datastyle/.style={fill=orange!20},
  datastyle_blur/.style={fill=orange!20, opacity=0.3},
  datastyle_bold/.style={fill=orange!20, thick, draw=black, font=\bfseries },
  analysisstyle/.style={fill=teal!20, opacity=0.3},
  reportstyle/.style={fill=yellow!40, thick, draw=black, font=\bfseries, opacity=0.3},
  fadedarrow/.style={->, thick, opacity=0.3}
]

% Title above left column

% Left column nodes
\node[designstyle_blur] (q) at (-3,1.8) {Economic Question};
\node[designstyle_blur] (sd) at (-3,0) {Strategy and Design};
\node[datastyle_bold] (dc) at (-3,-1.8) {Data Collection};
\node[datastyle_blur] (clean) at (-3,-3.6) {Data Cleaning};

% arrows
\draw[fadedarrow] (q) -- ++(sd);
\draw[fadedarrow] (sd) -- ++(dc);
\draw[fadedarrow] (dc) -- ++(clean);
\end{tikzpicture}
\end{column}
	\begin{column}{0.5\textwidth}

	\begin{itemize}
		\onslide<1->{\item{Identify key needs}}
		\onslide<2->{\item{Observe possible data sets}}
		\onslide<3->{\item{Evaluate data options}}
		\onslide<4->{\item{Develop code}}
	\end{itemize}
\end{column}
\end{columns}
\end{frame}

\begin{frame}{Data Collection}
\only<1>{\includegraphics[width=\textwidth]{"Data_Types"}}
\only<2-7>{
\centering
\begin{columns}
	\begin{column}{0.5\textwidth}
\begin{tikzpicture}[
  node distance=1.5cm and 2.5cm,
  every node/.style={draw, rounded corners, text centered, minimum width=3.8cm, minimum height=1cm, font=\small},
  designstyle/.style={fill=blue!20},
  designstyle_blur/.style={fill=blue!20, opacity=0.3},
  designstyle_bold/.style={fill=blue!20, thick, draw=black, font=\bfseries},
  datastyle/.style={fill=orange!20},
  datastyle_blur/.style={fill=orange!20, opacity=0.3},
  datastyle_bold/.style={fill=orange!20, thick, draw=black, font=\bfseries },
  analysisstyle/.style={fill=teal!20, opacity=0.3},
  reportstyle/.style={fill=yellow!40, thick, draw=black, font=\bfseries, opacity=0.3},
  fadedarrow/.style={->, thick, opacity=0.3}
]

% Title above left column

% Left column nodes
\node[designstyle_blur] (q) at (-3,1.8) {Economic Question};
\node[designstyle_blur] (sd) at (-3,0) {Strategy and Design};
\node[datastyle_bold] (dc) at (-3,-1.8) {Data Collection};
\node[datastyle_blur] (clean) at (-3,-3.6) {Data Cleaning};

% arrows
\draw[fadedarrow] (q) -- ++(sd);
\draw[fadedarrow] (sd) -- ++(dc);
\draw[fadedarrow] (dc) -- ++(clean);
\end{tikzpicture}
\end{column}



	\begin{column}{0.5\textwidth}
		\textbf{Data considerations}
		\begin{itemize}
			\onslide<3->{\item{Reputable data set}}
				\onslide<4->{\item{Ease of access for a computer}}
				\onslide<5->{\item{Able to extract automatically}}
				\onslide<6->{\item{Able to verify results}}
				\onslide<7->{\item{Will the data change in the future?}}
		\end{itemize}

	\end{column}
\end{columns}
	}
\only<8->{
	Challenging data collection is not always bad. 

	A good paper may either use advanced methods OR new data.
	\begin{center}
	\includegraphics[width=0.75\textwidth]{"Searching"}
\end{center}
}

\end{frame}
%%%%%%%%%%%%%%%%%%

\begin{frame}{Data Collection: Example}
	\begin{itemize}
		\item{\href{https://www.wrds.uwyo.edu/wrds/nrcs/nrcs.html}{Snow Pack}}
		\item{\href{https://www.nsaa.org/NSAA/Store/Research/Shared_Content/Shop/All_Products_Pages/Research.aspx?hkey=818ad543-3c76-}{All data but paid}}
		\item{\href{https://www.nps.gov/subjects/socialscience/visitor-use-statistics-dashboard.htm}{National Park Query}}
		\item{\href{https://aqs.epa.gov/aqsweb/airdata/download_files.html}{Air Quality}}
	\item{\href{https://wyoroad.info/Highway/History/HistoricalInfo.html}{WYDOT road closure}}
	\item{\href{https://fred.stlouisfed.org/series/MEHOINUSWYA672N}{Real Wyoming Income \((\)clean data set\()\)}}
	\end{itemize}
\end{frame}


%%%%%%%%%%%%%%%%%%
\begin{frame}{Data Cleaning}
\begin{columns}
	\begin{column}{0.5\textwidth}
\begin{tikzpicture}[
  node distance=1.5cm and 2.5cm,
  every node/.style={draw, rounded corners, text centered, minimum width=3.8cm, minimum height=1cm, font=\small},
  designstyle/.style={fill=blue!20},
  designstyle_blur/.style={fill=blue!20, opacity=0.3},
  designstyle_bold/.style={fill=blue!20, thick, draw=black, font=\bfseries},
  datastyle/.style={fill=orange!20},
  datastyle_blur/.style={fill=orange!20, opacity=0.3},
  datastyle_bold/.style={fill=orange!20, thick, draw=black, font=\bfseries },
  analysisstyle/.style={fill=teal!20, opacity=0.3},
  reportstyle/.style={fill=yellow!40, thick, draw=black, font=\bfseries, opacity=0.3},
  fadedarrow/.style={->, thick, opacity=0.3}
]

% Title above left column

% Left column nodes
\node[designstyle_blur] (q) at (-3,1.8) {Economic Question};
\node[designstyle_blur] (sd) at (-3,0) {Strategy and Design};
\node[datastyle_blur] (dc) at (-3,-1.8) {Data Collection};
\node[datastyle_bold] (clean) at (-3,-3.6) {Data Cleaning};

% arrows
\draw[fadedarrow] (q) -- ++(sd);
\draw[fadedarrow] (sd) -- ++(dc);
\draw[fadedarrow] (dc) -- ++(clean);
\end{tikzpicture}
\end{column}

\begin{column}{0.5\textwidth}
\textbf{Tidy data}
\begin{itemize}
		\item{Each variable is a column; each column is a variable.}
		\item{Each observation is a row; each row is an observation.}
		\item{Each value is a cell; each cell is a single value.}
\end{itemize}
\end{column}
\end{columns}
\end{frame}

\begin{frame}{Data Cleaning}
\centering
\only<2>{\includegraphics[width=\textwidth]{"Data_Conversion"}}
\only<3>{\includegraphics[width=\textwidth]{"Data_Flow"}}
\only<1>{\includegraphics[width=\textwidth]{"CSV_Clean"}}
\end{frame}
%%%%%%%%%%%%%%%%%%
\begin{frame}{Data Cleaning: Example}
	\begin{center}
	\includegraphics[width=0.65\textwidth]{"Clean_Example"}
\end{center}
Make the data computer ready
	\begin{itemize}
		\onslide<2->{	\item{Convert from HTML table to CSV}}
		\onslide<3->{	\item{Aggregate each Basin}}
		\onslide<4->{	\item{Make code to pull data over time with URL changes}}
	\end{itemize}


\end{frame}

\begin{frame}{Next Class}
		\begin{itemize}
		\item{Install R-base}
		\item{Install R-Studio}
		\item{Load tidyverse in R}
		\item{Homework}
			\begin{enumerate}
				\item{Develop at least three economic questions you are interested in}
				\item{5530: Select one question and appropriate analysis}
				\item{Create a list of relevant data}
				\item{Find at least three data sets on the list and provide a URL}
				\item{5530: Explain the main challenges to making the data usable}
				\item{4430: Submit a list of these findings}
				\item{5530: Provide a memo or one page report with this information} 
			\end{enumerate}

			\end{itemize}


\end{frame}


\end{document}
