I'm trying to use a twitter volume per day variable and a google trends frequency per day variable to predict price of a volatile crypto currency. More specifically, I'm trying to replicate the model in Abraham, J., Higdon, D., Nelson, J., & Ibarra, J. (2018). Cryptocurrency price prediction using tweet volumes and sentiment analysis. SMU Data Science Review, 1(3), Here is a link to that paper The coin is fairly new and I only have data for 605 days. I want to one: determine the fit of different models (i.e., if including one variable is more predictive than another), and two: what approach is best to forecast a few days out. I've tried using ARIMA for multiple time series, as well as the tslm() function, although I cannot decompose my data and there are issues because the period (years) are less than two, which makes it hard getting my data to stationary. In addition, some of my variables seem to have a more exponential trend than linear. Below are my three ts() variables.
price <- ts(df[, 4], start = c(2018, 342), end=c(2020, 214), frequency=365) tweetvol <- ts(df[, 3], start = c(2018, 342), end=c(2020, 214), frequency=365) googletrend <- ts(df[, 2], start = c(2018, 342), end=c(2020, 214), frequency=365)
Here is a graph of the three variables without any transformations. I took the log() of each variable so they could all be visible on one graph. Keep in mind this smoothed out a lot of the trend.
autoplot(cbind(log(price), log(tweetvol), log(googletrend)))
By simply running a multiple linear regression,it appears google trend volume is a poor choice of a variable to include.
model <- lm(price ~ vol + trendvalue, df) summary(model) Call: lm(formula = price ~ vol + trendvalue, data = df) Residuals: Min 1Q Median 3Q Max -0.0082747 -0.0012608 -0.0003695 0.0009277 0.0109091 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.004348434 0.000131397 33.094 <0.0000000000000002 *** vol 0.000004993 0.000000315 15.854 <0.0000000000000002 *** trendvalue -0.000007426 0.000016745 -0.443 0.658 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.002311 on 600 degrees of freedom Multiple R-squared: 0.4044, Adjusted R-squared: 0.4025 F-statistic: 203.7 on 2 and 600 DF, p-value: < 0.00000000000000022
I think the tslm() function would be my best bet opposed to ARIMA as long as I can get around the stationary issues (I may need to change my data daily and weekly so the periods are larger than 2), for I'm not positive regarding the causality assumptions in ARIMA. I've also looked into machine learning approaches (H2O), but it seems like black box methods are not the best tool for time series forecasting. I'm open to new ideas and approaches and wanted to put some feelers out before diving into getting ARIMA or tslm() to work if it's not the best tool for the job. Thank you all for taking the time to read this lengthy post. I'm an Industrial Organizational Psychology PhD student wanting to better my data science skills - I have very little experience with time series variables or forecasting market prices and appreciate any direction you all can provide.