Time Series and Forecasting
Preface
Readings and references
Time series
Statistics with R
Data science with R, general
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
Project workflow
Example problem: Estimating the probability of a weather event
2.1
State your question
2.2
Acquire data and background information
2.3
Organize your data
2.4
Perform exploratory analysis of your data
2.5
Write down your model of the data generating process
2.5.1
Comments on this statistical model: The risk of model mis-specification
2.6
If necessary: transform the model and data to make it ready for analysis
2.7
Choose an appropriate technique for estimating model parameters, consistent with your assumptions about your data generating process
2.8
Estimate model parameters
2.9
Confirm that your modeling assumptions are satisfied
2.10
Compute measures of model quality; confirm that your model is good enough for your purpose
2.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 a 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
Assignment: Update your concept and get your data
8.1
Refine your concept note
8.2
Identify a time series data set you want to work with
8.3
Acquire the data from its source location, reproducibly
8.4
Stage your raw data
8.4.1
Smaller data sets
8.4.2
Larger data sets
8.5
Submission procedure
8.6
Other comments
9
Data preparation strategy
9.1
Overview: Extraction, transformation, and loading of data
9.2
Organize your data into a
tidy
data frame
9.3
Convert your data into a
tsibble
object
9.4
Data preparation strategy: Design your end-point data table(s)
9.4.1
Design your end point first (at least, in your head).
9.4.2
Typical structure for a time series data table
9.5
Additional resources and next steps
10
Reading in data from source files
10.1
First, examine text files in a text editor
10.2
Read in CSV files
10.2.1
Declaring data types
11
Data cleaning
11.1
Dropping empty rows and columns
12
Transform a data frame to
tsibble
object
12.1
Time indexing
12.2
Running diagnostics on your tsibble
12.2.1
Duplicate values
12.2.2
Missing values
12.2.3
Irregular time intervals
13
Saving and loading data files
13.1
Fast file reading and writing: The
arrow
package
14
Assignment: Prepare your data
14.1
Generate at least one table or figure
IV Exploratory Data Analysis
15
Exploratory analysis of time series data
15.1
Overview
15.2
Briefly characterize the dataset
15.2.1
Examine subsets of the data
15.3
Plot the time series
15.4
Sesaonal plots
15.4.1
Example: Virginia monthly electricity
15.4.2
Example: Australian production
15.4.3
Seasonal subseries plots
15.5
Scatterplots
15.5.1
A Scatterplot matrix
16
Time series decomposition
16.0.1
Example: Gross Domestic Product data
16.0.2
Fitting data to simple models
16.0.3
Work with ln(GDP)
16.1
Producing forecasts
16.1.1
Model residuals vs. forecast errors
16.1.2
Are the model residuals auto-correlated?
16.2
Example: GDP, several countries
16.2.1
Plot lagged values
17
Autocorrelation
17.1
Heere be monsters
V Model Specification and Estimation
18
The data-generating process
18.1
The white noise process
18.1.1
Stationarity
18.1.2
No autocorrelation
19
The normal linear model
19.1
Assumptions of the linear model
19.2
Examples of the normal linear model
20
Ordinary least squares estimation
21
Assignment: Project proposal
21.1
Introduction
21.2
The data and the data-generating process
21.3
Exploratory data analysis
21.4
Plot the time series.
21.5
Perform and report the results of other exploratory data analysis
21.5.1
STL decomposition
21.5.2
Fitting data to simple models
21.5.3
Work with ln(GDP)
21.6
Statistical model
21.6.1
Formal model of data-generating process
21.6.2
Discussion of the statistical model
21.7
Plan for data analysis
21.8
Submission requirements
21.9
Comment
21.10
References
VI Model evaluation
22
Evaluating model residuals
22.1
Model residuals vs. forecast errors
22.2
Are the model residuals auto-correlated?
22.3
Example: GDP, several models, several countries
VII Forecasting
23
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: A Project-based Approach with R
Chapter 1
Introduction
Readings: FPP3, Ch. 1
1.1
What is time series analysis?
1.2
Time series data
1.3
Time series patterns
Examples.
1.4
Types of problems that are amenable to time series analysis
1.5
Time series and forecasting
1.6
Overview of the course