Course Content
Time Series Analysis
Time Series Analysis
Challenge
Swipe to show code editor
Create an autoregressive model to predict the dataset aapl.csv
. After, print the results and the model error.
- Read the
aapl.csv
dataset. - Create an autoregressive model (
AutoReg
) with 3 lags for theX
data and assign it to themodel
variable. - Fit model to the data and assign it to the
model_fit
variable. - Predict the first 30 values.
- Visualize the results: display the first 30 values of
X
within the first call of theprint()
function, and first 30 values of thepredictions
within the second call. - Calculate the RMSE (square root of the mean squared error) and display it.
Thanks for your feedback!
Challenge
Swipe to show code editor
Create an autoregressive model to predict the dataset aapl.csv
. After, print the results and the model error.
- Read the
aapl.csv
dataset. - Create an autoregressive model (
AutoReg
) with 3 lags for theX
data and assign it to themodel
variable. - Fit model to the data and assign it to the
model_fit
variable. - Predict the first 30 values.
- Visualize the results: display the first 30 values of
X
within the first call of theprint()
function, and first 30 values of thepredictions
within the second call. - Calculate the RMSE (square root of the mean squared error) and display it.
Thanks for your feedback!
Challenge
Swipe to show code editor
Create an autoregressive model to predict the dataset aapl.csv
. After, print the results and the model error.
- Read the
aapl.csv
dataset. - Create an autoregressive model (
AutoReg
) with 3 lags for theX
data and assign it to themodel
variable. - Fit model to the data and assign it to the
model_fit
variable. - Predict the first 30 values.
- Visualize the results: display the first 30 values of
X
within the first call of theprint()
function, and first 30 values of thepredictions
within the second call. - Calculate the RMSE (square root of the mean squared error) and display it.
Thanks for your feedback!
Swipe to show code editor
Create an autoregressive model to predict the dataset aapl.csv
. After, print the results and the model error.
- Read the
aapl.csv
dataset. - Create an autoregressive model (
AutoReg
) with 3 lags for theX
data and assign it to themodel
variable. - Fit model to the data and assign it to the
model_fit
variable. - Predict the first 30 values.
- Visualize the results: display the first 30 values of
X
within the first call of theprint()
function, and first 30 values of thepredictions
within the second call. - Calculate the RMSE (square root of the mean squared error) and display it.