Final Exam - DS412 Time Series Analysis and Stochastic Methods

Name: <[Insert Name]>
Section: <[Insert Section]>

Part 1. Essay (Situational/Applied) Questions|

Q1. Differentiate and elaborate ARIMA from SARIMA and vice versa. You can use illustrations and mathematical expression should you want to.

(Insert Answer Here)

Q2. Given that we have undergone a couple of metrics in calculating error for TSA, choose 3 among all those metrics and elaborate.

(Insert Answer Here)

Q3. Given the implementation of baseline predictions below, kindly differentiate mean forecasts from naive forecasts.

def meanf(ts, h): f = np.mean(ts) f = np.repeat(f, repeats=h) return f

def naivef(ts, h): f = ts[-1] f = np.repeat(f, repeats=h) return f

(Insert Answer Here)

Q4. Based on your understanding, explain the LightGBM algorithm in tiime series forecasting.

(Insert Answer Here)

Q5. In machine learning time series forecasting, why do we need to divide the dataset into train and test?

(Insert Answer Here)

Part 2. Time Series Forecasting (Code Implementation)

Instructions: Document and explain your code as you go along the items. The better documentation, the higher the points.

Problem 1. Predicting Google's Stock Price using ARIMA

Document your code properly and satisfy the following conditions:

  1. Create an ARIMA model in predicting the Quarterly Google Stock Price from the goog200.csv dataset provided in this same repository.
  2. Assume that the dataset is of quarterly intervals
  3. Just use the most recent 20 years of data (i.e 80 quarters or datapoints).
  4. Visualize the dataset.
  5. Find the optimal ARIMA model from the following set of p, d, q values:

p: from 0 to 5
d: d = 1
q: from 0 to 5

  1. Predict the next 2 years of data (8 quarters). Plot the predictions together with the historical data
  2. Evaluate the performance of the model using RMSE.

Problem 2. Predicting Google's Stock Price using SARIMA

Document your code properly and satisfy the following conditions:

  1. Create an ARIMA model in predicting the Quarterly Google Stock Price from the goog200.csv dataset provided in this same repository.
  2. Assume that the dataset is of quarterly intervals
  3. Just use the most recent 20 years of data (i.e 80 quarters or datapoints).
  4. Visualize the dataset.
  5. Find the optimal ARIMA model from the following set of p, d, q values:

p: from 0 to 5; P: from 0 to 5

d: d = 1; D: D = 1

q: from 0 to 5; Q: from 0 to 5

  1. Predict the next 2 years of data (8 quarters). Plot the predictions together with the historical data
  2. Evaluate the performance of the model using RMSE.

Problem 3. Predicting Debit Card transactions using Exponential Smoothing

  1. Use the provided data named debitcards.csv.

  2. Visualize the data with proper axis labels and title. Interpret the visualization in 2-3 sentences.

  3. Perform Simple Exponential Smoothing (SES) using the optimized SES parameters on the train data through optimized=True. The test size is equal to 4 months. Compare SES predictions with predictons from Mean Method, naive Method, and Drift. Plot predictions with the true data. Evaluate the predictions using MAE, RMSE, and MAPE in a DataFrame. Interpret the resulting DataFrame.

  4. Perform Seasonality Methods forecasting on the train data using Holt-Winters Additive Version and Holt-Winters Multiplicative Version. Identify the seasonal component of the dataset first and limit max_iter=100 for convergence. The test size is equal to 24 months. Compare Holt-Winters ADD and Holt-Winters MUL predictions with predictons from Seasonal Naive and Naive. Plot predictions with the true data. Evaluate the predictions using MASE_SEA, RMSE, and MAPE in a DataFrame. Interpret the resulting DataFrame.