The Rise of FinTech and Its Impact on Traditional Investment
Midterm Project: Data and Preliminary Analysis (R version)
Data
Daily returns (%) for a FinTech fund, equities, bonds and Bitcoin. test_data.csv is synthetic, used only to test the pipeline. Replace it with real_data.csv when you have downloaded real data.
roll_cor <-function(x, y, w =60) { out <-rep(NA_real_, length(x))for (i in w:length(x)) out[i] <-cor(x[(i-w+1):i], y[(i-w+1):i]) out}r_eq <-roll_cor(vals$FinTech_ETF, vals$Equity_SP500)r_btc <-roll_cor(vals$FinTech_ETF, vals$Bitcoin)plot(df$Date, r_eq, type ="l", col ="blue", ylim =c(-0.2, 1),xlab ="", ylab ="60-day rolling correlation")lines(df$Date, r_btc, col ="red")legend("bottomright", c("FinTech vs equities", "FinTech vs Bitcoin"),col =c("blue", "red"), lty =1, cex =0.8)