Skip to content

Employ linear and autoregressive models to forecast Ethereum prices based on historical data and lagged variables.

Notifications You must be signed in to change notification settings

RoryQo/Ethereum-Stock-Price-Prediction

Repository files navigation

Ethereum Stock Price Prediction

This README provides an overview of the code for predicting Ethereum stock prices using linear regression and autoregressive models. It includes data preparation, model fitting, and visualization steps.

Table of Contents

  1. Prerequisites
  2. Data Input
  3. Time Series Plot
  4. Modeling
  5. Correlation Analysis
  6. Autoregressive Model
  7. Model Visualization
  8. Conclusion

Prerequisites

Make sure you have the necessary R packages installed. This code specifically requires the car package for the Durbin-Watson test.

Data Input

Read the Ethereum price data from a CSV file.

Time Series Plot

Create a time series plot to visualize Ethereum prices over time.

Modeling

Fit a simple linear regression model using time as the predictor.

Residual Plot

Visualize the residuals from the model.

Graph 2

Durbin-Watson Test

Perform a Durbin-Watson test to check for autocorrelation in the residuals.

durbinWatsonTest(model)

Correlation Analysis

Create lagged terms for the price and calculate correlations.

Autoregressive Model

Fit an autoregressive model using the first four lagged terms.

model = ar.ols(ethereum$price, order.max = 10, demean = F, intercept = T)

Durbin-Watson Test for Autoregressive Model

Check for autocorrelation in the residuals.

Model Visualization

Plot the actual vs. fitted values from the autoregressive model.

Ethereum Price Prediction

Conclusion

This code provides a comprehensive approach to predicting Ethereum stock prices using linear and autoregressive models.

The analysis indicates that the following lagged terms are important for predicting Ethereum prices:

  • Lag 1: Shows a strong positive correlation and is significant in the autoregressive model.
  • Lag 4: Exhibits a significant negative coefficient, suggesting an important delayed effect.
  • Lag 2 and Lag 3: Although not statistically significant, they still contribute to the model's predictive power.

These insights can help refine future forecasting efforts and suggest that incorporating these lags may improve model performance. For further exploration, consider experimenting with different model orders or additional predictors to enhance forecasting accuracy.

About

Employ linear and autoregressive models to forecast Ethereum prices based on historical data and lagged variables.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published