Time Series and Forecasting
Preface
Readings
Acknowledgements
I Introduction and Overview
1
Introduction
1.1
What is time series analysis?
1.2
Time series data
1.3
Time series patterns
1.4
Types of problems that are amenable to time series analysis
1.5
Time series and forecasting
1.6
Overview of the course
2
Example: A very simple time series analysis
2.1
The project
Example problem: Estimating the probability of a weather event
2.2
1. State your question
2.3
2. Acquire data and background information
2.4
3. Organize your data
2.5
4. Perform exploratory analysis of your data
2.6
5. Write down your model of the data generating process
2.6.1
Comments on this statistical model: The risk of model mis-specification
2.7
6. If necessary: transform the model and data to make it ready for analysis
2.8
7. Choose an appropriate technique for estimating model parameters, consistent with your assumptions about your data generating process
2.9
8. Estimate model parameters
2.10
9. Confirm that your modeling assumptions are satisfied
2.11
10. compute measures of model quality; confirm that your model is good enough for your purpose
2.12
11. Use your calibrated model to address your original question.
3
Assignment: Write a concept note
3.1
Assignment Instructions
3.2
Submission procedure
3.3
Choosing a topic
II Set up
4
Project set up: Good practices
4.1
Reproducible workflows
4.2
Setting up new project
4.3
Folder structure
4.4
Naming things
5
Assignment: Set up your computing environment
5.1
The R programming language, and related resources
5.2
Git and Github
5.2.1
Using personal tokens to access Github
5.3
Markdown and R Markdown
5.4
Bibliographic resources: Zotero and Bibtex
5.5
General course web resources
III Data Acquisition and Preparation
6
Finding a dataset for your project
6.1
Appropriate data sets for time series analysis
6.2
Data resources
7
Data acquisition and extraction
7.1
Access protocols and permissions
7.2
Accessing databases
7.3
Other comments
8
Data preparation strategy
8.1
Data preparation strategy: Design your end-point data table(s)
8.1.1
Design your end point first (at least, in your head).
8.1.2
Typical structure for a time series data table:
9
Reading in data from source files
9.1
First, examine text files in a text editor
9.2
Read in CSV files
9.2.1
Declaring data types
10
Data cleaning
10.1
Dropping empty rows and columns
11
Transform a data frame to
tsibble
object
11.1
Time indexing
11.2
Running diagnostics on your tsibble
11.2.1
Duplicate values
11.2.2
Missing values
11.2.3
Irregular time intervals
12
Saving and loading data files
12.1
Fast file reading and writing: The
arrow
package
13
Assignment: Extract and prepare your data
13.1
Overview: Extraction, transformation, and loading of data
13.2
Step 1: Identify a time series data set you want to work with
13.3
Step 2: Acquire the data from its source location, reproducibly
13.4
Step 3 Organize your data into a
tidy
data frame
13.5
Step 4: Convert your data into a
tsibble
object
13.6
Step 5: Generate at least one table or figure
13.7
Additional resources and next steps
Announcement: One more week to revise & resubmit data ETL assignment
13.8
References
IV Exploratory Data Analysis
14
Exploratory analysis of time series data
14.1
Overview
14.2
Briefly characterize the dataset
14.2.1
Examine subsets of the data
14.3
Plot the time series
14.4
Sesaonal plots
14.4.1
Example: Virginia monthly electricity
14.4.2
Example: Australian production
14.4.3
Seasonal subseries plots
14.5
Scatterplots
14.5.1
A Scatterplot matrix
15
Time series decomposition
15.0.1
Example: Gross Domestic Product data
15.0.2
Fitting data to simple models
15.0.3
Work with ln(GDP)
15.1
Producing forecasts
15.1.1
Model residuals vs. forecast errors
15.1.2
Are the model residuals auto-correlated?
15.2
Example: GDP, several countries
15.2.1
Plot lagged values
16
Autocorrelation
16.1
Heere be monsters
V Model Specification and Estimation
17
The data-generating process
18
The normal linear model
18.1
Assumptions of the linear model
18.2
Examples of the normal linear model
19
Ordinary least squares estimation
20
Assignment: Project proposal
20.1
Introduction
20.2
The data and the data-generating process
20.3
Exploratory data analysis
20.4
Plot the time series.
20.5
Perform and report the results of other exploratory data analysis
20.5.1
STL decomposition
20.5.2
Fitting data to simple models
20.5.3
Work with ln(GDP)
20.6
Statistical model
20.6.1
Formal model of data-generating process
20.6.2
Discussion of the statistical model
20.7
Plan for data analysis
20.8
Submission requirements
20.9
Comment
20.10
References
VI Model evaluation
21
Evaluating model residuals
21.1
Model residuals vs. forecast errors
21.2
Are the model residuals auto-correlated?
21.3
Example: GDP, several models, several countries
VII Forecasting
22
Producing forecasts
References
Appendix
A
Course Syllabus
A.1
Course Description
A.1.1
Prerequisites
A.1.2
Expectations
A.1.3
Readings
A.1.4
Course Objectives
A.1.5
Grading Policy
A.1.6
Attendance Policy
A.1.7
Communications protocols, including emails and office hours
A.1.8
Academic Dishonesty Policy
A.1.9
Disabilities Policy
Published with bookdown
Time Series and Forecasting with R
References