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:
- Create an ARIMA model in predicting the Quarterly Google Stock Price from the
goog200.csvdataset provided in this same repository. - Assume that the dataset is of quarterly intervals
- Just use the most recent 20 years of data (i.e 80 quarters or datapoints).
- Visualize the dataset.
- 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
- Predict the next 2 years of data (8 quarters). Plot the predictions together with the historical data
- 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:
- Create an ARIMA model in predicting the Quarterly Google Stock Price from the
goog200.csvdataset provided in this same repository. - Assume that the dataset is of quarterly intervals
- Just use the most recent 20 years of data (i.e 80 quarters or datapoints).
- Visualize the dataset.
- 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
- Predict the next 2 years of data (8 quarters). Plot the predictions together with the historical data
- Evaluate the performance of the model using RMSE.
Problem 3. Predicting Debit Card transactions using Exponential Smoothing
- Use the provided data named
debitcards.csv.
- Visualize the data with proper axis labels and title. Interpret the visualization in 2-3 sentences.
- 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 fromMean Method,naive Method, andDrift. Plot predictions with the true data. Evaluate the predictions usingMAE,RMSE, andMAPEin a DataFrame. Interpret the resulting DataFrame.
- 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=100for convergence. The test size is equal to 24 months. CompareHolt-Winters ADDandHolt-Winters MULpredictions with predictons fromSeasonal NaiveandNaive. Plot predictions with the true data. Evaluate the predictions usingMASE_SEA,RMSE, andMAPEin a DataFrame. Interpret the resulting DataFrame.